././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1764022438.3038218 asyncpg-0.31.0/0000755000175100017510000000000015111154246012705 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/.flake80000644000175100017510000000037415111154235014062 0ustar00runnerrunner[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=1764022429.0 asyncpg-0.31.0/LICENSE0000644000175100017510000002631215111154235013714 0ustar00runnerrunnerCopyright (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=1764022429.0 asyncpg-0.31.0/MANIFEST.in0000644000175100017510000000035715111154235014446 0ustar00runnerrunnerrecursive-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=1764022429.0 asyncpg-0.31.0/Makefile0000644000175100017510000000167415111154235014353 0ustar00runnerrunner.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=1764022438.3038218 asyncpg-0.31.0/PKG-INFO0000644000175100017510000001047415111154246014010 0ustar00runnerrunnerMetadata-Version: 2.4 Name: asyncpg Version: 0.31.0 Summary: An asyncio PostgreSQL driver Author-email: MagicStack Inc License-Expression: Apache-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: 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.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3.14 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta Classifier: Topic :: Database :: Front-Ends Requires-Python: >=3.9.0 Description-Content-Type: text/x-rst License-File: LICENSE 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" Dynamic: license-file 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.9 or later and is supported for PostgreSQL versions 9.5 to 18. 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=1764022429.0 asyncpg-0.31.0/README.rst0000644000175100017510000000565615111154235014406 0ustar00runnerrunnerasyncpg -- 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.9 or later and is supported for PostgreSQL versions 9.5 to 18. 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=1764022438.2768216 asyncpg-0.31.0/asyncpg/0000755000175100017510000000000015111154246014351 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/__init__.py0000644000175100017510000000120715111154235016460 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/_asyncio_compat.py0000644000175100017510000000475415111154235020102 0ustar00runnerrunner# 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=1764022438.2778218 asyncpg-0.31.0/asyncpg/_testbase/0000755000175100017510000000000015111154246016322 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/_testbase/__init__.py0000644000175100017510000004016315111154235020435 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/_testbase/fuzzer.py0000644000175100017510000002311415111154235020220 0ustar00runnerrunner# 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) ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1764022438.304822 asyncpg-0.31.0/asyncpg/_version.py0000644000175100017510000000120115111154246016541 0ustar00runnerrunner# 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.31.0' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/cluster.py0000644000175100017510000005763415111154235016421 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/compat.py0000644000175100017510000000463315111154235016212 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/connect_utils.py0000644000175100017510000012465615111154235017610 0ustar00runnerrunner# 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 asyncio import configparser import collections from collections.abc import Callable 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' PG_SERVICEFILE = '.pg_service.conf' 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'(? 1: # If there is a list of ports, its length must # match that of the host list. if len(port) != len(hosts): raise exceptions.ClientConfigurationError( 'could not match {} port numbers to {} hosts'.format( len(port), len(hosts))) elif isinstance(port, list) and len(port) == 1: port = [port[0] for _ in range(len(hosts))] else: port = [port for _ in range(len(hosts))] return port def _parse_hostlist(hostlist, port, *, unquote=False): if ',' in hostlist: # A comma-separated list of host addresses. hostspecs = hostlist.split(',') else: hostspecs = [hostlist] hosts = [] hostlist_ports = [] if not port: portspec = os.environ.get('PGPORT') if portspec: if ',' in portspec: default_port = [int(p) for p in portspec.split(',')] else: default_port = int(portspec) else: default_port = 5432 default_port = _validate_port_spec(hostspecs, default_port) else: port = _validate_port_spec(hostspecs, port) for i, hostspec in enumerate(hostspecs): if hostspec[0] == '/': # Unix socket addr = hostspec hostspec_port = '' elif hostspec[0] == '[': # IPv6 address m = re.match(r'(?:\[([^\]]+)\])(?::([0-9]+))?', hostspec) if m: addr = m.group(1) hostspec_port = m.group(2) else: raise exceptions.ClientConfigurationError( 'invalid IPv6 address in the connection URI: {!r}'.format( hostspec ) ) else: # IPv4 address addr, _, hostspec_port = hostspec.partition(':') if unquote: addr = urllib.parse.unquote(addr) hosts.append(addr) if not port: if hostspec_port: if unquote: hostspec_port = urllib.parse.unquote(hostspec_port) hostlist_ports.append(int(hostspec_port)) else: hostlist_ports.append(default_port[i]) if not port: port = hostlist_ports return hosts, port def _parse_tls_version(tls_version): if tls_version.startswith('SSL'): raise exceptions.ClientConfigurationError( f"Unsupported TLS version: {tls_version}" ) try: return ssl_module.TLSVersion[tls_version.replace('.', '_')] except KeyError: raise exceptions.ClientConfigurationError( f"No such TLS version: {tls_version}" ) def _dot_postgresql_path(filename) -> 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, service, servicefile, 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) query = None 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 'service' in query: val = query.pop('service') if not service and val: service = val connection_service_file = servicefile if connection_service_file is None: connection_service_file = os.getenv('PGSERVICEFILE') if connection_service_file is None: homedir = compat.get_pg_home_directory() if homedir: connection_service_file = homedir / PG_SERVICEFILE else: connection_service_file = None else: connection_service_file = pathlib.Path(connection_service_file) 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 query: 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 'service' in query: val = query.pop('service') if service is None: service = val if query: if server_settings is None: server_settings = query else: server_settings = {**query, **server_settings} if connection_service_file is not None and service is not None: pg_service = configparser.ConfigParser() pg_service.read(connection_service_file) if service in pg_service.sections(): service_params = pg_service[service] if 'port' in service_params: val = service_params.pop('port') if not port and val: port = [int(p) for p in val.split(',')] if 'host' in service_params: val = service_params.pop('host') if not host and val: host, port = _parse_hostlist(val, port) if 'dbname' in service_params: val = service_params.pop('dbname') if database is None: database = val if 'database' in service_params: val = service_params.pop('database') if database is None: database = val if 'user' in service_params: val = service_params.pop('user') if user is None: user = val if 'password' in service_params: val = service_params.pop('password') if password is None: password = val if 'passfile' in service_params: val = service_params.pop('passfile') if passfile is None: passfile = val if 'sslmode' in service_params: val = service_params.pop('sslmode') if ssl is None: ssl = val if 'sslcert' in service_params: val = service_params.pop('sslcert') if sslcert is None: sslcert = val if 'sslkey' in service_params: val = service_params.pop('sslkey') if sslkey is None: sslkey = val if 'sslrootcert' in service_params: val = service_params.pop('sslrootcert') if sslrootcert is None: sslrootcert = val if 'sslnegotiation' in service_params: val = service_params.pop('sslnegotiation') if sslnegotiation is None: sslnegotiation = val if 'sslcrl' in service_params: val = service_params.pop('sslcrl') if sslcrl is None: sslcrl = val if 'sslpassword' in service_params: val = service_params.pop('sslpassword') if sslpassword is None: sslpassword = val if 'ssl_min_protocol_version' in service_params: val = service_params.pop( 'ssl_min_protocol_version' ) if ssl_min_protocol_version is None: ssl_min_protocol_version = val if 'ssl_max_protocol_version' in service_params: val = service_params.pop( 'ssl_max_protocol_version' ) if ssl_max_protocol_version is None: ssl_max_protocol_version = val if 'target_session_attrs' in service_params: dsn_target_session_attrs = service_params.pop( 'target_session_attrs' ) if target_session_attrs is None: target_session_attrs = dsn_target_session_attrs if 'krbsrvname' in service_params: val = service_params.pop('krbsrvname') if krbsrvname is None: krbsrvname = val if 'gsslib' in service_params: val = service_params.pop('gsslib') if gsslib is None: gsslib = val if not service: service = os.environ.get('PGSERVICE') 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, service, servicefile): 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, service=service, servicefile=servicefile) 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: asyncio.AbstractEventLoop, host: str, port: int, ssl_context: ssl_module.SSLContext, ssl_is_advisory: bool, ) -> None: 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: bytes) -> None: 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: typing.Optional[Exception]) -> None: if not self.on_data.done(): if exc is None: exc = ConnectionError('unexpected connection_lost() call') self.on_data.set_exception(exc) _ProctolFactoryR = typing.TypeVar( "_ProctolFactoryR", bound=asyncio.protocols.Protocol ) async def _create_ssl_connection( # TODO: The return type is a specific combination of subclasses of # asyncio.protocols.Protocol that we can't express. For now, having the # return type be dependent on signature of the factory is an improvement protocol_factory: Callable[[], _ProctolFactoryR], host: str, port: int, *, loop: asyncio.AbstractEventLoop, ssl_context: ssl_module.SSLContext, ssl_is_advisory: bool = False, ) -> typing.Tuple[asyncio.Transport, _ProctolFactoryR]: 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) assert new_tr is not None 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 try: 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) finally: async def _close_candidates(conns, chosen): await asyncio.gather( *(c.close() for c in conns if c is not chosen), return_exceptions=True ) if candidates: asyncio.create_task( _close_candidates(candidates, chosen_connection)) 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=1764022429.0 asyncpg-0.31.0/asyncpg/connection.py0000644000175100017510000030137515111154235017071 0ustar00runnerrunner# 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: typing.Optional[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: typing.Optional[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: typing.Union[str, bool, None] = 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 not typename.endswith("[]"): typeoid = protocol.BUILTIN_TYPE_NAME_MAP.get(typename.lower()) if typeoid is not None: return introspection.TypeRecord((typeoid, None, b"b")) 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, record_class=record_class, ) async def _prepare( self, query, *, name: typing.Union[str, bool, None] = None, timeout=None, use_cache: bool=False, record_class=None ): self._check_open() if name is None: name = self._stmt_cache_enabled stmt = await self._get_statement( query, timeout, named=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: typing.Optional[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) 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, service=None, servicefile=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 service: The name of the postgres connection service stored in the postgres connection service file. :param servicefile: The location of the connnection service file used to store connection parameters. :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 protocol.Record.__new__ or record_class.__init__ is not protocol.Record.__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=1764022429.0 asyncpg-0.31.0/asyncpg/connresource.py0000644000175100017510000000255015111154235017430 0ustar00runnerrunner # 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=1764022429.0 asyncpg-0.31.0/asyncpg/cursor.py0000644000175100017510000002171015111154235016237 0ustar00runnerrunner# 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=1764022438.2778218 asyncpg-0.31.0/asyncpg/exceptions/0000755000175100017510000000000015111154246016532 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/exceptions/__init__.py0000644000175100017510000007074515111154235020656 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/exceptions/_base.py0000644000175100017510000002205415111154235020156 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/introspection.py0000644000175100017510000002217415111154235017627 0ustar00runnerrunner# 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 .protocol.protocol import _create_record # type: ignore 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 ''' def TypeRecord( rec: typing.Tuple[int, typing.Optional[int], bytes], ) -> protocol.Record: assert len(rec) == 3 return _create_record( # type: ignore {"oid": 0, "elemtype": 1, "kind": 2}, rec) # '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=1764022438.2838218 asyncpg-0.31.0/asyncpg/pgproto/0000755000175100017510000000000015111154246016043 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/__init__.pxd0000644000175100017510000000032515111154236020316 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/__init__.py0000644000175100017510000000032515111154236020153 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/buffer.pxd0000644000175100017510000001067615111154236020042 0ustar00runnerrunner# 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 int8_t, uint8_t, int16_t, uint16_t, \ int32_t, uint32_t, int64_t, uint64_t include "./buffer.pxi" 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 int32_t 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/buffer.pxi0000644000175100017510000000013515111154236020034 0ustar00runnerrunnerDEF _BUFFER_INITIAL_SIZE = 1024 DEF _BUFFER_MAX_GROW = 65536 DEF _BUFFER_FREELIST_SIZE = 256 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/buffer.pyx0000644000175100017510000006215615111154236020067 0ustar00runnerrunner# 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 include "./buffer.pxi" @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 int32_t redirect_messages(self, WriteBuffer buf, char mtype, int stop_at=0): # Redirects messages from self into buf until either # a message with a type different than mtype is encountered, or # buf contains stop_at bytes. # Returns the number of messages redirected. 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 int32_t count count = 0 while True: count += 1 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 count if stop_at and buf._length >= stop_at: return count # 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 count += 1 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 count # Back to slow path. if not self.take_message_type(mtype): return count 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=1764022438.2858217 asyncpg-0.31.0/asyncpg/pgproto/codecs/0000755000175100017510000000000015111154246017303 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/__init__.pxd0000644000175100017510000001376215111154236021567 0ustar00runnerrunner# 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) cdef json_encode(CodecContext settings, WriteBuffer buf, obj) cdef json_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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/bits.pyx0000644000175100017510000000270315111154236021007 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/bytea.pyx0000644000175100017510000000174515111154236021157 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/context.pyx0000644000175100017510000000115715111154236021534 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/datetime.pyx0000644000175100017510000003106715111154236021647 0ustar00runnerrunner# 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 const int64_t pg_time64_infinity = 0x7fffffffffffffff cdef const int64_t pg_time64_negative_infinity = 0x8000000000000000 cdef const int32_t pg_date_infinity = 0x7fffffff cdef const 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/float.pyx0000644000175100017510000000200715111154236021150 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/geometry.pyx0000644000175100017510000001107115111154236021677 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/hstore.pyx0000644000175100017510000000374215111154236021356 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/int.pyx0000644000175100017510000001065715111154236020647 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/json.pyx0000644000175100017510000000265615111154236021026 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/jsonpath.pyx0000644000175100017510000000150115111154236021667 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/misc.pyx0000644000175100017510000000074415111154236021004 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/network.pyx0000644000175100017510000000751515111154236021545 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/numeric.pyx0000644000175100017510000002420515111154236021511 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/pg_snapshot.pyx0000644000175100017510000000342615111154236022376 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/text.pyx0000644000175100017510000000275415111154236021040 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/tid.pyx0000644000175100017510000000301515111154236020623 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/codecs/uuid.pyx0000644000175100017510000000152715111154236021017 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/consts.pxi0000644000175100017510000000043215111154236020074 0ustar00runnerrunner# 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 _NUMERIC_DECODER_SMALLBUF_SIZE = 256 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/cpythonx.pxd0000644000175100017510000000134015111154236020431 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/debug.h0000644000175100017510000000005315111154236017277 0ustar00runnerrunner#ifndef PG_DEBUG #define PG_DEBUG 0 #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/debug.pxd0000644000175100017510000000040715111154236017646 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/frb.pxd0000644000175100017510000000227415111154236017335 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/frb.pyx0000644000175100017510000000063115111154236017355 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/hton.h0000644000175100017510000001140015111154236017157 0ustar00runnerrunner#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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/hton.pxd0000644000175100017510000000167115111154236017534 0ustar00runnerrunner# 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=1764022436.0 asyncpg-0.31.0/asyncpg/pgproto/pgproto.c0000644000175100017510000771223115111154244017714 0ustar00runnerrunner/* Generated by Cython 3.2.1 */ /* 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 */ /* InitLimitedAPI */ #if defined(Py_LIMITED_API) #if !defined(CYTHON_LIMITED_API) #define CYTHON_LIMITED_API 1 #endif #elif defined(CYTHON_LIMITED_API) #ifdef _MSC_VER #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.") #else #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead. #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else #define __PYX_ABI_VERSION "3_2_1" #define CYTHON_HEX_VERSION 0x030201F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #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 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_CPYTHON_FREETHREADING 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 #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_AVOID_THREAD_UNSAFE_BORROWED_REFS #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_ASSUME_SAFE_SIZE #define CYTHON_ASSUME_SAFE_SIZE 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 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_SYS_MONITORING #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_AM_SEND #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #undef CYTHON_IMMORTAL_CONSTANTS #define CYTHON_IMMORTAL_CONSTANTS 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_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #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_AVOID_THREAD_UNSAFE_BORROWED_REFS #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #ifndef CYTHON_ASSUME_SAFE_SIZE #define CYTHON_ASSUME_SAFE_SIZE 1 #endif #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 #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_SYS_MONITORING #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) #endif #undef CYTHON_USE_AM_SEND #define CYTHON_USE_AM_SEND 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 (PYPY_VERSION_NUM >= 0x07031100) #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #undef CYTHON_IMMORTAL_CONSTANTS #define CYTHON_IMMORTAL_CONSTANTS 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_CPYTHON_FREETHREADING 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_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 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_ASSUME_SAFE_SIZE #define CYTHON_ASSUME_SAFE_SIZE 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 (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #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 #undef CYTHON_USE_SYS_MONITORING #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #ifndef CYTHON_USE_AM_SEND #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) #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 #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #undef CYTHON_IMMORTAL_CONSTANTS #define CYTHON_IMMORTAL_CONSTANTS 0 #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 #ifdef Py_GIL_DISABLED #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 #else #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #endif #if PY_VERSION_HEX < 0x030A0000 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #elif !defined(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 #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || 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 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_ASSUME_SAFE_SIZE #define CYTHON_ASSUME_SAFE_SIZE 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #elif !defined(CYTHON_FAST_GIL) #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #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_SYS_MONITORING #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #ifndef CYTHON_USE_AM_SEND #define CYTHON_USE_AM_SEND 1 #endif #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #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 && !CYTHON_USE_MODULE_STATE) #endif #ifndef 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 (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000 #undef CYTHON_IMMORTAL_CONSTANTS #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work #elif !defined(CYTHON_IMMORTAL_CONSTANTS) #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif #ifndef CYTHON_COMPRESS_STRINGS #define CYTHON_COMPRESS_STRINGS 1 #endif #ifndef CYTHON_FAST_PYCCALL #define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif #ifndef CYTHON_VECTORCALL #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #else #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL) #endif #endif #if CYTHON_USE_PYLONG_INTERNALS #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 && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING # 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) #include typedef uintptr_t __pyx_uintptr_t; #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 #ifndef Py_UNREACHABLE #define Py_UNREACHABLE() assert(0); abort() #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 < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) /* CInitCode */ #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 /* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API #ifndef CO_OPTIMIZED static int CO_OPTIMIZED; #endif #ifndef CO_NEWLOCALS static int CO_NEWLOCALS; #endif #ifndef CO_VARARGS static int CO_VARARGS; #endif #ifndef CO_VARKEYWORDS static int CO_VARKEYWORDS; #endif #ifndef CO_ASYNC_GENERATOR static int CO_ASYNC_GENERATOR; #endif #ifndef CO_GENERATOR static int CO_GENERATOR; #endif #ifndef CO_COROUTINE static int CO_COROUTINE; #endif #else #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #endif static int __Pyx_init_co_variables(void); #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 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 Py_TPFLAGS_IMMUTABLETYPE #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8) #endif #ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7) #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #ifndef 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)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_VERSION_HEX >= 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)(void)) { #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 PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000) #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_PyFrame_SetLineNumber(frame, lineno) #elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno)) #elif CYTHON_COMPILING_IN_GRAAL #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _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() #else #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif #if CYTHON_USE_MODULE_STATE 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; } #define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else #define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) #define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) #define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) #define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #if CYTHON_COMPILING_IN_CPYTHON && 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 !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) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #endif #define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS #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 __Pyx_PyUnicode_READY(op) (0) #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)) #else #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_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 #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) #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_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #elif 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 enum __Pyx_ReferenceSharing { __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check __Pyx_ReferenceSharing_OwnStrongReference, __Pyx_ReferenceSharing_FunctionArgument, __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar }; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000 #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\ (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\ (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\ (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0))) #elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1) #else #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) #endif #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) #else #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) #endif #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) #endif #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) #endif #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #else #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { *result = PyObject_GetItem(dict, key); if (*result == NULL) { if (PyErr_ExceptionMatches(PyExc_KeyError)) { PyErr_Clear(); return 0; } return -1; } return 1; } #else static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { *result = PyDict_GetItemWithError(dict, key); if (*result == NULL) { return PyErr_Occurred() ? -1 : 0; } Py_INCREF(*result); return 1; } #endif #if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) #else #define __Pyx_VISIT_CONST(obj) #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_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) #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_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) #endif #if CYTHON_ASSUME_SAFE_SIZE #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) #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else #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) #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t #define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t #if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 #define __Pyx_PySendResult PySendResult #else typedef enum { PYGEN_RETURN = 0, PYGEN_ERROR = -1, PYGEN_NEXT = 1, } __Pyx_PySendResult; #endif #if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); #else #define __Pyx_pyiter_sendfunc sendfunc #endif #if !CYTHON_USE_AM_SEND #define __PYX_HAS_PY_AM_SEND 0 #elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 #define __PYX_HAS_PY_AM_SEND 1 #else #define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation #endif #if __PYX_HAS_PY_AM_SEND < 2 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) #endif #if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) #else #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif #if PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() #else #define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp #endif #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 #ifdef __cplusplus extern "C" #endif PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); #endif #if CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { int value; PyObject *py_value = PyObject_GetAttrString(inspect, name); if (!py_value) return 0; value = (int) PyLong_AsLong(py_value); Py_DECREF(py_value); *write_to = value; return value != -1 || !PyErr_Occurred(); } static int __Pyx_init_co_variables(void) { PyObject *inspect; int result; inspect = PyImport_ImportModule("inspect"); result = #if !defined(CO_OPTIMIZED) __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && #endif #if !defined(CO_NEWLOCALS) __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && #endif #if !defined(CO_VARARGS) __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && #endif #if !defined(CO_VARKEYWORDS) __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && #endif #if !defined(CO_ASYNC_GENERATOR) __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && #endif #if !defined(CO_GENERATOR) __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && #endif #if !defined(CO_COROUTINE) __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && #endif 1; Py_DECREF(inspect); return result ? 0 : -1; } #else static int __Pyx_init_co_variables(void) { return 0; // It's a limited API-only feature } #endif /* MathInitCode */ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #endif #include #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME #define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 #endif #ifndef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME #endif #if CYTHON_CLINE_IN_TRACEBACK #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; } #else #define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } #endif #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 #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) #else #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) #endif #include #if PY_MAJOR_VERSION <= 2 #define PyDict_GetItemWithError _PyDict_GetItemWithError #endif #if PY_VERSION_HEX < 0x030d0000 static CYTHON_INLINE int __Pyx_PyWeakref_GetRef(PyObject *ref, PyObject **pobj) { PyObject *obj = PyWeakref_GetObject(ref); if (obj == NULL) { // SystemError if ref is NULL *pobj = NULL; return -1; } if (obj == Py_None) { *pobj = NULL; return 0; } Py_INCREF(obj); *pobj = obj; return 1; } #else #define __Pyx_PyWeakref_GetRef PyWeakref_GetRef #endif #include "pythread.h" #if (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 #include #include "./hton.h" #include "./tohex.h" #include "debug.h" #if CYTHON_COMPILING_IN_LIMITED_API #ifdef _MSC_VER #pragma message ("This module uses CPython specific internals of 'datetime.datetime', which are not available in the limited API.") #else #warning This module uses CPython specific internals of 'datetime.datetime', which are not available in the limited API. #endif #endif #include "datetime.h" #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) #define __Pyx_TimeZone_UTC PyDateTime_TimeZone_UTC #define __Pyx_TimeZone_FromOffsetAndName(offset, name) PyTimeZone_FromOffsetAndName(offset, name) /* 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 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #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 CYTHON_ASSUME_SAFE_MACROS #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_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) #else #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) #endif #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_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) return Py_NewRef(obj); #else Py_INCREF(obj); return obj; #endif } static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) return Py_XNewRef(obj); #else Py_XINCREF(obj); return obj; #endif } static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); 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_Long(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_PyLong_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)) #define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else #define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif #define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #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 __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #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__ */ /* PretendToInitialize */ #ifdef __cplusplus #if __cplusplus > 201103L #include #endif template static void __Pyx_pretend_to_initialize(T* ptr) { #if __cplusplus > 201103L if ((std::is_trivially_default_constructible::value)) #endif *ptr = T(); (void)ptr; } #else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #endif #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char* const __pyx_f[] = { "asyncpg/pgproto/pgproto.pyx", "asyncpg/pgproto/buffer.pyx", "asyncpg/pgproto/uuid.pyx", ".eggs/cython-3.2.1-py3.14-linux-x86_64.egg/Cython/Includes/cpython/contextvars.pxd", "asyncpg/pgproto/frb.pxd", "asyncpg/pgproto/buffer.pxd", ".eggs/cython-3.2.1-py3.14-linux-x86_64.egg/Cython/Includes/cpython/datetime.pxd", "asyncpg/pgproto/frb.pyx", "", "asyncpg/pgproto/codecs/context.pyx", "asyncpg/pgproto/codecs/bytea.pyx", "asyncpg/pgproto/codecs/text.pyx", "asyncpg/pgproto/codecs/datetime.pyx", "asyncpg/pgproto/codecs/float.pyx", "asyncpg/pgproto/codecs/int.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.2.1-py3.14-linux-x86_64.egg/Cython/Includes/cpython/type.pxd", ".eggs/cython-3.2.1-py3.14-linux-x86_64.egg/Cython/Includes/cpython/bool.pxd", ".eggs/cython-3.2.1-py3.14-linux-x86_64.egg/Cython/Includes/cpython/complex.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* Atomics.proto (used by UnpackUnboundCMethod) */ #include #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 #endif #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS #define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __pyx_atomic_int_type int #define __pyx_nonatomic_int_type int #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ (__STDC_VERSION__ >= 201112L) &&\ !defined(__STDC_NO_ATOMICS__)) #include #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ (__cplusplus >= 201103L) ||\ (defined(_MSC_VER) && _MSC_VER >= 1700))) #include #endif #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ (__STDC_VERSION__ >= 201112L) &&\ !defined(__STDC_NO_ATOMICS__) &&\ ATOMIC_INT_LOCK_FREE == 2) #undef __pyx_atomic_int_type #define __pyx_atomic_int_type atomic_int #define __pyx_atomic_ptr_type atomic_uintptr_t #define __pyx_nonatomic_ptr_type uintptr_t #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) #define __pyx_atomic_load(value) atomic_load(value) #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C atomics") #elif defined(__PYX_DEBUG_ATOMICS) #warning "Using standard C atomics" #endif #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ (__cplusplus >= 201103L) ||\ \ (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ ATOMIC_INT_LOCK_FREE == 2) #undef __pyx_atomic_int_type #define __pyx_atomic_int_type std::atomic_int #define __pyx_atomic_ptr_type std::atomic_uintptr_t #define __pyx_nonatomic_ptr_type uintptr_t #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) #define __pyx_atomic_load(value) std::atomic_load(value) #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C++ atomics") #elif defined(__PYX_DEBUG_ATOMICS) #warning "Using standard C++ atomics" #endif #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ (__GNUC_MINOR__ > 1 ||\ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) #define __pyx_atomic_ptr_type void* #define __pyx_nonatomic_ptr_type void* #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); int result = old == *expected; *expected = old; return result; } #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired); int result = old == *expected; *expected = old; return result; } #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif #elif CYTHON_ATOMICS && defined(_MSC_VER) #include #undef __pyx_atomic_int_type #define __pyx_atomic_int_type long #define __pyx_atomic_ptr_type void* #undef __pyx_nonatomic_int_type #define __pyx_nonatomic_int_type long #define __pyx_nonatomic_ptr_type void* #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); int result = old == *expected; *expected = old; return result; } #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected); int result = old == *expected; *expected = old; return result; } #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif #else #undef CYTHON_ATOMICS #define CYTHON_ATOMICS 0 #ifdef __PYX_DEBUG_ATOMICS #warning "Not using atomics" #endif #endif /* CriticalSectionsDefinition.proto (used by CriticalSections) */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyCriticalSection void* #define __Pyx_PyCriticalSection2 void* #define __Pyx_PyCriticalSection_End(cs) #define __Pyx_PyCriticalSection2_End(cs) #else #define __Pyx_PyCriticalSection PyCriticalSection #define __Pyx_PyCriticalSection2 PyCriticalSection2 #define __Pyx_PyCriticalSection_End PyCriticalSection_End #define __Pyx_PyCriticalSection2_End PyCriticalSection2_End #endif /* CriticalSections.proto (used by ParseKeywordsImpl) */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs) #define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs) #else #define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin #define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin #endif #if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_BEGIN_CRITICAL_SECTION(o) { #define __Pyx_END_CRITICAL_SECTION() } #else #define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION #define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif /* IncludeStructmemberH.proto */ #include /* #### 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":116 * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * 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":134 * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * 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":265 * # 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":270 * # 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":279 * * # Create timedelta object using DateTime CAPI factory function. * cdef inline object timezone_new(object offset, object name=None): # <<<<<<<<<<<<<< * return __Pyx_TimeZone_FromOffsetAndName(offset, name if name is not None else NULL) * */ struct __pyx_opt_args_7cpython_8datetime_timezone_new { int __pyx_n; PyObject *name; }; /* "cpython/datetime.pxd":283 * * # 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":69 * * * 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":70 * * 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":71 * 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":72 * 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":137 * cdef bytes consume_message(self) * cdef discard_message(self) * cdef int32_t 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":15 * * * 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[1024]; char *_buf; Py_ssize_t _size; Py_ssize_t _length; int _view_count; int _message_mode; }; /* "asyncpg/pgproto/buffer.pxd":75 * * * 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":136 * * * @cython.final # <<<<<<<<<<<<<< * @cython.no_gc_clear * cdef class UUID(__UUIDReplaceMe): */ 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":17 * include "./buffer.pxi" * * @cython.no_gc_clear # <<<<<<<<<<<<<< * @cython.final * @cython.freelist(_BUFFER_FREELIST_SIZE) */ 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 *(*__pyx_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":240 * * * @cython.no_gc_clear # <<<<<<<<<<<<<< * @cython.final * @cython.freelist(_BUFFER_FREELIST_SIZE) */ 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 *); int32_t (*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 int32_t __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; #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);\ } #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 (used by PyObjectGetAttrStrNoError) */ #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 (used by PyErrFetchRestore) */ #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 (used by PyObjectGetAttrStrNoError) */ #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 (used by PyObjectGetAttrStrNoError) */ #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 (used by GetBuiltinName) */ 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); /* PyAssertionError_Check.proto */ #define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError) /* BuildPyUnicode.proto (used by COrdinalToPyUnicode) */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength, int prepend_sign, char padding_char); /* COrdinalToPyUnicode.proto (used by CIntToPyUnicode) */ static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value); static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char); /* GCCDiagnostics.proto (used by CIntToPyUnicode) */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* IncludeStdlibH.proto (used by CIntToPyUnicode) */ #include /* IncludeStringH.proto (used by CIntToPyUnicode) */ #include /* CIntToPyUnicode.proto */ #define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\ ((format_char) == ('c')) ?\ __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\ __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\ ) static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char); static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char); /* JoinPyUnicode.export */ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* PyObjectCall.proto (used by PyObjectFastCall) */ #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 /* PyObjectCallMethO.proto (used by PyObjectFastCall) */ #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 * const*args, size_t nargs, PyObject *kwargs); /* RaiseException.export */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* TupleAndListFromArray.proto (used by fastcall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); #endif #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* BytesEquals.proto (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) #else #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) #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_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_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_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #else #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_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 #endif #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) #else #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); /* py_dict_items.proto (used by OwnedDictNext) */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); /* CallCFunction.proto (used by CallUnboundCMethod0) */ #define __Pyx_CallCFunction(cfunc, self, args)\ ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) #define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) #define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) #define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) /* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */ typedef struct { PyObject *type; PyObject **method_name; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS __pyx_atomic_int_type initialized; #endif PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { #if !CYTHON_ATOMICS return 1; #else __pyx_nonatomic_int_type expected = 0; if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { return 0; } return expected; #endif } static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { #if CYTHON_ATOMICS __pyx_atomic_store(&cfunc->initialized, 2); #endif } #else #define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 #define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) #endif /* CallUnboundCMethod0.proto */ CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #else #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif /* py_dict_values.proto (used by OwnedDictNext) */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); /* OwnedDictNext.proto (used by RejectKeywords) */ #if CYTHON_AVOID_BORROWED_REFS static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue); #else CYTHON_INLINE static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue); #endif /* RejectKeywords.export */ static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds); /* PyDictVersioning.proto (used by GetModuleGlobalName) */ #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_XNewRef(__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_mstate_global->__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); /* PyObjectFastCallMethod.proto */ #if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL) #else static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf); #endif /* PyTypeError_Check.proto */ #define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError) /* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywordsImpl.export */ static int __Pyx_ParseKeywordsTuple( PyObject *kwds, PyObject * const *kwvalues, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs ); static int __Pyx_ParseKeywordDictToDict( PyObject *kwds, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name ); static int __Pyx_ParseKeywordDict( PyObject *kwds, PyObject ** const argnames[], PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs ); /* CallUnboundCMethod2.proto */ CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON 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 /* ParseKeywords.proto */ static CYTHON_INLINE int __Pyx_ParseKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs ); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\ (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, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (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, int unsafe_shared); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (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, int unsafe_shared); 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, int unsafe_shared); /* decode_c_string_utf16.proto (used by decode_c_bytes) */ 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 (used by decode_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)); /* 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 && CYTHON_ASSUME_SAFE_SIZE 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_LIMITED_API || 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 /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* RaiseUnboundLocalError.proto */ static void __Pyx_RaiseUnboundLocalError(const char *varname); /* PyValueError_Check.proto */ #define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError) /* 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 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); /* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static CYTHON_INLINE PyObject* __Pyx_PyLong_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyLong_AndObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAnd(op1, op2) : PyNumber_And(op1, op2)) #endif /* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static CYTHON_INLINE PyObject* __Pyx_PyLong_RshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyLong_RshiftObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceRshift(op1, op2) : PyNumber_Rshift(op1, op2)) #endif /* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static CYTHON_INLINE PyObject* __Pyx_PyLong_LshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyLong_LshiftObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceLshift(op1, op2) : PyNumber_Lshift(op1, op2)) #endif /* PyObject_Unicode.proto */ #define __Pyx_PyObject_Unicode(obj)\ (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* PyNotImplementedError_Check.proto */ #define __Pyx_PyExc_NotImplementedError_Check(obj) __Pyx_TypeCheck(obj, PyExc_NotImplementedError) /* 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 (used by SaveResetException) */ #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, int b_is_constant); /* ModInt[int64_t].proto */ static CYTHON_INLINE int64_t __Pyx_mod_int64_t(int64_t, int64_t, int b_is_constant); /* PyObjectVectorCallKwBuilder.proto */ CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); #if CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03090000 #define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall #else #define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall #endif #define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); #else #define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict #define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) #define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) #define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) #endif /* PyObjectVectorCallMethodKwBuilder.proto */ #if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 #define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod #else static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames); #endif /* DivInt[long].proto */ static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant); /* ModInt[long].proto */ static CYTHON_INLINE long __Pyx_mod_long(long, long, int b_is_constant); /* HasAttr.proto */ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) #else static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); #endif /* PyOverflowError_Check.proto */ #define __Pyx_PyExc_OverflowError_Check(obj) __Pyx_TypeCheck(obj, PyExc_OverflowError) /* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyLong_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)) ? __Pyx_NewRef(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); /* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static CYTHON_INLINE PyObject* __Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyLong_AddCObj(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* ArgTypeTestFunc.export */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* 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)) /* CheckTypeForFreelists.proto */ #if CYTHON_USE_FREELISTS #if CYTHON_USE_TYPE_SPECS #define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp))) #define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS Py_TPFLAGS_IS_ABSTRACT #else #define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size))) #define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE) #endif #define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\ (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\ (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS))) #endif /* AllocateExtensionType.proto */ static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final); /* CallTypeTraverse.proto */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 #else static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif /* CallNextTpTraverse.proto */ static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); /* FunctionExport.proto */ static int __Pyx_ExportFunction(PyObject *api_dict, const char *name, void (*f)(void), const char *sig); /* GetApiDict.proto */ static PyObject *__Pyx_ApiExport_GetApiDict(void); /* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); #endif /* SetItemOnTypeDict.proto (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v); #define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v) /* FixUpExtensionType.proto */ static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); /* PyObjectCallNoArg.proto (used by PyObjectCallMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto (used by PyObjectCallMethod0) */ #if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); #endif /* PyObjectCallMethod0.proto (used by PyType_Ready) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto (used by PyType_Ready) */ #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 (used by MergeVTables) */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ static int __Pyx_MergeVtables(PyTypeObject *type); /* DelItemOnTypeDict.proto (used by SetupReduce) */ static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k); #define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k) /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_2_1 #define __PYX_HAVE_RT_ImportType_proto_3_2_1 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_2_1(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_2_1(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_2_1 { __Pyx_ImportType_CheckSize_Error_3_2_1 = 0, __Pyx_ImportType_CheckSize_Warn_3_2_1 = 1, __Pyx_ImportType_CheckSize_Ignore_3_2_1 = 2 }; static PyTypeObject *__Pyx_ImportType_3_2_1(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_1 check_size); #endif /* ImportImpl.export */ static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level); /* Import.proto */ static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* PyObjectCall2Args.proto (used by Py3ClassCreate) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */ #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); /* dict_setdefault.proto (used by FetchCommonType) */ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value); /* AddModuleRef.proto (used by FetchSharedCythonModule) */ #if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\ __PYX_LIMITED_VERSION_HEX < 0x030d0000) static PyObject *__Pyx_PyImport_AddModuleRef(const char *name); #else #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #endif /* FetchSharedCythonModule.proto (used by FetchCommonType) */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto (used by CommonTypesMetaclass) */ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); /* CommonTypesMetaclass.proto (used by CythonFunctionShared) */ static int __pyx_CommonTypesMetaclass_init(PyObject *module); #define __Pyx_CommonTypesMetaclass_USED /* PyMethodNew.proto (used by CythonFunctionShared) */ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); /* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */ #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto (used by CythonFunction) */ #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_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL __pyx_vectorcallfunc func_vectorcall; #endif #if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_dict; #endif 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 PyObject *defaults; 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_mstate_global->__pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)); #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 PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type); 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_COMPILING_IN_LIMITED_API #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 (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #else #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif /* CodeObjectCache.proto (used by AddTraceback) */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject __Pyx_CachedCodeObjectType; #else typedef PyCodeObject __Pyx_CachedCodeObjectType; #endif typedef struct { __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING __pyx_atomic_int_type accessor_count; #endif }; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CheckUnpickleChecksum.proto */ static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE int64_t __Pyx_PyLong_As_int64_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int32_t __Pyx_PyLong_As_int32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int32_t(int32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned char __Pyx_PyLong_As_unsigned_char(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int64_t(int64_t value); /* CIntFromPy.proto */ static CYTHON_INLINE int16_t __Pyx_PyLong_As_int16_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint16_t(uint16_t value); /* CIntFromPy.proto */ static CYTHON_INLINE int8_t __Pyx_PyLong_As_int8_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyLong_As_uint32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint32_t(uint32_t value); /* CIntFromPy.proto */ static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint64_t(uint64_t value); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* UpdateUnpickledDict.proto */ static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName #else static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); #endif #else // !LIMITED_API typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetFullyQualifiedName(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) static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { return 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) #ifdef PyExceptionInstance_Check #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) #else #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) #endif /* GetRuntimeVersion.proto */ #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 static unsigned long __Pyx_cached_runtime_version = 0; static void __Pyx_init_runtime_version(void); #else #define __Pyx_init_runtime_version() #endif static unsigned long __Pyx_get_runtime_version(void); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* DecompressString.proto */ static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo); /* MultiPhaseInitModuleState.proto */ #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE static PyObject *__Pyx_State_FindModule(void*); static int __Pyx_State_AddModule(PyObject* module, void*); static int __Pyx_State_RemoveModule(void*); #elif CYTHON_USE_MODULE_STATE #define __Pyx_State_FindModule PyState_FindModule #define __Pyx_State_AddModule PyState_AddModule #define __Pyx_State_RemoveModule PyState_RemoveModule #endif /* #### Code section: module_declarations ### */ /* CythonABIVersion.proto */ #if CYTHON_COMPILING_IN_LIMITED_API #if CYTHON_METH_FASTCALL #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" #else #define __PYX_FASTCALL_ABI_SUFFIX #endif #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX #else #define __PYX_LIMITED_ABI_SUFFIX #endif #if __PYX_HAS_PY_AM_SEND == 1 #define __PYX_AM_SEND_ABI_SUFFIX #elif __PYX_HAS_PY_AM_SEND == 2 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" #else #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" #endif #ifndef __PYX_MONITORING_ABI_SUFFIX #define __PYX_MONITORING_ABI_SUFFIX #endif #if CYTHON_USE_TP_FINALIZE #define __PYX_TP_FINALIZE_ABI_SUFFIX #else #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" #endif #if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) #define __PYX_FREELISTS_ABI_SUFFIX #else #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" #endif #define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ #endif #if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ #endif 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 int32_t __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 "__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 "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.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[256]; 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 const __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_infinity = 9223372036854775807; static int64_t const __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_negative_infinity = ((int64_t)9223372036854775808); static int32_t const __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_infinity = 2147483647; static int32_t const __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_negative_infinity = ((int32_t)2147483648); 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_print; static PyObject *__pyx_builtin_NotImplemented; /* #### Code section: string_decls ### */ /* #### 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 ### */ /* SmallCodeConfig */ #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 typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; PyTypeObject *__pyx_ptype_7cpython_4type_type; PyTypeObject *__pyx_ptype_7cpython_4bool_bool; PyTypeObject *__pyx_ptype_7cpython_7complex_complex; 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; 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; 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; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; PyObject *__pyx_slice[4]; PyObject *__pyx_tuple[3]; PyObject *__pyx_codeobj_tab[14]; PyObject *__pyx_string_tab[278]; PyObject *__pyx_number_tab[34]; /* #### Code section: module_state_contents ### */ #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_freelist_7asyncpg_7pgproto_7pgproto_WriteBuffer[256]; int __pyx_freecount_7asyncpg_7pgproto_7pgproto_WriteBuffer; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_freelist_7asyncpg_7pgproto_7pgproto_ReadBuffer[256]; int __pyx_freecount_7asyncpg_7pgproto_7pgproto_ReadBuffer; #endif /* CommonTypesMetaclass.module_state_decls */ PyTypeObject *__pyx_CommonTypesMetaclassType; /* CachedMethodType.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API PyObject *__Pyx_CachedMethodType; #endif /* CythonFunctionShared.module_state_decls */ PyTypeObject *__pyx_CyFunctionType; /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; /* #### Code section: module_state_end ### */ } __pyx_mstatetype; #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_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) #define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) #else static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: constant_name_defines ### */ #define __pyx_kp_u_ __pyx_string_tab[0] #define __pyx_kp_u_0e __pyx_string_tab[1] #define __pyx_kp_u_16_bytes_were_expected_got __pyx_string_tab[2] #define __pyx_kp_u_Deallocating_buffer_with_attache __pyx_string_tab[3] #define __pyx_kp_u_Infinity_2 __pyx_string_tab[4] #define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[5] #define __pyx_kp_u_UUID __pyx_string_tab[6] #define __pyx_kp_u__3 __pyx_string_tab[7] #define __pyx_kp_u__4 __pyx_string_tab[8] #define __pyx_kp_u__5 __pyx_string_tab[9] #define __pyx_kp_u_a_boolean_is_required_got_type __pyx_string_tab[10] #define __pyx_kp_u_a_bytes_or_str_object_expected_g __pyx_string_tab[11] #define __pyx_kp_u_add_note __pyx_string_tab[12] #define __pyx_kp_u_asyncpg_pgproto __pyx_string_tab[13] #define __pyx_kp_u_asyncpg_pgproto_codecs_context_p __pyx_string_tab[14] #define __pyx_kp_u_asyncpg_pgproto_uuid_pyx __pyx_string_tab[15] #define __pyx_kp_u_bit_value_too_long __pyx_string_tab[16] #define __pyx_kp_u_buffer_overread __pyx_string_tab[17] #define __pyx_kp_u_cannot_decode_UUID_expected_16_b __pyx_string_tab[18] #define __pyx_kp_u_cannot_encode_Decimal_value_into __pyx_string_tab[19] #define __pyx_kp_u_cannot_encode_Decimal_value_into_2 __pyx_string_tab[20] #define __pyx_kp_u_cannot_encode_Decimal_value_into_3 __pyx_string_tab[21] #define __pyx_kp_u_cannot_put_message_no_message_ta __pyx_string_tab[22] #define __pyx_kp_u_cannot_start_message_for_a_non_e __pyx_string_tab[23] #define __pyx_kp_u_consume_full_messages_called_on __pyx_string_tab[24] #define __pyx_kp_u_consume_full_messages_called_on_2 __pyx_string_tab[25] #define __pyx_kp_u_consume_full_messages_called_wit __pyx_string_tab[26] #define __pyx_kp_u_date_tuple_encoder_expecting_1_e __pyx_string_tab[27] #define __pyx_kp_u_debug_first_buffer_of_ReadBuffer __pyx_string_tab[28] #define __pyx_kp_u_debug_second_buffer_of_ReadBuffe __pyx_string_tab[29] #define __pyx_kp_u_decodes_to_less_than_16_bytes __pyx_string_tab[30] #define __pyx_kp_u_decodes_to_more_than_16_bytes __pyx_string_tab[31] #define __pyx_kp_u_disable __pyx_string_tab[32] #define __pyx_kp_u_discarding_message_r_unread_dat __pyx_string_tab[33] #define __pyx_kp_u_empty_buffer __pyx_string_tab[34] #define __pyx_kp_u_empty_first_buffer __pyx_string_tab[35] #define __pyx_kp_u_enable __pyx_string_tab[36] #define __pyx_kp_u_end_message_buffer_is_too_small __pyx_string_tab[37] #define __pyx_kp_u_end_message_can_only_be_called_w __pyx_string_tab[38] #define __pyx_kp_u_end_message_message_is_too_large __pyx_string_tab[39] #define __pyx_kp_u_expected_a_datetime_date_or_date __pyx_string_tab[40] #define __pyx_kp_u_expected_str_got __pyx_string_tab[41] #define __pyx_kp_u_failed_to_read_one_byte_on_a_non __pyx_string_tab[42] #define __pyx_kp_u_feed_data_a_bytes_or_bytearray_o __pyx_string_tab[43] #define __pyx_kp_u_gc __pyx_string_tab[44] #define __pyx_kp_u_hstore_value_is_too_large __pyx_string_tab[45] #define __pyx_kp_u_insufficient_data_in_buffer_requ __pyx_string_tab[46] #define __pyx_kp_u_interval_tuple_encoder_expecting __pyx_string_tab[47] #define __pyx_kp_u_invalid_UUID __pyx_string_tab[48] #define __pyx_kp_u_invalid_UUID_u_r_unexpected_char __pyx_string_tab[49] #define __pyx_kp_u_invalid_address_family_in_value __pyx_string_tab[50] #define __pyx_kp_u_invalid_address_length_in_value __pyx_string_tab[51] #define __pyx_kp_u_invalid_network_prefix_length_in __pyx_string_tab[52] #define __pyx_kp_u_invalid_number_of_elements_in_ti __pyx_string_tab[53] #define __pyx_kp_u_invalid_number_of_elements_in_tx __pyx_string_tab[54] #define __pyx_kp_u_isenabled __pyx_string_tab[55] #define __pyx_kp_u_length_must_be_between_32_36_ch __pyx_string_tab[56] #define __pyx_kp_u_list_or_tuple_expected_got_type __pyx_string_tab[57] #define __pyx_kp_u_negative_length_for_a_len_prefix __pyx_string_tab[58] #define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[59] #define __pyx_kp_u_no_message_to_consume __pyx_string_tab[60] #define __pyx_kp_u_no_message_to_discard __pyx_string_tab[61] #define __pyx_kp_u_not_enough_data_to_read_bytes __pyx_string_tab[62] #define __pyx_kp_u_not_enough_data_to_read_one_byte __pyx_string_tab[63] #define __pyx_kp_u_null_value_not_allowed_in_hstore __pyx_string_tab[64] #define __pyx_kp_u_path_value_too_long __pyx_string_tab[65] #define __pyx_kp_u_polygon_value_too_long __pyx_string_tab[66] #define __pyx_kp_u_read_null_str_buffer_overread __pyx_string_tab[67] #define __pyx_kp_u_read_null_str_only_works_when_th __pyx_string_tab[68] #define __pyx_kp_u_remaining __pyx_string_tab[69] #define __pyx_kp_u_string_is_too_large __pyx_string_tab[70] #define __pyx_kp_u_string_too_long __pyx_string_tab[71] #define __pyx_kp_u_stringsource __pyx_string_tab[72] #define __pyx_kp_u_the_buffer_is_in_read_only_mode __pyx_string_tab[73] #define __pyx_kp_u_time_tuple_encoder_expecting_1_e __pyx_string_tab[74] #define __pyx_kp_u_time_tuple_encoder_expecting_2_e __pyx_string_tab[75] #define __pyx_kp_u_timestamp_tuple_encoder_expectin __pyx_string_tab[76] #define __pyx_kp_u_tuple_id_block_value_out_of_uint __pyx_string_tab[77] #define __pyx_kp_u_tuple_id_offset_value_out_of_uin __pyx_string_tab[78] #define __pyx_kp_u_txid_snapshot_value_is_too_long __pyx_string_tab[79] #define __pyx_kp_u_unexpected_CIDR_flag_set_in_non __pyx_string_tab[80] #define __pyx_kp_u_unexpected_JSONB_format __pyx_string_tab[81] #define __pyx_kp_u_unexpected_character __pyx_string_tab[82] #define __pyx_kp_u_unexpected_jsonpath_format __pyx_string_tab[83] #define __pyx_kp_u_urn_uuid __pyx_string_tab[84] #define __pyx_kp_u_value_out_of_float32_range __pyx_string_tab[85] #define __pyx_kp_u_value_out_of_int16_range __pyx_string_tab[86] #define __pyx_kp_u_value_out_of_int32_range __pyx_string_tab[87] #define __pyx_kp_u_value_out_of_int64_range __pyx_string_tab[88] #define __pyx_kp_u_value_out_of_uint32_range __pyx_string_tab[89] #define __pyx_kp_u_value_out_of_uint64_range __pyx_string_tab[90] #define __pyx_n_u_ __pyx_string_tab[91] #define __pyx_n_u_BitString __pyx_string_tab[92] #define __pyx_n_u_Box __pyx_string_tab[93] #define __pyx_n_u_BufferError __pyx_string_tab[94] #define __pyx_n_u_Circle __pyx_string_tab[95] #define __pyx_n_u_CodecContext __pyx_string_tab[96] #define __pyx_n_u_CodecContext___reduce_cython __pyx_string_tab[97] #define __pyx_n_u_CodecContext___setstate_cython __pyx_string_tab[98] #define __pyx_n_u_CodecContext_get_json_decoder __pyx_string_tab[99] #define __pyx_n_u_CodecContext_get_json_encoder __pyx_string_tab[100] #define __pyx_n_u_CodecContext_get_text_codec __pyx_string_tab[101] #define __pyx_n_u_Dec __pyx_string_tab[102] #define __pyx_n_u_Decimal __pyx_string_tab[103] #define __pyx_n_u_F __pyx_string_tab[104] #define __pyx_n_u_False __pyx_string_tab[105] #define __pyx_n_u_Infinity __pyx_string_tab[106] #define __pyx_n_u_Line __pyx_string_tab[107] #define __pyx_n_u_LineSegment __pyx_string_tab[108] #define __pyx_n_u_MAXYEAR __pyx_string_tab[109] #define __pyx_n_u_MINYEAR __pyx_string_tab[110] #define __pyx_n_u_N __pyx_string_tab[111] #define __pyx_n_u_NaN __pyx_string_tab[112] #define __pyx_n_u_NotImplemented __pyx_string_tab[113] #define __pyx_n_u_Path __pyx_string_tab[114] #define __pyx_n_u_Point __pyx_string_tab[115] #define __pyx_n_u_Polygon __pyx_string_tab[116] #define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[117] #define __pyx_n_u_RESERVED_FUTURE __pyx_string_tab[118] #define __pyx_n_u_RESERVED_MICROSOFT __pyx_string_tab[119] #define __pyx_n_u_RESERVED_NCS __pyx_string_tab[120] #define __pyx_n_u_RFC_4122 __pyx_string_tab[121] #define __pyx_n_u_ReadBuffer __pyx_string_tab[122] #define __pyx_n_u_ReadBuffer___reduce_cython __pyx_string_tab[123] #define __pyx_n_u_ReadBuffer___setstate_cython __pyx_string_tab[124] #define __pyx_n_u_SafeUUID __pyx_string_tab[125] #define __pyx_n_u_UUIDReplaceMe __pyx_string_tab[126] #define __pyx_n_u_UUIDReplaceMe___reduce_cython __pyx_string_tab[127] #define __pyx_n_u_UUIDReplaceMe___setstate_cytho __pyx_string_tab[128] #define __pyx_n_u_UUID_2 __pyx_string_tab[129] #define __pyx_n_u_UUID___reduce __pyx_string_tab[130] #define __pyx_n_u_WriteBuffer __pyx_string_tab[131] #define __pyx_n_u_WriteBuffer___reduce_cython __pyx_string_tab[132] #define __pyx_n_u_WriteBuffer___setstate_cython __pyx_string_tab[133] #define __pyx_n_u_add __pyx_string_tab[134] #define __pyx_n_u_append __pyx_string_tab[135] #define __pyx_n_u_as_tuple __pyx_string_tab[136] #define __pyx_n_u_astimezone __pyx_string_tab[137] #define __pyx_n_u_asyncio_coroutines __pyx_string_tab[138] #define __pyx_n_u_asyncpg_pgproto_pgproto __pyx_string_tab[139] #define __pyx_n_u_bases __pyx_string_tab[140] #define __pyx_n_u_big __pyx_string_tab[141] #define __pyx_n_u_bytes __pyx_string_tab[142] #define __pyx_n_u_cidr __pyx_string_tab[143] #define __pyx_n_u_class_getitem __pyx_string_tab[144] #define __pyx_n_u_cline_in_traceback __pyx_string_tab[145] #define __pyx_n_u_clock_seq_hi_variant __pyx_string_tab[146] #define __pyx_n_u_clock_seq_low __pyx_string_tab[147] #define __pyx_n_u_collections __pyx_string_tab[148] #define __pyx_n_u_date __pyx_string_tab[149] #define __pyx_n_u_date_from_ordinal __pyx_string_tab[150] #define __pyx_n_u_datetime __pyx_string_tab[151] #define __pyx_n_u_day __pyx_string_tab[152] #define __pyx_n_u_days __pyx_string_tab[153] #define __pyx_n_u_decimal __pyx_string_tab[154] #define __pyx_n_u_decode __pyx_string_tab[155] #define __pyx_n_u_deque __pyx_string_tab[156] #define __pyx_n_u_dict __pyx_string_tab[157] #define __pyx_n_u_dict_2 __pyx_string_tab[158] #define __pyx_n_u_digits __pyx_string_tab[159] #define __pyx_n_u_doc __pyx_string_tab[160] #define __pyx_n_u_encode __pyx_string_tab[161] #define __pyx_n_u_exponent __pyx_string_tab[162] #define __pyx_n_u_find __pyx_string_tab[163] #define __pyx_n_u_format __pyx_string_tab[164] #define __pyx_n_u_from_bytes __pyx_string_tab[165] #define __pyx_n_u_frombytes __pyx_string_tab[166] #define __pyx_n_u_fromordinal __pyx_string_tab[167] #define __pyx_n_u_func __pyx_string_tab[168] #define __pyx_n_u_functools __pyx_string_tab[169] #define __pyx_n_u_get_json_decoder __pyx_string_tab[170] #define __pyx_n_u_get_json_encoder __pyx_string_tab[171] #define __pyx_n_u_get_text_codec __pyx_string_tab[172] #define __pyx_n_u_getstate __pyx_string_tab[173] #define __pyx_n_u_hour __pyx_string_tab[174] #define __pyx_n_u_inet __pyx_string_tab[175] #define __pyx_n_u_infinity_date __pyx_string_tab[176] #define __pyx_n_u_infinity_datetime __pyx_string_tab[177] #define __pyx_n_u_inp __pyx_string_tab[178] #define __pyx_n_u_int __pyx_string_tab[179] #define __pyx_n_u_int_2 __pyx_string_tab[180] #define __pyx_n_u_ip_address __pyx_string_tab[181] #define __pyx_n_u_ip_interface __pyx_string_tab[182] #define __pyx_n_u_ip_network __pyx_string_tab[183] #define __pyx_n_u_ipaddr __pyx_string_tab[184] #define __pyx_n_u_ipaddress __pyx_string_tab[185] #define __pyx_n_u_ipiface __pyx_string_tab[186] #define __pyx_n_u_ipnet __pyx_string_tab[187] #define __pyx_n_u_is_closed __pyx_string_tab[188] #define __pyx_n_u_is_coroutine __pyx_string_tab[189] #define __pyx_n_u_items __pyx_string_tab[190] #define __pyx_n_u_len __pyx_string_tab[191] #define __pyx_n_u_main __pyx_string_tab[192] #define __pyx_n_u_metaclass __pyx_string_tab[193] #define __pyx_n_u_microsecond __pyx_string_tab[194] #define __pyx_n_u_microseconds __pyx_string_tab[195] #define __pyx_n_u_minute __pyx_string_tab[196] #define __pyx_n_u_minutes __pyx_string_tab[197] #define __pyx_n_u_module __pyx_string_tab[198] #define __pyx_n_u_month __pyx_string_tab[199] #define __pyx_n_u_mro __pyx_string_tab[200] #define __pyx_n_u_mro_entries __pyx_string_tab[201] #define __pyx_n_u_n __pyx_string_tab[202] #define __pyx_n_u_name __pyx_string_tab[203] #define __pyx_n_u_negative_infinity_date __pyx_string_tab[204] #define __pyx_n_u_negative_infinity_datetime __pyx_string_tab[205] #define __pyx_n_u_network __pyx_string_tab[206] #define __pyx_n_u_network_address __pyx_string_tab[207] #define __pyx_n_u_new __pyx_string_tab[208] #define __pyx_n_u_node __pyx_string_tab[209] #define __pyx_n_u_now __pyx_string_tab[210] #define __pyx_n_u_packed __pyx_string_tab[211] #define __pyx_n_u_pg_UUID __pyx_string_tab[212] #define __pyx_n_u_pg_epoch_date __pyx_string_tab[213] #define __pyx_n_u_pg_epoch_datetime __pyx_string_tab[214] #define __pyx_n_u_pg_epoch_datetime_utc __pyx_string_tab[215] #define __pyx_n_u_pgproto_types __pyx_string_tab[216] #define __pyx_n_u_pop __pyx_string_tab[217] #define __pyx_n_u_popleft __pyx_string_tab[218] #define __pyx_n_u_prefixlen __pyx_string_tab[219] #define __pyx_n_u_prepare __pyx_string_tab[220] #define __pyx_n_u_print __pyx_string_tab[221] #define __pyx_n_u_pyx_capi __pyx_string_tab[222] #define __pyx_n_u_pyx_checksum __pyx_string_tab[223] #define __pyx_n_u_pyx_result __pyx_string_tab[224] #define __pyx_n_u_pyx_state __pyx_string_tab[225] #define __pyx_n_u_pyx_type __pyx_string_tab[226] #define __pyx_n_u_pyx_unpickle_CodecContext __pyx_string_tab[227] #define __pyx_n_u_pyx_unpickle___UUIDReplaceMe __pyx_string_tab[228] #define __pyx_n_u_pyx_vtable __pyx_string_tab[229] #define __pyx_n_u_qualname __pyx_string_tab[230] #define __pyx_n_u_reduce __pyx_string_tab[231] #define __pyx_n_u_reduce_cython __pyx_string_tab[232] #define __pyx_n_u_reduce_ex __pyx_string_tab[233] #define __pyx_n_u_replace __pyx_string_tab[234] #define __pyx_n_u_second __pyx_string_tab[235] #define __pyx_n_u_seconds __pyx_string_tab[236] #define __pyx_n_u_self __pyx_string_tab[237] #define __pyx_n_u_set_name __pyx_string_tab[238] #define __pyx_n_u_setdefault __pyx_string_tab[239] #define __pyx_n_u_setstate __pyx_string_tab[240] #define __pyx_n_u_setstate_cython __pyx_string_tab[241] #define __pyx_n_u_sign __pyx_string_tab[242] #define __pyx_n_u_state __pyx_string_tab[243] #define __pyx_n_u_std_UUID __pyx_string_tab[244] #define __pyx_n_u_test __pyx_string_tab[245] #define __pyx_n_u_time __pyx_string_tab[246] #define __pyx_n_u_time_hi_version __pyx_string_tab[247] #define __pyx_n_u_time_low __pyx_string_tab[248] #define __pyx_n_u_time_mid __pyx_string_tab[249] #define __pyx_n_u_timedelta __pyx_string_tab[250] #define __pyx_n_u_timestamp __pyx_string_tab[251] #define __pyx_n_u_timezone __pyx_string_tab[252] #define __pyx_n_u_toordinal __pyx_string_tab[253] #define __pyx_n_u_types __pyx_string_tab[254] #define __pyx_n_u_tzinfo __pyx_string_tab[255] #define __pyx_n_u_unknown __pyx_string_tab[256] #define __pyx_n_u_update __pyx_string_tab[257] #define __pyx_n_u_use_setstate __pyx_string_tab[258] #define __pyx_n_u_utc __pyx_string_tab[259] #define __pyx_n_u_utcoffset __pyx_string_tab[260] #define __pyx_n_u_uuid __pyx_string_tab[261] #define __pyx_n_u_values __pyx_string_tab[262] #define __pyx_n_u_variant __pyx_string_tab[263] #define __pyx_n_u_version __pyx_string_tab[264] #define __pyx_n_u_year __pyx_string_tab[265] #define __pyx_kp_b_ __pyx_string_tab[266] #define __pyx_kp_b_PyObject_struct___pyx_obj_7async __pyx_string_tab[267] #define __pyx_kp_b__2 __pyx_string_tab[268] #define __pyx_kp_b_iso88591_6 __pyx_string_tab[269] #define __pyx_kp_b_iso88591_A_AXT __pyx_string_tab[270] #define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_0_AWKwa_0_AWK __pyx_string_tab[271] #define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_T_G1_T_A __pyx_string_tab[272] #define __pyx_kp_b_iso88591_A_a __pyx_string_tab[273] #define __pyx_kp_b_iso88591_Q __pyx_string_tab[274] #define __pyx_kp_b_iso88591_QfA __pyx_string_tab[275] #define __pyx_kp_b_iso88591_q_0_kQR_1_7_1_2DNRS_1 __pyx_string_tab[276] #define __pyx_kp_b_iso88591_q_0_kQR_xq_7_a_nA_1 __pyx_string_tab[277] #define __pyx_int_0 __pyx_number_tab[0] #define __pyx_int_neg_1 __pyx_number_tab[1] #define __pyx_int_1 __pyx_number_tab[2] #define __pyx_int_3 __pyx_number_tab[3] #define __pyx_int_5 __pyx_number_tab[4] #define __pyx_int_7 __pyx_number_tab[5] #define __pyx_int_8 __pyx_number_tab[6] #define __pyx_int_10 __pyx_number_tab[7] #define __pyx_int_12 __pyx_number_tab[8] #define __pyx_int_15 __pyx_number_tab[9] #define __pyx_int_20 __pyx_number_tab[10] #define __pyx_int_23 __pyx_number_tab[11] #define __pyx_int_31 __pyx_number_tab[12] #define __pyx_int_32 __pyx_number_tab[13] #define __pyx_int_48 __pyx_number_tab[14] #define __pyx_int_56 __pyx_number_tab[15] #define __pyx_int_59 __pyx_number_tab[16] #define __pyx_int_63 __pyx_number_tab[17] #define __pyx_int_64 __pyx_number_tab[18] #define __pyx_int_76 __pyx_number_tab[19] #define __pyx_int_80 __pyx_number_tab[20] #define __pyx_int_96 __pyx_number_tab[21] #define __pyx_int_100 __pyx_number_tab[22] #define __pyx_int_255 __pyx_number_tab[23] #define __pyx_int_1000 __pyx_number_tab[24] #define __pyx_int_2000 __pyx_number_tab[25] #define __pyx_int_4095 __pyx_number_tab[26] #define __pyx_int_65535 __pyx_number_tab[27] #define __pyx_int_999999 __pyx_number_tab[28] #define __pyx_int_238750788 __pyx_number_tab[29] #define __pyx_int_0xffffffffffff __pyx_number_tab[30] #define __pyx_int_0x2000000000000000 __pyx_number_tab[31] #define __pyx_int_0x4000000000000000 __pyx_number_tab[32] #define __pyx_int_0x8000000000000000 __pyx_number_tab[33] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(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); #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #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); for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } for (int i=0; i<14; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } for (int i=0; i<278; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } for (int i=0; i<34; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_clear_contents ### */ /* CommonTypesMetaclass.module_state_clear */ Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType); /* CythonFunctionShared.module_state_clear */ Py_CLEAR(clear_module_state->__pyx_CyFunctionType); /* #### Code section: module_state_clear_end ### */ return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(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); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); 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); for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } for (int i=0; i<14; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } for (int i=0; i<278; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } for (int i=0; i<34; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_traverse_contents ### */ /* CommonTypesMetaclass.module_state_traverse */ Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType); /* CythonFunctionShared.module_state_traverse */ Py_VISIT(traverse_module_state->__pyx_CyFunctionType); /* #### Code section: module_state_traverse_end ### */ return 0; } #endif /* #### Code section: module_code ### */ /* "cpython/complex.pxd":20 * * # unavailable in limited API * @property # <<<<<<<<<<<<<< * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double real(self) noexcept: */ #if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { double __pyx_r; /* "cpython/complex.pxd":23 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double real(self) noexcept: * return self.cval.real # <<<<<<<<<<<<<< * * # unavailable in limited API */ __pyx_r = __pyx_v_self->cval.real; goto __pyx_L0; /* "cpython/complex.pxd":20 * * # unavailable in limited API * @property # <<<<<<<<<<<<<< * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double real(self) noexcept: */ /* function exit code */ __pyx_L0:; return __pyx_r; } #endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "cpython/complex.pxd":26 * * # unavailable in limited API * @property # <<<<<<<<<<<<<< * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double imag(self) noexcept: */ #if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { double __pyx_r; /* "cpython/complex.pxd":29 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * 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":26 * * # unavailable in limited API * @property # <<<<<<<<<<<<<< * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double imag(self) noexcept: */ /* function exit code */ __pyx_L0:; return __pyx_r; } #endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "cpython/contextvars.pxd":115 * * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< * cdef inline object get_value(var, default_value=None): * """Return a new reference to the value of the context variable, */ #if !CYTHON_COMPILING_IN_LIMITED_API 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) { /* "cpython/contextvars.pxd":116 * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * 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, */ 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", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } /* "cpython/contextvars.pxd":121 * 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":122 * """ * 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(3, 122, __pyx_L1_error) /* "cpython/contextvars.pxd":123 * 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":125 * 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":123 * 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":128 * 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":129 * # 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":130 * 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":115 * * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< * cdef inline object get_value(var, default_value=None): * """Return a new reference to the 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; } #endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "cpython/contextvars.pxd":133 * * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< * cdef inline object get_value_no_default(var, default_value=None): * """Return a new reference to the value of the context variable, */ #if !CYTHON_COMPILING_IN_LIMITED_API 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) { /* "cpython/contextvars.pxd":134 * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * 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. */ 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", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } /* "cpython/contextvars.pxd":140 * 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":141 * """ * 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(3, 141, __pyx_L1_error) /* "cpython/contextvars.pxd":143 * 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":144 * # 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":145 * 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":133 * * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< * cdef inline object get_value_no_default(var, default_value=None): * """Return a new reference to the value of the context variable, */ /* 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; } #endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "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", 0); /* "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(4, 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 == ((void *)NULL))) __PYX_ERR(4, 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":35 * 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", 0); /* "asyncpg/pgproto/buffer.pxd":36 * * cdef inline len(self): * return self._length # <<<<<<<<<<<<<< * * cdef inline write_len_prefixed_utf8(self, str s): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":35 * 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":38 * 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", 0); /* "asyncpg/pgproto/buffer.pxd":39 * * 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(5, 39, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 39, __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(5, 39, __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":38 * 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":107 * 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", 0); /* "asyncpg/pgproto/buffer.pxd":108 * * cdef inline len(self): * return self._length # <<<<<<<<<<<<<< * * cdef inline char get_message_type(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":107 * 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":110 * 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":111 * * 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":110 * 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":113 * 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":114 * * 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":113 * 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":44 * * 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":46 * @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":44 * * 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":48 * return PyDateTime_GET_YEAR(self) * * @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":50 * @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":48 * return PyDateTime_GET_YEAR(self) * * @property # <<<<<<<<<<<<<< * cdef inline int month(self) noexcept: * return PyDateTime_GET_MONTH(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":52 * return PyDateTime_GET_MONTH(self) * * @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":54 * @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":52 * return PyDateTime_GET_MONTH(self) * * @property # <<<<<<<<<<<<<< * cdef inline int day(self) noexcept: * return PyDateTime_GET_DAY(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":57 * * 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":59 * @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":57 * * 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":61 * return PyDateTime_TIME_GET_HOUR(self) * * @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":63 * @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":61 * return PyDateTime_TIME_GET_HOUR(self) * * @property # <<<<<<<<<<<<<< * cdef inline int minute(self) noexcept: * return PyDateTime_TIME_GET_MINUTE(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":65 * return PyDateTime_TIME_GET_MINUTE(self) * * @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":67 * @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":65 * return PyDateTime_TIME_GET_MINUTE(self) * * @property # <<<<<<<<<<<<<< * cdef inline int second(self) noexcept: * return PyDateTime_TIME_GET_SECOND(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":69 * return PyDateTime_TIME_GET_SECOND(self) * * @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":71 * @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":69 * return PyDateTime_TIME_GET_SECOND(self) * * @property # <<<<<<<<<<<<<< * cdef inline int microsecond(self) noexcept: * return PyDateTime_TIME_GET_MICROSECOND(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":73 * return PyDateTime_TIME_GET_MICROSECOND(self) * * @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", 0); /* "cpython/datetime.pxd":75 * @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":73 * return PyDateTime_TIME_GET_MICROSECOND(self) * * @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":77 * return PyDateTime_TIME_GET_TZINFO(self) * * @property # <<<<<<<<<<<<<< * cdef inline int fold(self) noexcept: * # For Python < 3.6 this returns 0 no matter what */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":80 * 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":77 * return PyDateTime_TIME_GET_TZINFO(self) * * @property # <<<<<<<<<<<<<< * cdef inline int fold(self) noexcept: * # For Python < 3.6 this returns 0 no matter what */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":83 * * 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":85 * @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":83 * * 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":87 * return PyDateTime_GET_YEAR(self) * * @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":89 * @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":87 * return PyDateTime_GET_YEAR(self) * * @property # <<<<<<<<<<<<<< * cdef inline int month(self) noexcept: * return PyDateTime_GET_MONTH(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":91 * return PyDateTime_GET_MONTH(self) * * @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":93 * @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":91 * return PyDateTime_GET_MONTH(self) * * @property # <<<<<<<<<<<<<< * cdef inline int day(self) noexcept: * return PyDateTime_GET_DAY(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":95 * return PyDateTime_GET_DAY(self) * * @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":97 * @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":95 * return PyDateTime_GET_DAY(self) * * @property # <<<<<<<<<<<<<< * cdef inline int hour(self) noexcept: * return PyDateTime_DATE_GET_HOUR(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":99 * return PyDateTime_DATE_GET_HOUR(self) * * @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":101 * @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":99 * return PyDateTime_DATE_GET_HOUR(self) * * @property # <<<<<<<<<<<<<< * cdef inline int minute(self) noexcept: * return PyDateTime_DATE_GET_MINUTE(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":103 * return PyDateTime_DATE_GET_MINUTE(self) * * @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":105 * @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":103 * return PyDateTime_DATE_GET_MINUTE(self) * * @property # <<<<<<<<<<<<<< * cdef inline int second(self) noexcept: * return PyDateTime_DATE_GET_SECOND(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":107 * return PyDateTime_DATE_GET_SECOND(self) * * @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":109 * @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":107 * return PyDateTime_DATE_GET_SECOND(self) * * @property # <<<<<<<<<<<<<< * cdef inline int microsecond(self) noexcept: * return PyDateTime_DATE_GET_MICROSECOND(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":111 * return PyDateTime_DATE_GET_MICROSECOND(self) * * @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", 0); /* "cpython/datetime.pxd":113 * @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":111 * return PyDateTime_DATE_GET_MICROSECOND(self) * * @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":115 * return PyDateTime_DATE_GET_TZINFO(self) * * @property # <<<<<<<<<<<<<< * cdef inline int fold(self) noexcept: * # For Python < 3.6 this returns 0 no matter what */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":118 * 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":115 * return PyDateTime_DATE_GET_TZINFO(self) * * @property # <<<<<<<<<<<<<< * cdef inline int fold(self) noexcept: * # For Python < 3.6 this returns 0 no matter what */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":121 * * 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":123 * @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":121 * * 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":125 * return PyDateTime_DELTA_GET_DAYS(self) * * @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":127 * @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":125 * return PyDateTime_DELTA_GET_DAYS(self) * * @property # <<<<<<<<<<<<<< * cdef inline int second(self) noexcept: * return PyDateTime_DELTA_GET_SECONDS(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":129 * return PyDateTime_DELTA_GET_SECONDS(self) * * @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":131 * @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":129 * return PyDateTime_DELTA_GET_SECONDS(self) * * @property # <<<<<<<<<<<<<< * cdef inline int microsecond(self) noexcept: * return PyDateTime_DELTA_GET_MICROSECONDS(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":255 * # 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":256 * # 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":255 * # 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":260 * # 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", 0); /* "cpython/datetime.pxd":261 * # 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(6, 261, __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":260 * # 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":265 * # 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", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_fold = __pyx_optional_args->fold; } } /* "cpython/datetime.pxd":266 * # 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(6, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(6, 266, __pyx_L1_error) __pyx_r = ((PyDateTime_Time *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "cpython/datetime.pxd":265 * # 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":270 * # 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", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_fold = __pyx_optional_args->fold; } } /* "cpython/datetime.pxd":271 * # 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(6, 271, __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":270 * # 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":275 * # 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", 0); /* "cpython/datetime.pxd":276 * # 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(6, 276, __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":275 * # 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":279 * * # Create timedelta object using DateTime CAPI factory function. * cdef inline object timezone_new(object offset, object name=None): # <<<<<<<<<<<<<< * return __Pyx_TimeZone_FromOffsetAndName(offset, name if name is not None else NULL) * */ 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 PyObject *__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("timezone_new", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_name = __pyx_optional_args->name; } } /* "cpython/datetime.pxd":280 * # Create timedelta object using DateTime CAPI factory function. * cdef inline object timezone_new(object offset, object name=None): * 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_2 = (__pyx_v_name != Py_None); if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_name); } else { __pyx_t_1 = NULL; } __pyx_t_3 = __Pyx_TimeZone_FromOffsetAndName(__pyx_v_offset, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cpython/datetime.pxd":279 * * # Create timedelta object using DateTime CAPI factory function. * cdef inline object timezone_new(object offset, object name=None): # <<<<<<<<<<<<<< * return __Pyx_TimeZone_FromOffsetAndName(offset, name if name is not None else NULL) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __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":283 * * # 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", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_tz = __pyx_optional_args->tz; } } /* "cpython/datetime.pxd":284 * # 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":285 * 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(6, 285, __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) != (0)) __PYX_ERR(6, 285, __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) != (0)) __PYX_ERR(6, 285, __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(6, 285, __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) != (0)) __PYX_ERR(6, 285, __pyx_L1_error); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } /* "cpython/datetime.pxd":284 * # 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(6, 284, __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":283 * * # 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":288 * * # 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", 0); /* "cpython/datetime.pxd":289 * # 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(6, 289, __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) != (0)) __PYX_ERR(6, 289, __pyx_L1_error); __pyx_t_2 = ((PyObject *)PyDateTimeAPI->Date_FromTimestamp(((PyObject *)PyDateTimeAPI->DateType), __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 289, __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":288 * * # 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":297 * * # Get UTC singleton * cdef inline object get_utc(): # <<<<<<<<<<<<<< * return __Pyx_TimeZone_UTC * */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_get_utc(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_utc", 0); /* "cpython/datetime.pxd":298 * # Get UTC singleton * cdef inline object get_utc(): * 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":297 * * # Get UTC singleton * cdef inline object get_utc(): # <<<<<<<<<<<<<< * return __Pyx_TimeZone_UTC * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":301 * * # 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", 0); /* "cpython/datetime.pxd":302 * # 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":301 * * # 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":305 * * # 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", 0); /* "cpython/datetime.pxd":306 * # 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":305 * * # 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":309 * * # 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":310 * # 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":309 * * # 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":313 * * # 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":314 * # 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":313 * * # 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":317 * * # 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":318 * # 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":317 * * # 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":321 * * # 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":322 * # 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":321 * * # 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":325 * * # 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":326 * # 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":325 * * # 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":329 * * # 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":330 * # 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":329 * * # 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":333 * * # 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":334 * # 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":333 * * # 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":337 * * # 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":338 * # 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":337 * * # 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":341 * * # 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":342 * # 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":341 * * # 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":345 * * # 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":346 * # 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":345 * * # 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":349 * * # 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":351 * 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":349 * * # 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":354 * * # 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":355 * # 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":354 * * # 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":358 * * # 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":359 * # 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":358 * * # 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":362 * * # 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":363 * # 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":362 * * # 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":366 * * # 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":367 * # 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":366 * * # 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":370 * * # 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":372 * 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":370 * * # 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":375 * * # Get days of timedelta * cdef inline int timedelta_days(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_DAYS(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_days(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":376 * # Get days of timedelta * cdef inline int timedelta_days(object o) noexcept: * return PyDateTime_DELTA_GET_DAYS(o) # <<<<<<<<<<<<<< * * # Get seconds of timedelta */ __pyx_r = PyDateTime_DELTA_GET_DAYS(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":375 * * # Get days of timedelta * cdef inline int timedelta_days(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_DAYS(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":379 * * # Get seconds of timedelta * cdef inline int timedelta_seconds(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_SECONDS(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_seconds(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":380 * # Get seconds of timedelta * cdef inline int timedelta_seconds(object o) noexcept: * return PyDateTime_DELTA_GET_SECONDS(o) # <<<<<<<<<<<<<< * * # Get microseconds of timedelta */ __pyx_r = PyDateTime_DELTA_GET_SECONDS(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":379 * * # Get seconds of timedelta * cdef inline int timedelta_seconds(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_SECONDS(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":383 * * # Get microseconds of timedelta * cdef inline int timedelta_microseconds(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_MICROSECONDS(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_microseconds(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":384 * # Get microseconds of timedelta * cdef inline int timedelta_microseconds(object o) noexcept: * return PyDateTime_DELTA_GET_MICROSECONDS(o) # <<<<<<<<<<<<<< * * cdef inline double total_seconds(timedelta obj) noexcept: */ __pyx_r = PyDateTime_DELTA_GET_MICROSECONDS(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":383 * * # Get microseconds of timedelta * cdef inline int timedelta_microseconds(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_MICROSECONDS(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":386 * return PyDateTime_DELTA_GET_MICROSECONDS(o) * * 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":392 * 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":393 * 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":394 * 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":395 * 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":386 * return PyDateTime_DELTA_GET_MICROSECONDS(o) * * 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; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6[4]; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("frb_check", 0); /* "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":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_3 = NULL; /* "asyncpg/pgproto/frb.pyx":11 * if n > frb.len: * raise AssertionError( * f'insufficient data in buffer: requested {n} ' # <<<<<<<<<<<<<< * f'remaining {frb.len}') */ __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_n, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "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(7, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_insufficient_data_in_buffer_requ; __pyx_t_6[1] = __pyx_t_4; __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_remaining; __pyx_t_6[3] = __pyx_t_5; /* "asyncpg/pgproto/frb.pyx":11 * if n > frb.len: * raise AssertionError( * f'insufficient data in buffer: requested {n} ' # <<<<<<<<<<<<<< * f'remaining {frb.len}') */ __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, 39 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_AssertionError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 10, __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(7, 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_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __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":22 * 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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return -1; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":23 * * 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":24 * 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":25 * 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":26 * 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":27 * 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":22 * 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":29 * 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; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "asyncpg/pgproto/buffer.pyx":30 * * 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":31 * 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":32 * 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":33 * cpython.PyMem_Free(self._buf) * self._buf = NULL * self._size = 0 # <<<<<<<<<<<<<< * * if self._view_count: */ __pyx_v_self->_size = 0; /* "asyncpg/pgproto/buffer.pyx":30 * * 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":35 * 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":36 * * if self._view_count: * raise BufferError( # <<<<<<<<<<<<<< * 'Deallocating buffer with attached memoryviews') * */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Deallocating_buffer_with_attache}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 36, __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(1, 36, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":35 * self._size = 0 * * if self._view_count: # <<<<<<<<<<<<<< * raise BufferError( * 'Deallocating buffer with attached memoryviews') */ } /* "asyncpg/pgproto/buffer.pyx":29 * 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":39 * '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":40 * * 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":42 * 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, 42, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":39 * '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":47 * 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":48 * * 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":47 * flags) * * def __releasebuffer__(self, Py_buffer *buffer): # <<<<<<<<<<<<<< * self._view_count -= 1 * */ /* function exit code */ } /* "asyncpg/pgproto/buffer.pyx":50 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_check_readonly", 0); /* "asyncpg/pgproto/buffer.pyx":51 * * 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":52 * 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_the_buffer_is_in_read_only_mode}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 52, __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(1, 52, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":51 * * cdef inline _check_readonly(self): * if self._view_count: # <<<<<<<<<<<<<< * raise BufferError('the buffer is in read-only mode') * */ } /* "asyncpg/pgproto/buffer.pyx":50 * 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":54 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":55 * * 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":57 * 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":58 * * 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, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":57 * cdef ssize_t new_size = extra_length + self._length * * if new_size > self._size: # <<<<<<<<<<<<<< * self._reallocate(new_size) * */ } /* "asyncpg/pgproto/buffer.pyx":54 * 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":60 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":63 * 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":64 * * 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":63 * cdef char *new_buf * * if new_size < _BUFFER_MAX_GROW: # <<<<<<<<<<<<<< * new_size = _BUFFER_MAX_GROW * else: */ goto __pyx_L3; } /* "asyncpg/pgproto/buffer.pyx":67 * 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":69 * 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":70 * * 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":72 * 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":73 * 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":74 * 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":75 * 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":76 * self._size = 0 * self._length = 0 * raise MemoryError # <<<<<<<<<<<<<< * memcpy(new_buf, self._buf, self._size) * self._size = new_size */ PyErr_NoMemory(); __PYX_ERR(1, 76, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":72 * new_buf = cpython.PyMem_Malloc( * sizeof(char) * new_size) * if new_buf is NULL: # <<<<<<<<<<<<<< * self._buf = NULL * self._size = 0 */ } /* "asyncpg/pgproto/buffer.pyx":77 * 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":78 * 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":79 * 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":80 * 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":69 * 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":82 * self._smallbuf_inuse = False * else: * new_buf = cpython.PyMem_Realloc( # <<<<<<<<<<<<<< * self._buf, new_size) * if new_buf is NULL: */ /*else*/ { /* "asyncpg/pgproto/buffer.pyx":83 * 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":84 * 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":85 * 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":86 * 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":87 * 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":88 * self._buf = NULL * self._size = 0 * self._length = 0 # <<<<<<<<<<<<<< * raise MemoryError * self._buf = new_buf */ __pyx_v_self->_length = 0; /* "asyncpg/pgproto/buffer.pyx":89 * self._size = 0 * self._length = 0 * raise MemoryError # <<<<<<<<<<<<<< * self._buf = new_buf * self._size = new_size */ PyErr_NoMemory(); __PYX_ERR(1, 89, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":84 * 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":90 * 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":91 * 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":60 * 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":93 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("start_message", 0); /* "asyncpg/pgproto/buffer.pyx":94 * * 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":95 * 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_cannot_start_message_for_a_non_e}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 95, __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(1, 95, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":94 * * 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":97 * 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, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":98 * '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":99 * 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":100 * 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":93 * 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":102 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("end_message", 0); /* "asyncpg/pgproto/buffer.pyx":104 * 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":106 * 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, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":107 * * 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":108 * self._check_readonly() * if not self._message_mode: * raise BufferError( # <<<<<<<<<<<<<< * 'end_message can only be called with start_message') * if self._length < 5: */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_end_message_can_only_be_called_w}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 108, __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(1, 108, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":107 * * self._check_readonly() * if not self._message_mode: # <<<<<<<<<<<<<< * raise BufferError( * 'end_message can only be called with start_message') */ } /* "asyncpg/pgproto/buffer.pyx":110 * 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":111 * '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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_end_message_buffer_is_too_small}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 111, __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(1, 111, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":110 * 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":112 * 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":113 * 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_end_message_message_is_too_large}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 113, __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(1, 113, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":112 * 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":115 * 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":116 * * 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":102 * 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":118 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":119 * * cdef inline reset(self): * self._length = 0 # <<<<<<<<<<<<<< * self._message_mode = 0 * */ __pyx_v_self->_length = 0; /* "asyncpg/pgproto/buffer.pyx":120 * 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":118 * 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":122 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":123 * * 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, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":125 * self._check_readonly() * * if not buf._length: # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = (!(__pyx_v_buf->_length != 0)); if (__pyx_t_2) { /* "asyncpg/pgproto/buffer.pyx":126 * * 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":125 * self._check_readonly() * * if not buf._length: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/pgproto/buffer.pyx":128 * 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, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":129 * * 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":132 * 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":122 * 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":134 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":135 * * 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, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":137 * 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, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":138 * * 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":139 * 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":134 * 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":141 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":145 * 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, 145, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":146 * * 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, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":141 * 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":148 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":152 * 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, 152, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":155 * # 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, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":148 * 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":157 * 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_str", 0); /* "asyncpg/pgproto/buffer.pyx":158 * * 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_v_string; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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, 158, __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":157 * 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_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":160 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":162 * 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, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 162, __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, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":163 * # 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, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":160 * 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":165 * 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; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_len_prefixed_bytes", 0); /* "asyncpg/pgproto/buffer.pyx":171 * 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, 171, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":172 * * 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":173 * 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_string_is_too_large}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 173, __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(1, 173, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":172 * * 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":175 * 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, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":176 * # `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, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":165 * 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":178 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":180 * 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":181 * 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":182 * 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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 182, __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, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/buffer.pyx":181 * cdef: * ssize_t buf_len = buf.len * if buf_len > 0: # <<<<<<<<<<<<<< * self.write_cstr(frb_read_all(buf), buf_len) * */ } /* "asyncpg/pgproto/buffer.pyx":178 * 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":184 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":185 * * 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, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":186 * 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, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":188 * 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":189 * * 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":184 * 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":191 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":192 * * 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, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":193 * 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, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":195 * 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":196 * * 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":191 * 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":198 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":199 * * 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, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":200 * 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, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":202 * 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":203 * * 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":198 * 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":205 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":206 * * 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, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":207 * 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, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":209 * 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":210 * * 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":205 * 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":212 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":213 * * 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, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":214 * 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, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":216 * 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":217 * * 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":212 * 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":219 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":220 * * 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, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":221 * 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, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":223 * 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":224 * * 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":219 * 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":226 * self._length += 8 * * @staticmethod # <<<<<<<<<<<<<< * cdef WriteBuffer new_message(char type): * cdef WriteBuffer buf */ 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", 0); /* "asyncpg/pgproto/buffer.pyx":229 * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __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":230 * 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, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":231 * 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":226 * self._length += 8 * * @staticmethod # <<<<<<<<<<<<<< * cdef WriteBuffer new_message(char type): * cdef WriteBuffer buf */ /* 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":233 * return buf * * @staticmethod # <<<<<<<<<<<<<< * cdef WriteBuffer new(): * cdef WriteBuffer buf */ 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", 0); /* "asyncpg/pgproto/buffer.pyx":236 * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __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":237 * 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":233 * return buf * * @staticmethod # <<<<<<<<<<<<<< * cdef WriteBuffer new(): * cdef WriteBuffer buf */ /* 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(8, 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 3, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 3, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(8, 3, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(8, 3, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 3, __pyx_L3_error) } __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(8, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(8, 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":245 * 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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return -1; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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; PyObject *__pyx_t_4 = NULL; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); /* "asyncpg/pgproto/buffer.pyx":246 * * def __cinit__(self): * self._bufs = collections.deque() # <<<<<<<<<<<<<< * self._bufs_append = self._bufs.append * self._bufs_popleft = self._bufs.popleft */ __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; 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); __Pyx_DECREF(__pyx_v_self->_bufs); __pyx_v_self->_bufs = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":247 * 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_mstate_global->__pyx_n_u_append); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 247, __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":248 * 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_mstate_global->__pyx_n_u_popleft); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 248, __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":249 * 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":250 * 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":251 * 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":252 * 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":253 * self._buf0_prev = None * self._pos0 = 0 * self._len0 = 0 # <<<<<<<<<<<<<< * self._length = 0 * */ __pyx_v_self->_len0 = 0; /* "asyncpg/pgproto/buffer.pyx":254 * self._pos0 = 0 * self._len0 = 0 * self._length = 0 # <<<<<<<<<<<<<< * * self._current_message_type = 0 */ __pyx_v_self->_length = 0; /* "asyncpg/pgproto/buffer.pyx":256 * 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":257 * * 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":258 * 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":259 * 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":245 * 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_XDECREF(__pyx_t_4); __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":261 * 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; size_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; 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":266 * 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":267 * * 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":271 * # 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_3 = NULL; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 271, __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":267 * * 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":273 * data = bytes(data) * else: * raise BufferError( # <<<<<<<<<<<<<< * 'feed_data: a bytes or bytearray object expected') * */ /*else*/ { __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_feed_data_a_bytes_or_bytearray_o}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 273, __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(1, 273, __pyx_L1_error) } __pyx_L4:; /* "asyncpg/pgproto/buffer.pyx":266 * 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":286 * # 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":288 * 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":289 * * 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":291 * 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":289 * * dlen = cpython.Py_SIZE(data_bytes) * if dlen == 0: # <<<<<<<<<<<<<< * # EOF? * return */ } /* "asyncpg/pgproto/buffer.pyx":293 * return * * self._bufs_append(data_bytes) # <<<<<<<<<<<<<< * self._length += dlen * */ __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_self->_bufs_append); __pyx_t_3 = __pyx_v_self->_bufs_append; __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_data_bytes}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":294 * * 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":296 * 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":298 * 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":299 * # 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":296 * self._length += dlen * * if self._bufs_len == 0: # <<<<<<<<<<<<<< * # First buffer * self._len0 = dlen */ } /* "asyncpg/pgproto/buffer.pyx":301 * 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":261 * 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_5); __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":303 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ensure_first_buf", 0); /* "asyncpg/pgproto/buffer.pyx":304 * * 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":305 * 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":306 * if PG_DEBUG: * if self._len0 == 0: * raise BufferError('empty first buffer') # <<<<<<<<<<<<<< * if self._length == 0: * raise BufferError('empty buffer') */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_empty_first_buffer}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 306, __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(1, 306, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":305 * 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":307 * 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":308 * raise BufferError('empty first buffer') * if self._length == 0: * raise BufferError('empty buffer') # <<<<<<<<<<<<<< * * if self._pos0 == self._len0: */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_empty_buffer}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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(1, 308, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":307 * if self._len0 == 0: * raise BufferError('empty first buffer') * if self._length == 0: # <<<<<<<<<<<<<< * raise BufferError('empty buffer') * */ } /* "asyncpg/pgproto/buffer.pyx":304 * * cdef inline _ensure_first_buf(self): * if PG_DEBUG: # <<<<<<<<<<<<<< * if self._len0 == 0: * raise BufferError('empty first buffer') */ } /* "asyncpg/pgproto/buffer.pyx":310 * 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":311 * * 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, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":310 * raise BufferError('empty buffer') * * if self._pos0 == self._len0: # <<<<<<<<<<<<<< * self._switch_to_next_buf() * */ } /* "asyncpg/pgproto/buffer.pyx":303 * 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":313 * 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; size_t __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", 0); /* "asyncpg/pgproto/buffer.pyx":315 * cdef _switch_to_next_buf(self): * # The first buffer is fully read, discard it * self._bufs_popleft() # <<<<<<<<<<<<<< * self._bufs_len -= 1 * */ __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_self->_bufs_popleft); __pyx_t_3 = __pyx_v_self->_bufs_popleft; __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":316 * # 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":320 * # 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":321 * # 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_buf0); __Pyx_DECREF(__pyx_v_self->_buf0); __pyx_v_self->_buf0 = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":323 * self._buf0 = self._bufs[0] * * self._pos0 = 0 # <<<<<<<<<<<<<< * self._len0 = len(self._buf0) * */ __pyx_v_self->_pos0 = 0; /* "asyncpg/pgproto/buffer.pyx":324 * * self._pos0 = 0 * self._len0 = len(self._buf0) # <<<<<<<<<<<<<< * * if PG_DEBUG: */ __pyx_t_3 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_3); if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 324, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyBytes_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->_len0 = __pyx_t_5; /* "asyncpg/pgproto/buffer.pyx":326 * 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":327 * * 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":328 * if PG_DEBUG: * if self._len0 < 1: * raise BufferError( # <<<<<<<<<<<<<< * 'debug: second buffer of ReadBuffer is empty') * */ __pyx_t_1 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_1); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_debug_second_buffer_of_ReadBuffe}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 328, __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(1, 328, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":327 * * if PG_DEBUG: * if self._len0 < 1: # <<<<<<<<<<<<<< * raise BufferError( * 'debug: second buffer of ReadBuffer is empty') */ } /* "asyncpg/pgproto/buffer.pyx":326 * self._len0 = len(self._buf0) * * if PG_DEBUG: # <<<<<<<<<<<<<< * if self._len0 < 1: * raise BufferError( */ } /* "asyncpg/pgproto/buffer.pyx":313 * 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":331 * '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", 0); /* "asyncpg/pgproto/buffer.pyx":343 * 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":344 * * 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":345 * if PG_DEBUG: * if nbytes > self._length: * return NULL # <<<<<<<<<<<<<< * * if self._current_message_ready: */ __pyx_r = NULL; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":344 * * if PG_DEBUG: * if nbytes > self._length: # <<<<<<<<<<<<<< * return NULL * */ } /* "asyncpg/pgproto/buffer.pyx":343 * const char *result * * if PG_DEBUG: # <<<<<<<<<<<<<< * if nbytes > self._length: * return NULL */ } /* "asyncpg/pgproto/buffer.pyx":347 * 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":348 * * 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":349 * 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":348 * * if self._current_message_ready: * if self._current_message_len_unread < nbytes: # <<<<<<<<<<<<<< * return NULL * */ } /* "asyncpg/pgproto/buffer.pyx":347 * return NULL * * if self._current_message_ready: # <<<<<<<<<<<<<< * if self._current_message_len_unread < nbytes: * return NULL */ } /* "asyncpg/pgproto/buffer.pyx":351 * 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":352 * * 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":353 * 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":354 * 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":355 * 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":356 * 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":357 * 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":356 * self._pos0 += nbytes * self._length -= nbytes * if self._current_message_ready: # <<<<<<<<<<<<<< * self._current_message_len_unread -= nbytes * return result */ } /* "asyncpg/pgproto/buffer.pyx":358 * 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":351 * return NULL * * if self._pos0 + nbytes <= self._len0: # <<<<<<<<<<<<<< * result = cpython.PyBytes_AS_STRING(self._buf0) * result += self._pos0 */ } /* "asyncpg/pgproto/buffer.pyx":360 * 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":331 * '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":362 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":367 * char *buf0 * * while True: # <<<<<<<<<<<<<< * buf0 = cpython.PyBytes_AS_STRING(self._buf0) * */ while (1) { /* "asyncpg/pgproto/buffer.pyx":368 * * 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":370 * 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":371 * * 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":372 * 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":373 * 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":374 * 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":375 * 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":376 * self._length -= nread * nbytes -= nread * buf += nread # <<<<<<<<<<<<<< * self._ensure_first_buf() * */ __pyx_v_buf = (__pyx_v_buf + __pyx_v_nread); /* "asyncpg/pgproto/buffer.pyx":377 * 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, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":370 * 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":380 * * 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":381 * 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":382 * 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":383 * 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":362 * 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":385 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":389 * 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, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":390 * * self._ensure_first_buf() * while True: # <<<<<<<<<<<<<< * if self._pos0 + nbytes > self._len0: * nread = self._len0 - self._pos0 */ while (1) { /* "asyncpg/pgproto/buffer.pyx":391 * 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":392 * 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":393 * 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":394 * 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":395 * 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":396 * 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, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":391 * 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":399 * * else: * self._pos0 += nbytes # <<<<<<<<<<<<<< * self._length -= nbytes * break */ /*else*/ { __pyx_v_self->_pos0 = (__pyx_v_self->_pos0 + __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":400 * else: * self._pos0 += nbytes * self._length -= nbytes # <<<<<<<<<<<<<< * break * */ __pyx_v_self->_length = (__pyx_v_self->_length - __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":401 * 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":385 * 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":403 * 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; size_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_bytes", 0); /* "asyncpg/pgproto/buffer.pyx":410 * 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, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":411 * * 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, 411, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":412 * 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":413 * 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, 413, __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":412 * self._ensure_first_buf() * cbuf = self._try_read_bytes(nbytes) * if cbuf != NULL: # <<<<<<<<<<<<<< * return cpython.PyBytes_FromStringAndSize(cbuf, nbytes) * */ } /* "asyncpg/pgproto/buffer.pyx":415 * 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":416 * * if nbytes > self._length: * raise BufferError( # <<<<<<<<<<<<<< * 'not enough data to read {} bytes'.format(nbytes)) * */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "asyncpg/pgproto/buffer.pyx":417 * if nbytes > self._length: * raise BufferError( * 'not enough data to read {} bytes'.format(nbytes)) # <<<<<<<<<<<<<< * * if self._current_message_ready: */ __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_not_enough_data_to_read_bytes; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = PyLong_FromSsize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __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(1, 416, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":415 * return cpython.PyBytes_FromStringAndSize(cbuf, nbytes) * * if nbytes > self._length: # <<<<<<<<<<<<<< * raise BufferError( * 'not enough data to read {} bytes'.format(nbytes)) */ } /* "asyncpg/pgproto/buffer.pyx":419 * '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":420 * * 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":421 * 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":422 * self._current_message_len_unread -= nbytes * if self._current_message_len_unread < 0: * raise BufferError('buffer overread') # <<<<<<<<<<<<<< * * result = cpython.PyBytes_FromStringAndSize(NULL, nbytes) */ __pyx_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_buffer_overread}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 422, __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(1, 422, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":421 * 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":419 * '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":424 * 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, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":425 * * 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":426 * 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, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":427 * 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":403 * 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":429 * 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; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_len_prefixed_bytes", 0); /* "asyncpg/pgproto/buffer.pyx":430 * * 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, 430, __pyx_L1_error) __pyx_v_size = __pyx_t_1; /* "asyncpg/pgproto/buffer.pyx":431 * 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":432 * cdef int32_t size = self.read_int32() * if size < 0: * raise BufferError( # <<<<<<<<<<<<<< * 'negative length for a len-prefixed bytes value') * if size == 0: */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_negative_length_for_a_len_prefix}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 432, __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(1, 432, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":431 * 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":434 * 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":435 * '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_mstate_global->__pyx_kp_b_); __pyx_r = __pyx_mstate_global->__pyx_kp_b_; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":434 * raise BufferError( * 'negative length for a len-prefixed bytes value') * if size == 0: # <<<<<<<<<<<<<< * return b'' * return self.read_bytes(size) */ } /* "asyncpg/pgproto/buffer.pyx":436 * 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, 436, __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":429 * 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":438 * 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; size_t __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", 0); /* "asyncpg/pgproto/buffer.pyx":443 * 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, 443, __pyx_L1_error) __pyx_v_size = __pyx_t_1; /* "asyncpg/pgproto/buffer.pyx":444 * * 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":445 * size = self.read_int32() * if size < 0: * raise BufferError( # <<<<<<<<<<<<<< * 'negative length for a len-prefixed bytes value') * */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_negative_length_for_a_len_prefix}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 445, __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(1, 445, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":444 * * size = self.read_int32() * if size < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'negative length for a len-prefixed bytes value') */ } /* "asyncpg/pgproto/buffer.pyx":448 * '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":449 * * if size == 0: * return '' # <<<<<<<<<<<<<< * * self._ensure_first_buf() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_); __pyx_r = __pyx_mstate_global->__pyx_kp_u_; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":448 * 'negative length for a len-prefixed bytes value') * * if size == 0: # <<<<<<<<<<<<<< * return '' * */ } /* "asyncpg/pgproto/buffer.pyx":451 * 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, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":452 * * 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, 452, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_7; /* "asyncpg/pgproto/buffer.pyx":453 * 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":454 * 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, 454, __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":453 * 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":456 * 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, 456, __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, 456, __pyx_L1_error) } __pyx_t_5 = __Pyx_decode_bytes(__pyx_t_3, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/buffer.pyx":438 * 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":458 * 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; size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_uuid", 0); /* "asyncpg/pgproto/buffer.pyx":463 * 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, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":464 * * 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, 464, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":465 * 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":466 * 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, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":465 * self._ensure_first_buf() * cbuf = self._try_read_bytes(16) * if cbuf != NULL: # <<<<<<<<<<<<<< * return pg_uuid_from_buf(cbuf) * else: */ } /* "asyncpg/pgproto/buffer.pyx":468 * 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 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pg_UUID); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(__pyx_v_self, 16); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/buffer.pyx":458 * 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":470 * 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; size_t __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", 0); /* "asyncpg/pgproto/buffer.pyx":473 * 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":474 * * if PG_DEBUG: * if not self._buf0: # <<<<<<<<<<<<<< * raise BufferError( * 'debug: first buffer of ReadBuffer is empty') */ if (__pyx_v_self->_buf0 == Py_None) __pyx_t_1 = 0; else { Py_ssize_t __pyx_temp = __Pyx_PyBytes_GET_SIZE(__pyx_v_self->_buf0); if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(1, 474, __pyx_L1_error) __pyx_t_1 = (__pyx_temp != 0); } __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/buffer.pyx":475 * if PG_DEBUG: * if not self._buf0: * raise BufferError( # <<<<<<<<<<<<<< * 'debug: first buffer of ReadBuffer is empty') * */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_debug_first_buffer_of_ReadBuffer}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __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(1, 475, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":474 * * if PG_DEBUG: * if not self._buf0: # <<<<<<<<<<<<<< * raise BufferError( * 'debug: first buffer of ReadBuffer is empty') */ } /* "asyncpg/pgproto/buffer.pyx":473 * cdef const char *first_byte * * if PG_DEBUG: # <<<<<<<<<<<<<< * if not self._buf0: * raise BufferError( */ } /* "asyncpg/pgproto/buffer.pyx":478 * '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, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":479 * * 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, 479, __pyx_L1_error) __pyx_v_first_byte = __pyx_t_7; /* "asyncpg/pgproto/buffer.pyx":480 * 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":481 * 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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_not_enough_data_to_read_one_byte}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 481, __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(1, 481, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":480 * 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":483 * 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":470 * 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":485 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":490 * 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, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":491 * * 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, 491, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":492 * 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":493 * 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":492 * self._ensure_first_buf() * cbuf = self._try_read_bytes(8) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int64(cbuf) * else: */ } /* "asyncpg/pgproto/buffer.pyx":495 * 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, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":496 * 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":485 * 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":498 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":503 * 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, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":504 * * 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, 504, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":505 * 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":506 * 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":505 * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int32(cbuf) * else: */ } /* "asyncpg/pgproto/buffer.pyx":508 * 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, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":509 * 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":498 * 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":511 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":516 * 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, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":517 * * 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, 517, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":518 * 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":519 * 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":518 * self._ensure_first_buf() * cbuf = self._try_read_bytes(2) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int16(cbuf) * else: */ } /* "asyncpg/pgproto/buffer.pyx":521 * 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, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":522 * 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":511 * 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":524 * 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; size_t __pyx_t_5; char const *__pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_null_str", 0); /* "asyncpg/pgproto/buffer.pyx":525 * * 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":526 * 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_read_null_str_only_works_when_th}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 526, __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(1, 526, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":525 * * 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":537 * 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, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":539 * 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":540 * * 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":541 * 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":542 * 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":543 * 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":544 * 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":545 * 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, 545, __pyx_L1_error) __pyx_v_buf = __pyx_t_6; /* "asyncpg/pgproto/buffer.pyx":546 * 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":547 * 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, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":546 * 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":549 * return cpython.PyBytes_FromStringAndSize(buf, nread) * else: * break # <<<<<<<<<<<<<< * else: * buf += 1 */ /*else*/ { goto __pyx_L5_break; } /* "asyncpg/pgproto/buffer.pyx":542 * 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":551 * break * else: * buf += 1 # <<<<<<<<<<<<<< * * result = b'' */ /*else*/ { __pyx_v_buf = (__pyx_v_buf + 1); } } __pyx_L5_break:; /* "asyncpg/pgproto/buffer.pyx":553 * buf += 1 * * result = b'' # <<<<<<<<<<<<<< * while True: * pos = self._buf0.find(b'\x00', self._pos0) */ __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_); __pyx_v_result = __pyx_mstate_global->__pyx_kp_b_; /* "asyncpg/pgproto/buffer.pyx":554 * * result = b'' * while True: # <<<<<<<<<<<<<< * pos = self._buf0.find(b'\x00', self._pos0) * if pos >= 0: */ while (1) { /* "asyncpg/pgproto/buffer.pyx":555 * result = b'' * while True: * pos = self._buf0.find(b'\x00', self._pos0) # <<<<<<<<<<<<<< * if pos >= 0: * result += self._buf0[self._pos0 : pos] */ __pyx_t_4 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_self->_pos0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_b__2, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_find, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_7 = PyLong_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_pos = __pyx_t_7; /* "asyncpg/pgproto/buffer.pyx":556 * 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":557 * 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, 557, __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, 557, __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, 557, __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":558 * 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":559 * 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":560 * 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":562 * 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":563 * * 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":564 * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: * raise BufferError( # <<<<<<<<<<<<<< * 'read_null_str: buffer overread') * */ __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_read_null_str_buffer_overread}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 564, __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(1, 564, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":563 * * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'read_null_str: buffer overread') */ } /* "asyncpg/pgproto/buffer.pyx":567 * '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":556 * 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":570 * * 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, 570, __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, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/pgproto/buffer.pyx":571 * 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":572 * result += self._buf0[self._pos0:] * nread = self._len0 - self._pos0 * self._pos0 = self._len0 # <<<<<<<<<<<<<< * self._length -= nread * */ __pyx_t_7 = __pyx_v_self->_len0; __pyx_v_self->_pos0 = __pyx_t_7; /* "asyncpg/pgproto/buffer.pyx":573 * 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":575 * 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":576 * * 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":577 * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: * raise BufferError( # <<<<<<<<<<<<<< * 'read_null_str: buffer overread') * */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_read_null_str_buffer_overread}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 577, __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(1, 577, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":576 * * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'read_null_str: buffer overread') */ } /* "asyncpg/pgproto/buffer.pyx":580 * 'read_null_str: buffer overread') * * self._ensure_first_buf() # <<<<<<<<<<<<<< * * cdef int32_t take_message(self) except -1: */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* "asyncpg/pgproto/buffer.pyx":524 * 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_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":582 * 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; size_t __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", 0); /* "asyncpg/pgproto/buffer.pyx":586 * const char *cbuf * * if self._current_message_ready: # <<<<<<<<<<<<<< * return 1 * */ if (__pyx_v_self->_current_message_ready) { /* "asyncpg/pgproto/buffer.pyx":587 * * if self._current_message_ready: * return 1 # <<<<<<<<<<<<<< * * if self._current_message_type == 0: */ __pyx_r = 1; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":586 * const char *cbuf * * if self._current_message_ready: # <<<<<<<<<<<<<< * return 1 * */ } /* "asyncpg/pgproto/buffer.pyx":589 * 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":590 * * 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":591 * 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":590 * * if self._current_message_type == 0: * if self._length < 1: # <<<<<<<<<<<<<< * return 0 * self._ensure_first_buf() */ } /* "asyncpg/pgproto/buffer.pyx":592 * 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, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":593 * 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, 593, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_3; /* "asyncpg/pgproto/buffer.pyx":594 * 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":595 * 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_failed_to_read_one_byte_on_a_non}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 595, __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(1, 595, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":594 * 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":597 * 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":589 * return 1 * * if self._current_message_type == 0: # <<<<<<<<<<<<<< * if self._length < 1: * return 0 */ } /* "asyncpg/pgproto/buffer.pyx":599 * 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":600 * * 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":601 * 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":600 * * if self._current_message_len == 0: * if self._length < 4: # <<<<<<<<<<<<<< * return 0 * */ } /* "asyncpg/pgproto/buffer.pyx":603 * 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, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":604 * * 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, 604, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_3; /* "asyncpg/pgproto/buffer.pyx":605 * 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":606 * 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":605 * 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":608 * 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, 608, __pyx_L1_error) __pyx_v_self->_current_message_len = __pyx_t_7; } __pyx_L9:; /* "asyncpg/pgproto/buffer.pyx":610 * 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":599 * self._current_message_type = cbuf[0] * * if self._current_message_len == 0: # <<<<<<<<<<<<<< * if self._length < 4: * return 0 */ } /* "asyncpg/pgproto/buffer.pyx":612 * 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":613 * * 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":612 * self._current_message_len_unread = self._current_message_len - 4 * * if self._length < self._current_message_len_unread: # <<<<<<<<<<<<<< * return 0 * */ } /* "asyncpg/pgproto/buffer.pyx":615 * return 0 * * self._current_message_ready = 1 # <<<<<<<<<<<<<< * return 1 * */ __pyx_v_self->_current_message_ready = 1; /* "asyncpg/pgproto/buffer.pyx":616 * * 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":582 * 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":618 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":621 * 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":622 * * 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":621 * cdef const char *buf0 * * if self._current_message_ready: # <<<<<<<<<<<<<< * return self._current_message_type == mtype * elif self._length >= 1: */ } /* "asyncpg/pgproto/buffer.pyx":623 * 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":624 * 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, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":625 * 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":627 * 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, 627, __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":623 * 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":629 * 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":618 * 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":631 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("put_message", 0); /* "asyncpg/pgproto/buffer.pyx":632 * * 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":633 * 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_cannot_put_message_no_message_ta}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 633, __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(1, 633, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":632 * * 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":635 * 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":636 * '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":631 * 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":638 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":643 * 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":644 * * if not self._current_message_ready: * return NULL # <<<<<<<<<<<<<< * * self._ensure_first_buf() */ __pyx_r = NULL; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":643 * const char *buf * * if not self._current_message_ready: # <<<<<<<<<<<<<< * return NULL * */ } /* "asyncpg/pgproto/buffer.pyx":646 * 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, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":647 * * 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":648 * 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, 648, __pyx_L1_error) __pyx_v_buf = __pyx_t_4; /* "asyncpg/pgproto/buffer.pyx":649 * 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":650 * 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":651 * 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, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":649 * 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":652 * 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":638 * 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":654 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("discard_message", 0); /* "asyncpg/pgproto/buffer.pyx":655 * * 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":656 * 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_no_message_to_discard}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 656, __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(1, 656, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":655 * * 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":657 * 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":658 * 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, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":659 * 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":657 * 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":660 * 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, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":654 * 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":662 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("consume_message", 0); /* "asyncpg/pgproto/buffer.pyx":663 * * 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":664 * 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_no_message_to_consume}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 664, __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(1, 664, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":663 * * 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":665 * 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":666 * 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, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mem = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":665 * 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":668 * mem = self.read_bytes(self._current_message_len_unread) * else: * mem = b'' # <<<<<<<<<<<<<< * self._finish_message() * return mem */ /*else*/ { __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_); __pyx_v_mem = __pyx_mstate_global->__pyx_kp_b_; } __pyx_L4:; /* "asyncpg/pgproto/buffer.pyx":669 * 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, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":670 * mem = b'' * self._finish_message() * return mem # <<<<<<<<<<<<<< * * cdef int32_t 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":662 * 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":672 * return mem * * cdef int32_t redirect_messages(self, WriteBuffer buf, char mtype, # <<<<<<<<<<<<<< * int stop_at=0): * # Redirects messages from self into buf until either */ static int32_t __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; int32_t __pyx_v_count; 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; size_t __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", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_stop_at = __pyx_optional_args->stop_at; } } /* "asyncpg/pgproto/buffer.pyx":679 * # Returns the number of messages redirected. * * 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":680 * * if not self._current_message_ready: * raise BufferError( # <<<<<<<<<<<<<< * 'consume_full_messages called on a buffer without a ' * 'complete first message') */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_consume_full_messages_called_on}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 680, __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(1, 680, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":679 * # Returns the number of messages redirected. * * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError( * 'consume_full_messages called on a buffer without a ' */ } /* "asyncpg/pgproto/buffer.pyx":683 * '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":684 * '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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_consume_full_messages_called_wit}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 684, __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(1, 684, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":683 * '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":686 * 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":687 * '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_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_consume_full_messages_called_on_2}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 687, __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(1, 687, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":686 * 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":699 * int32_t count * * count = 0 # <<<<<<<<<<<<<< * while True: * count += 1 */ __pyx_v_count = 0; /* "asyncpg/pgproto/buffer.pyx":700 * * count = 0 * while True: # <<<<<<<<<<<<<< * count += 1 * buf.write_byte(mtype) */ while (1) { /* "asyncpg/pgproto/buffer.pyx":701 * count = 0 * while True: * count += 1 # <<<<<<<<<<<<<< * buf.write_byte(mtype) * buf.write_int32(self._current_message_len) */ __pyx_v_count = (__pyx_v_count + 1); /* "asyncpg/pgproto/buffer.pyx":702 * while True: * count += 1 * 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, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":703 * count += 1 * 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, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":705 * 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, 705, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_6; /* "asyncpg/pgproto/buffer.pyx":706 * * 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":707 * 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, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":706 * * cbuf = self.try_consume_message(&cbuf_len) * if cbuf != NULL: # <<<<<<<<<<<<<< * buf.write_cstr(cbuf, cbuf_len) * else: */ goto __pyx_L8; } /* "asyncpg/pgproto/buffer.pyx":709 * 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, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 709, __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; } __pyx_L8:; /* "asyncpg/pgproto/buffer.pyx":711 * 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":712 * * if self._length > 0: * self._ensure_first_buf() # <<<<<<<<<<<<<< * else: * return count */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/buffer.pyx":711 * buf.write_bytes(self.consume_message()) * * if self._length > 0: # <<<<<<<<<<<<<< * self._ensure_first_buf() * else: */ goto __pyx_L9; } /* "asyncpg/pgproto/buffer.pyx":714 * self._ensure_first_buf() * else: * return count # <<<<<<<<<<<<<< * * if stop_at and buf._length >= stop_at: */ /*else*/ { __pyx_r = __pyx_v_count; goto __pyx_L0; } __pyx_L9:; /* "asyncpg/pgproto/buffer.pyx":716 * return count * * if stop_at and buf._length >= stop_at: # <<<<<<<<<<<<<< * return count * */ __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":717 * * if stop_at and buf._length >= stop_at: * return count # <<<<<<<<<<<<<< * * # Fast path: exhaust buf0 as efficiently as possible. */ __pyx_r = __pyx_v_count; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":716 * return count * * if stop_at and buf._length >= stop_at: # <<<<<<<<<<<<<< * return count * */ } /* "asyncpg/pgproto/buffer.pyx":720 * * # 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":721 * # 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_4 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_4); __pyx_v_cbuf = PyBytes_AS_STRING(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/buffer.pyx":722 * 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":723 * 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":725 * 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":728 * # 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":729 * # 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":730 * 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":731 * 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":729 * # 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":732 * 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":733 * 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":732 * 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":734 * 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":735 * (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":732 * done = 1 * break * if (stop_at and # <<<<<<<<<<<<<< * (buf._length + new_pos0 - self._pos0) > stop_at): * done = 1 */ } /* "asyncpg/pgproto/buffer.pyx":736 * 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":737 * 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":738 * msg_len = hton.unpack_int32(cbuf + new_pos0 + 1) + 1 * if new_pos0 + msg_len > cbuf_len: * break # <<<<<<<<<<<<<< * new_pos0 += msg_len * count += 1 */ goto __pyx_L15_break; /* "asyncpg/pgproto/buffer.pyx":737 * 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":739 * if new_pos0 + msg_len > cbuf_len: * break * new_pos0 += msg_len # <<<<<<<<<<<<<< * count += 1 * */ __pyx_v_new_pos0 = (__pyx_v_new_pos0 + __pyx_v_msg_len); /* "asyncpg/pgproto/buffer.pyx":740 * break * new_pos0 += msg_len * count += 1 # <<<<<<<<<<<<<< * * if new_pos0 != self._pos0: */ __pyx_v_count = (__pyx_v_count + 1); } __pyx_L15_break:; /* "asyncpg/pgproto/buffer.pyx":742 * count += 1 * * 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":743 * * 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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0); __PYX_ERR(1, 743, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(1, 743, __pyx_L1_error) #endif /* "asyncpg/pgproto/buffer.pyx":745 * 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":746 * * pos_delta = new_pos0 - self._pos0 * buf.write_cstr( # <<<<<<<<<<<<<< * cbuf + self._pos0, * pos_delta */ __pyx_t_4 = __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_4)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/buffer.pyx":751 * ) * * self._pos0 = new_pos0 # <<<<<<<<<<<<<< * self._length -= pos_delta * */ __pyx_v_self->_pos0 = __pyx_v_new_pos0; /* "asyncpg/pgproto/buffer.pyx":752 * * 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":754 * 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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0); __PYX_ERR(1, 754, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(1, 754, __pyx_L1_error) #endif /* "asyncpg/pgproto/buffer.pyx":742 * count += 1 * * if new_pos0 != self._pos0: # <<<<<<<<<<<<<< * assert self._pos0 < new_pos0 <= self._len0 * */ } /* "asyncpg/pgproto/buffer.pyx":756 * assert self._length >= 0 * * if done: # <<<<<<<<<<<<<< * # The next message is of a different type. * return count */ __pyx_t_1 = (__pyx_v_done != 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":758 * if done: * # The next message is of a different type. * return count # <<<<<<<<<<<<<< * * # Back to slow path. */ __pyx_r = __pyx_v_count; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":756 * assert self._length >= 0 * * if done: # <<<<<<<<<<<<<< * # The next message is of a different type. * return count */ } /* "asyncpg/pgproto/buffer.pyx":720 * * # 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":761 * * # Back to slow path. * if not self.take_message_type(mtype): # <<<<<<<<<<<<<< * return count * */ __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, 761, __pyx_L1_error) __pyx_t_1 = (!(__pyx_t_9 != 0)); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":762 * # Back to slow path. * if not self.take_message_type(mtype): * return count # <<<<<<<<<<<<<< * * cdef bytearray consume_messages(self, char mtype): */ __pyx_r = __pyx_v_count; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":761 * * # Back to slow path. * if not self.take_message_type(mtype): # <<<<<<<<<<<<<< * return count * */ } } /* "asyncpg/pgproto/buffer.pyx":672 * return mem * * cdef int32_t redirect_messages(self, WriteBuffer buf, char mtype, # <<<<<<<<<<<<<< * int stop_at=0): * # Redirects messages from self into buf until either */ /* function exit code */ __pyx_r = 0; 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_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":764 * return count * * 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", 0); /* "asyncpg/pgproto/buffer.pyx":769 * char *buf * ssize_t nbytes * ssize_t total_bytes = 0 # <<<<<<<<<<<<<< * bytearray result * */ __pyx_v_total_bytes = 0; /* "asyncpg/pgproto/buffer.pyx":772 * 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, 772, __pyx_L1_error) __pyx_t_2 = (!(__pyx_t_1 != 0)); if (__pyx_t_2) { /* "asyncpg/pgproto/buffer.pyx":773 * * 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":772 * bytearray result * * if not self.take_message_type(mtype): # <<<<<<<<<<<<<< * return None * */ } /* "asyncpg/pgproto/buffer.pyx":778 * # 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, 778, __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, 778, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":779 * # 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":781 * 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, 781, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (!__pyx_t_2) break; /* "asyncpg/pgproto/buffer.pyx":782 * * 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, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":783 * 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":784 * 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, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":785 * 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":786 * 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":787 * 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, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/pgproto/buffer.pyx":790 * * # 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, 790, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":792 * 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":764 * return count * * 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":794 * 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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("finish_message", 0); /* "asyncpg/pgproto/buffer.pyx":795 * * 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":798 * # 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":795 * * 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":800 * 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":801 * * 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":802 * if self._current_message_len_unread: * if PG_DEBUG: * mtype = chr(self._current_message_type) # <<<<<<<<<<<<<< * * discarded = self.consume_message() */ __pyx_t_3 = PyUnicode_FromOrdinal(__pyx_v_self->_current_message_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_mtype = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":801 * * if self._current_message_len_unread: * if PG_DEBUG: # <<<<<<<<<<<<<< * mtype = chr(self._current_message_type) * */ } /* "asyncpg/pgproto/buffer.pyx":804 * mtype = chr(self._current_message_type) * * discarded = self.consume_message() # <<<<<<<<<<<<<< * * if PG_DEBUG: */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_message(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_discarded = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":806 * 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":807 * * if PG_DEBUG: * print('!!! discarding message {!r} unread data: {!r}'.format( # <<<<<<<<<<<<<< * mtype, * discarded)) */ __pyx_t_4 = NULL; __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_discarding_message_r_unread_dat; __Pyx_INCREF(__pyx_t_6); /* "asyncpg/pgproto/buffer.pyx":808 * if PG_DEBUG: * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, # <<<<<<<<<<<<<< * discarded)) * */ if (unlikely(!__pyx_v_mtype)) { __Pyx_RaiseUnboundLocalError("mtype"); __PYX_ERR(1, 808, __pyx_L1_error) } /* "asyncpg/pgproto/buffer.pyx":809 * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, * discarded)) # <<<<<<<<<<<<<< * * self._finish_message() */ __pyx_t_7 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_mtype, __pyx_v_discarded}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":806 * discarded = self.consume_message() * * if PG_DEBUG: # <<<<<<<<<<<<<< * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, */ } /* "asyncpg/pgproto/buffer.pyx":800 * return * * if self._current_message_len_unread: # <<<<<<<<<<<<<< * if PG_DEBUG: * mtype = chr(self._current_message_type) */ } /* "asyncpg/pgproto/buffer.pyx":811 * 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, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":794 * 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_XDECREF(__pyx_t_6); __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":813 * 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", 0); /* "asyncpg/pgproto/buffer.pyx":814 * * 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":815 * 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":816 * 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":817 * 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":813 * 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":819 * self._current_message_len_unread = 0 * * @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", 0); /* "asyncpg/pgproto/buffer.pyx":823 * cdef ReadBuffer buf * * buf = ReadBuffer.__new__(ReadBuffer) # <<<<<<<<<<<<<< * buf.feed_data(data) * */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_7asyncpg_7pgproto_7pgproto_ReadBuffer(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 823, __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":824 * * 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, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":826 * 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":827 * * 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":829 * 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":819 * self._current_message_len_unread = 0 * * @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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(8, 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 3, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 3, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(8, 3, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(8, 3, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 3, __pyx_L3_error) } __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(8, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(8, 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; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8[4]; PyObject *__pyx_t_9 = NULL; size_t __pyx_t_10; Py_ssize_t __pyx_t_11; Py_ssize_t __pyx_t_12; int __pyx_t_13; PyObject *__pyx_t_14[3]; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pg_uuid_bytes_from_str", 0); /* "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 == ((void *)NULL))) __PYX_ERR(2, 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":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_5 = NULL; /* "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_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_u), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "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(2, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_invalid_UUID; __pyx_t_8[1] = __pyx_t_6; __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_length_must_be_between_32_36_ch; __pyx_t_8[3] = __pyx_t_7; /* "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_9 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 48 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 88, __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(2, 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_11 = __pyx_v_size; __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/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":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_9 = NULL; /* "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_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_u), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyUnicode_FromOrdinal(__pyx_v_ch); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_7), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_invalid_UUID; __pyx_t_8[1] = __pyx_t_5; __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_unexpected_character; __pyx_t_8[3] = __pyx_t_6; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 102, __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(2, 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_7 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_invalid_UUID_u_r_unexpected_char}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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(2, 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":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_7 = NULL; /* "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_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_u), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_invalid_UUID; __pyx_t_14[1] = __pyx_t_9; __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_decodes_to_more_than_16_bytes; __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_14, 3, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 31, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(2, 117, __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(2, 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":121 * * if j != 16: * raise ValueError( # <<<<<<<<<<<<<< * f'invalid UUID {u!r}: decodes to less than 16 bytes') * */ __pyx_t_6 = NULL; /* "asyncpg/pgproto/uuid.pyx":122 * if j != 16: * raise ValueError( * f'invalid UUID {u!r}: decodes to less than 16 bytes') # <<<<<<<<<<<<<< * * */ __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_u), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_invalid_UUID; __pyx_t_14[1] = __pyx_t_7; __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_decodes_to_less_than_16_bytes; __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_14, 3, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 31, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_9}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 121, __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(2, 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_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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; 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("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = () # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None and _dict: */ __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple); __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple; /* "(tree fragment)":6 * cdef bint use_setstate * state = () * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None and _dict: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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 and _dict: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_3 = (__pyx_v__dict != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(8, 7, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None and _dict: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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) != (0)) __PYX_ERR(8, 8, __pyx_L1_error); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "(tree fragment)":9 * if _dict is not None and _dict: * 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 and _dict: # <<<<<<<<<<<<<< * 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_t_2 = __Pyx_PyObject_IsTrue(__pyx_mstate_global->__pyx_tuple[0]); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 11, __pyx_L1_error) __pyx_v_use_setstate = __pyx_t_2; } __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_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle___UUIDReplaceMe); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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)))) != (0)) __PYX_ERR(8, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(8, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(8, 13, __pyx_L1_error); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 13, __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) != (0)) __PYX_ERR(8, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(8, 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) != (0)) __PYX_ERR(8, 13, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 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_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle___UUIDReplaceMe); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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)))) != (0)) __PYX_ERR(8, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(8, 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) != (0)) __PYX_ERR(8, 15, __pyx_L1_error); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(8, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(8, 15, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 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_4); __Pyx_XDECREF(__pyx_t_5); __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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 16, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 16, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(8, 16, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(8, 16, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 16, __pyx_L3_error) } __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(8, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(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) # <<<<<<<<<<<<<< */ __pyx_t_1 = __pyx_v___pyx_state; __Pyx_INCREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(8, 17, __pyx_L1_error) if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'"); __PYX_ERR(8, 17, __pyx_L1_error) } __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle___UUIDReplaceMe__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 17, __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; /* "(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_XDECREF(__pyx_t_2); __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", 0); /* "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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return -1; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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__", 0); /* "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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_inp,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 150, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 150, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(2, 150, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(2, 150, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 150, __pyx_L3_error) } __pyx_v_inp = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 150, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "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(2, 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_4 = NULL; __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_16_bytes_were_expected_got, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 158, __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(2, 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}') */ __pyx_t_3 = __pyx_v_inp; __Pyx_INCREF(__pyx_t_3); if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(2, 162, __pyx_L1_error) __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_bytes_from_str(((PyObject*)__pyx_t_3), __pyx_v_self->_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = NULL; __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_inp), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_a_bytes_or_str_object_expected_g, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 164, __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(2, 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_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __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__", 0); /* "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(2, 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; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 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. */ __pyx_t_1 = (__pyx_v_self->_int == Py_None); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":181 * # Cython's implementation of & mishandles it. * # See cython/cython#6480. * self._int = int.from_bytes(self.bytes, 'big') or 0 # <<<<<<<<<<<<<< * return self._int * */ __pyx_t_4 = ((PyObject *)(&PyLong_Type)); __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_bytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_big}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_from_bytes, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 181, __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(2, 181, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyLong_From_long(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; __pyx_L4_bool_binop_done:; __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":182 * # See cython/cython#6480. * self._int = int.from_bytes(self.bytes, 'big') or 0 * 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":184 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":186 * @property * def is_safe(self): * return uuid.SafeUUID.unknown # <<<<<<<<<<<<<< * * def __str__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_uuid); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SafeUUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 186, __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_mstate_global->__pyx_n_u_unknown); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 186, __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":184 * 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":188 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":190 * 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":191 * 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(2, 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":188 * 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":193 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":196 * 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":197 * 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(2, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":193 * 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":199 * 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; PyObject *__pyx_t_2[3]; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "asyncpg/pgproto/uuid.pyx":200 * * def __repr__(self): * return f"UUID('{self}')" # <<<<<<<<<<<<<< * * def __reduce__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_UUID; __pyx_t_2[1] = __pyx_t_1; __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u__3; __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":199 * 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_3); __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":202 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); 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__", 0); /* "asyncpg/pgproto/uuid.pyx":203 * * 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_mstate_global->__pyx_n_u_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 203, __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) != (0)) __PYX_ERR(2, 203, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 203, __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)))) != (0)) __PYX_ERR(2, 203, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 203, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":202 * 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":205 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":206 * * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":207 * 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(2, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":206 * * 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":208 * 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_std_UUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":209 * 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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 209, __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(2, 209, __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":208 * 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":210 * 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":205 * 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":212 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":213 * * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":214 * 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(2, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":213 * * 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":215 * 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_std_UUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":216 * 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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 216, __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(2, 216, __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":215 * 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":217 * 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":212 * 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":219 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":220 * * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":221 * 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(2, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":220 * * 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":222 * 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_std_UUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":223 * 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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 223, __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(2, 223, __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":222 * 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":224 * 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":219 * 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":226 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":227 * * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":228 * 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(2, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":227 * * 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":229 * 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_std_UUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":230 * 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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 230, __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(2, 230, __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":229 * 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":231 * 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":226 * 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":233 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":234 * * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":235 * 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(2, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":234 * * 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":236 * 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_std_UUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":237 * 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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 237, __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(2, 237, __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":236 * 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":238 * 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":233 * 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":240 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":241 * * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":242 * 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(2, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":241 * * 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":243 * 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_std_UUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":244 * 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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 244, __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(2, 244, __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":243 * 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":245 * 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":240 * 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":247 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":251 * # 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":252 * # as fast as possible. * if self._hash is not None: * return self._hash # <<<<<<<<<<<<<< * * self._hash = hash(self.int) */ __pyx_t_2 = __Pyx_PyLong_AsHash_t(__pyx_v_self->_hash); if (unlikely((__pyx_t_2 == (Py_hash_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 252, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":251 * # 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":254 * return self._hash * * self._hash = hash(self.int) # <<<<<<<<<<<<<< * return self._hash * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 254, __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(2, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyLong_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 254, __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":255 * * self._hash = hash(self.int) * return self._hash # <<<<<<<<<<<<<< * * def __int__(self): */ __pyx_t_2 = __Pyx_PyLong_AsHash_t(__pyx_v_self->_hash); if (unlikely((__pyx_t_2 == (Py_hash_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 255, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":247 * 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":257 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":258 * * def __int__(self): * return self.int # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":257 * 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":260 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":262 * @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_mstate_global->__pyx_n_u_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytes = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/uuid.pyx":263 * 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_mstate_global->__pyx_slice[0]); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_bytes, __pyx_mstate_global->__pyx_slice[1]); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 263, __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(2, 263, __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_mstate_global->__pyx_slice[2]); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 263, __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(2, 263, __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":264 * 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_mstate_global->__pyx_slice[3], 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/pgproto/uuid.pyx":263 * 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(2, 263, __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":260 * 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":266 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":268 * @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_mstate_global->__pyx_n_u_time_low); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_time_mid); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_time_hi_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/pgproto/uuid.pyx":269 * 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_mstate_global->__pyx_n_u_clock_seq_hi_variant); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_clock_seq_low); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/pgproto/uuid.pyx":268 * @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(2, 268, __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) != (0)) __PYX_ERR(2, 268, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 268, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3) != (0)) __PYX_ERR(2, 268, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4) != (0)) __PYX_ERR(2, 268, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5) != (0)) __PYX_ERR(2, 268, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6) != (0)) __PYX_ERR(2, 268, __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":266 * 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":271 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":273 * @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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Rshift(__pyx_t_1, __pyx_mstate_global->__pyx_int_96); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 273, __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":271 * 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":275 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":277 * @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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Rshift(__pyx_t_1, __pyx_mstate_global->__pyx_int_80); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyLong_AndObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_65535, 0xffff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 277, __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":275 * 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":279 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":281 * @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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Rshift(__pyx_t_1, __pyx_mstate_global->__pyx_int_64); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyLong_AndObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_65535, 0xffff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 281, __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":279 * 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":283 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":285 * @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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyLong_RshiftObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_56, 56, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyLong_AndObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 285, __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":283 * 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":287 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":289 * @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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyLong_RshiftObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_48, 48, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyLong_AndObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 289, __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":287 * 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":291 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":293 * @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_mstate_global->__pyx_n_u_time_hi_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyLong_AndObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_4095, 0x0fff, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyLong_LshiftObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_48, 48, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":294 * 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_mstate_global->__pyx_n_u_time_mid); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyLong_LshiftObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_32, 32, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":293 * @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(2, 293, __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":294 * 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_mstate_global->__pyx_n_u_time_low); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 294, __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(2, 294, __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":291 * 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":296 * (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__", 0); /* "asyncpg/pgproto/uuid.pyx":298 * @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_mstate_global->__pyx_n_u_clock_seq_hi_variant); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyLong_AndObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_63, 0x3f, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyLong_LshiftObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":299 * 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_mstate_global->__pyx_n_u_clock_seq_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/pgproto/uuid.pyx":298 * @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(2, 298, __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":296 * (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":301 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":303 * @property * def node(self): * return self.int & 0xffffffffffff # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_mstate_global->__pyx_int_0xffffffffffff); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 303, __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":301 * 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":305 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":307 * @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(2, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_urn_uuid, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 307, __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":305 * 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":309 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":311 * @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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_mstate_global->__pyx_int_0x8000000000000000); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 311, __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(2, 311, __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":312 * 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_mstate_global->__pyx_n_u_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_RESERVED_NCS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 312, __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":311 * @property * def variant(self): * if not self.int & (0x8000 << 48): # <<<<<<<<<<<<<< * return uuid.RESERVED_NCS * elif not self.int & (0x4000 << 48): */ } /* "asyncpg/pgproto/uuid.pyx":313 * 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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_mstate_global->__pyx_int_0x4000000000000000); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 313, __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(2, 313, __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":314 * 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_mstate_global->__pyx_n_u_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_RFC_4122); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 314, __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":313 * 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":315 * 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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_mstate_global->__pyx_int_0x2000000000000000); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 315, __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(2, 315, __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":316 * 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_mstate_global->__pyx_n_u_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_RESERVED_MICROSOFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 316, __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":315 * 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":318 * return uuid.RESERVED_MICROSOFT * else: * return uuid.RESERVED_FUTURE # <<<<<<<<<<<<<< * * @property */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_uuid); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_RESERVED_FUTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 318, __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":309 * 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":320 * 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__", 0); /* "asyncpg/pgproto/uuid.pyx":323 * 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_mstate_global->__pyx_n_u_variant); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_RFC_4122); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 323, __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(2, 323, __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(2, 323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "asyncpg/pgproto/uuid.pyx":324 * # 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_mstate_global->__pyx_n_u_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Rshift(__pyx_t_2, __pyx_mstate_global->__pyx_int_76); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyLong_AndObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_15, 0xf, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 324, __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(2, 324, __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":323 * 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":320 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_text_codec", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if ( #if !CYTHON_USE_TYPE_SLOTS unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext && __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC)) #else 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))) #endif ) { #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_mstate_global->__pyx_n_u_get_text_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_1get_text_codec)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(9, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0); __PYX_ERR(9, 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_text_codec", __pyx_kwds); 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", 0); __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(9, 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", 0); /* "asyncpg/pgproto/codecs/context.pyx":14 * * cdef is_encoding_utf8(self): * raise NotImplementedError # <<<<<<<<<<<<<< * * cpdef get_json_decoder(self): */ __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0); __PYX_ERR(9, 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_json_decoder", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if ( #if !CYTHON_USE_TYPE_SLOTS unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext && __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC)) #else 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))) #endif ) { #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_mstate_global->__pyx_n_u_get_json_decoder); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_3get_json_decoder)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(9, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0); __PYX_ERR(9, 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_json_decoder", __pyx_kwds); 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", 0); __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(9, 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", 0); /* "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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_json_encoder", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if ( #if !CYTHON_USE_TYPE_SLOTS unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext && __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC)) #else 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))) #endif ) { #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_mstate_global->__pyx_n_u_get_json_encoder); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_5get_json_encoder)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(9, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0); __PYX_ERR(9, 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_json_encoder", __pyx_kwds); 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", 0); __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(9, 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", 0); /* "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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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; 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("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = () # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None and _dict: */ __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple); __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple; /* "(tree fragment)":6 * cdef bint use_setstate * state = () * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None and _dict: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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 and _dict: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_3 = (__pyx_v__dict != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(8, 7, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None and _dict: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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) != (0)) __PYX_ERR(8, 8, __pyx_L1_error); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "(tree fragment)":9 * if _dict is not None and _dict: * 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 and _dict: # <<<<<<<<<<<<<< * 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_t_2 = __Pyx_PyObject_IsTrue(__pyx_mstate_global->__pyx_tuple[0]); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 11, __pyx_L1_error) __pyx_v_use_setstate = __pyx_t_2; } __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_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CodecContext); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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)))) != (0)) __PYX_ERR(8, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(8, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(8, 13, __pyx_L1_error); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 13, __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) != (0)) __PYX_ERR(8, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(8, 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) != (0)) __PYX_ERR(8, 13, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 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_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CodecContext); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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)))) != (0)) __PYX_ERR(8, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(8, 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) != (0)) __PYX_ERR(8, 15, __pyx_L1_error); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(8, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(8, 15, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 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_4); __Pyx_XDECREF(__pyx_t_5); __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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 16, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 16, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(8, 16, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(8, 16, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 16, __pyx_L3_error) } __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(8, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(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) # <<<<<<<<<<<<<< */ __pyx_t_1 = __pyx_v___pyx_state; __Pyx_INCREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(8, 17, __pyx_L1_error) if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'"); __PYX_ERR(8, 17, __pyx_L1_error) } __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle_CodecContext__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 17, __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; /* "(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_XDECREF(__pyx_t_2); __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", 0); /* "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(10, 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(10, 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(10, 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; __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ( 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) * */ } } __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", 0); /* "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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(10, 34, __pyx_L1_error) __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_t_2, __pyx_v_buf_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; char const *__pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("as_pg_string_and_size", 0); /* "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 = NULL; __pyx_t_5 = __pyx_mstate_global->__pyx_kp_u_expected_str_got; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(11, 12, __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(11, 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_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->is_encoding_utf8(__pyx_v_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_8 = PyUnicode_AsUTF8AndSize(__pyx_v_obj, __pyx_v_size); if (unlikely(__pyx_t_8 == ((void *)NULL))) __PYX_ERR(11, 15, __pyx_L1_error) (__pyx_v_cstr[0]) = ((char *)__pyx_t_8); /* "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_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(11, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_obj}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_encoded = __pyx_t_3; __pyx_t_3 = 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_9 = PyBytes_AsStringAndSize(__pyx_v_encoded, __pyx_v_cstr, ((Py_ssize_t *)__pyx_v_size)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(11, 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_2 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_string_too_long}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 21, __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(11, 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_XDECREF(__pyx_t_6); __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", 0); /* "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(11, 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(11, 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(11, 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode_pg_string", 0); /* "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(11, 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(11, 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(11, 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(11, 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_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_text_codec(__pyx_v_settings, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_bytes}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(11, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 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", 0); /* "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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 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(11, 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; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_local_timezone", 0); /* "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_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_utc); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_now, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_astimezone, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __pyx_v_d; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_utcoffset, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __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", 0); /* "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(12, 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(12, 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(12, 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 == ((void *)NULL))) __PYX_ERR(12, 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, 1); /* "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, 1)); /* "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; size_t __pyx_t_3; long __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("date_encode", 0); /* "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_v_obj; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_toordinal, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 97, __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(12, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ordinal = ((int32_t)__pyx_t_4); /* "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_5 = (__pyx_v_ordinal == __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_date_ord); if (__pyx_t_5) { /* "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_5 = (__pyx_v_ordinal == __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_date_ord); if (__pyx_t_5) { /* "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(12, 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(12, 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_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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int32_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("date_encode_tuple", 0); /* "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(12, 115, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 1); if (unlikely(__pyx_t_2)) { /* "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 = NULL; /* "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_6 = __pyx_mstate_global->__pyx_kp_u_date_tuple_encoder_expecting_1_e; __Pyx_INCREF(__pyx_t_6); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 118, __pyx_L1_error) __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 116, __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(12, 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_3 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyLong_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_pg_ordinal = __pyx_t_9; /* "asyncpg/pgproto/codecs/datetime.pyx":121 * * pg_ordinal = obj[0] * buf.write_int32(4) # <<<<<<<<<<<<<< * buf.write_int32(pg_ordinal) * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":122 * pg_ordinal = obj[0] * buf.write_int32(4) * buf.write_int32(pg_ordinal) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_pg_ordinal); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_XDECREF(__pyx_t_7); __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; size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("date_decode", 0); /* "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 == ((void *)NULL))) __PYX_ERR(12, 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_mstate_global->__pyx_n_u_infinity_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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_mstate_global->__pyx_n_u_negative_infinity_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_date_from_ordinal); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyLong_From_int32_t((__pyx_v_pg_ordinal + __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_offset_ord)); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 133, __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":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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(12, 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_PyLong_From_int32_t(__pyx_v_pg_ordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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) != (0)) __PYX_ERR(12, 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; size_t __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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_year); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_month); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_day); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_4, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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*/ { __pyx_t_5 = NULL; /* "asyncpg/pgproto/codecs/datetime.pyx":149 * raise TypeError( * 'expected a datetime.date or datetime.datetime instance, ' * 'got {!r}'.format(type(obj).__name__) # <<<<<<<<<<<<<< * ) * */ __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_expected_a_datetime_date_or_date; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 147, __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(12, 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_2, __pyx_mstate_global->__pyx_n_u_pg_epoch_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyNumber_Subtract(__pyx_v_obj, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_delta = __pyx_t_7; __pyx_t_7 = 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_days); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyLong_AsLongLong(__pyx_t_7); if (unlikely(__pyx_t_9 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(12, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_seconds); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = PyLong_AsLong(__pyx_t_7); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_microseconds); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "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_7); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_7 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":160 * * buf.write_int32(8) * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_7 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int64_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timestamp_encode_tuple", 0); /* "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(12, 167, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 1); if (unlikely(__pyx_t_2)) { /* "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 = NULL; /* "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_6 = __pyx_mstate_global->__pyx_kp_u_timestamp_tuple_encoder_expectin; __Pyx_INCREF(__pyx_t_6); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 170, __pyx_L1_error) __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 168, __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(12, 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_3 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyLong_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_microseconds = __pyx_t_9; /* "asyncpg/pgproto/codecs/datetime.pyx":174 * microseconds = obj[0] * * buf.write_int32(8) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":175 * * buf.write_int32(8) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_XDECREF(__pyx_t_7); __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; PyObject *__pyx_t_10 = NULL; size_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timestamp_decode", 0); /* "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(12, 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_mstate_global->__pyx_n_u_infinity_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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_mstate_global->__pyx_n_u_negative_infinity_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pg_epoch_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_add); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":192 * else: * return pg_epoch_datetime.__add__( * timedelta(0, seconds, microseconds)) # <<<<<<<<<<<<<< * * */ __pyx_t_7 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_timedelta); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyLong_From_int64_t(__pyx_v_seconds); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyLong_From_int32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_0, __pyx_t_9, __pyx_t_10}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_11, (4-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 191, __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":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_XDECREF(__pyx_t_10); __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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(12, 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_PyLong_From_int64_t(__pyx_v_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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) != (0)) __PYX_ERR(12, 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; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; size_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; PY_LONG_LONG __pyx_t_11; long __pyx_t_12; 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_year); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_month); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_day); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "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_8 = __pyx_f_7asyncpg_7pgproto_7pgproto__local_timezone(); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_4, __pyx_t_6, __pyx_t_7}; __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_tzinfo, __pyx_t_8, __pyx_t_10, __pyx_callargs+4, 0) < (0)) __PYX_ERR(12, 205, __pyx_L1_error) __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10); __Pyx_XDECREF(__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; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_2); __pyx_t_2 = 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*/ { __pyx_t_5 = NULL; /* "asyncpg/pgproto/codecs/datetime.pyx":210 * raise TypeError( * 'expected a datetime.date or datetime.datetime instance, ' * 'got {!r}'.format(type(obj).__name__) # <<<<<<<<<<<<<< * ) * */ __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_expected_a_datetime_date_or_date; __Pyx_INCREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_10}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 208, __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(12, 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_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2, __pyx_mstate_global->__pyx_n_u_infinity_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = PyObject_RichCompare(__pyx_v_obj, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(12, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_infinity); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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_10, __pyx_mstate_global->__pyx_n_u_negative_infinity_datetime); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = PyObject_RichCompare(__pyx_v_obj, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(12, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_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(12, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_10 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_10); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_utc); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_astimezone, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_utc_dt = __pyx_t_2; __pyx_t_2 = 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_2, __pyx_mstate_global->__pyx_n_u_pg_epoch_datetime_utc); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyNumber_Subtract(__pyx_v_utc_dt, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_delta = __pyx_t_5; __pyx_t_5 = 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_days); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = PyLong_AsLongLong(__pyx_t_5); if (unlikely(__pyx_t_11 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(12, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_seconds); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = PyLong_AsLong(__pyx_t_5); if (unlikely(__pyx_t_12 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_11 * 0x15180) + __pyx_t_12); /* "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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_microseconds); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "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_12 = PyLong_AsLong(__pyx_t_5); if (unlikely(__pyx_t_12 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_12); /* "asyncpg/pgproto/codecs/datetime.pyx":231 * delta.microseconds) * * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_5 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __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; PyObject *__pyx_t_10 = NULL; size_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timestamptz_decode", 0); /* "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(12, 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_mstate_global->__pyx_n_u_infinity_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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_mstate_global->__pyx_n_u_negative_infinity_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pg_epoch_datetime_utc); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_add); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":248 * else: * return pg_epoch_datetime_utc.__add__( * timedelta(0, seconds, microseconds)) # <<<<<<<<<<<<<< * * */ __pyx_t_7 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_timedelta); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyLong_From_int64_t(__pyx_v_seconds); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyLong_From_int32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_0, __pyx_t_9, __pyx_t_10}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_11, (4-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 247, __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":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_XDECREF(__pyx_t_10); __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", 0); /* "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_mstate_global->__pyx_n_u_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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_mstate_global->__pyx_n_u_minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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_mstate_global->__pyx_n_u_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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_mstate_global->__pyx_n_u_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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(12, 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(12, 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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int64_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("time_encode_tuple", 0); /* "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(12, 266, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 1); if (unlikely(__pyx_t_2)) { /* "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 = NULL; /* "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_6 = __pyx_mstate_global->__pyx_kp_u_time_tuple_encoder_expecting_1_e; __Pyx_INCREF(__pyx_t_6); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 269, __pyx_L1_error) __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 267, __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(12, 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_3 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyLong_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_microseconds = __pyx_t_9; /* "asyncpg/pgproto/codecs/datetime.pyx":273 * microseconds = obj[0] * * buf.write_int32(8) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":274 * * buf.write_int32(8) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_XDECREF(__pyx_t_7); __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; size_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("time_decode", 0); /* "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(12, 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, 1); /* "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, 1); /* "asyncpg/pgproto/codecs/datetime.pyx":290 * int64_t min = minutes % 60 * * return datetime.time(hours, min, sec, microseconds) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_hours); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyLong_From_int64_t(__pyx_v_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyLong_From_int64_t(__pyx_v_sec); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyLong_From_int32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_t_4, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (5-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(12, 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_PyLong_From_int64_t(__pyx_v_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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) != (0)) __PYX_ERR(12, 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; size_t __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", 0); /* "asyncpg/pgproto/codecs/datetime.pyx":301 * * cdef timetz_encode(CodecContext settings, WriteBuffer buf, obj): * offset = obj.tzinfo.utcoffset(None) # <<<<<<<<<<<<<< * * cdef: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, Py_None}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_utcoffset, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_mstate_global->__pyx_n_u_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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_mstate_global->__pyx_n_u_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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_mstate_global->__pyx_n_u_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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_mstate_global->__pyx_n_u_minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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_mstate_global->__pyx_n_u_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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_mstate_global->__pyx_n_u_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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(12, 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(12, 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(12, 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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int64_t __pyx_t_9; int32_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timetz_encode_tuple", 0); /* "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(12, 327, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 2); if (unlikely(__pyx_t_2)) { /* "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 = NULL; /* "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_6 = __pyx_mstate_global->__pyx_kp_u_time_tuple_encoder_expecting_2_e; __Pyx_INCREF(__pyx_t_6); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 330, __pyx_L1_error) __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 328, __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(12, 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_3 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyLong_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_microseconds = __pyx_t_9; /* "asyncpg/pgproto/codecs/datetime.pyx":333 * * microseconds = obj[0] * offset_sec = obj[1] # <<<<<<<<<<<<<< * * buf.write_int32(12) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyLong_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_offset_sec = __pyx_t_10; /* "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_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 12); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":336 * * buf.write_int32(12) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * buf.write_int32(offset_sec) * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":337 * buf.write_int32(12) * buf.write_int64(microseconds) * buf.write_int32(offset_sec) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_offset_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_XDECREF(__pyx_t_7); __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; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; size_t __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timetz_decode", 0); /* "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(12, 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 == ((void *)NULL))) __PYX_ERR(12, 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_3 = __pyx_v_time; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_timedelta); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyLong_From_int32_t((-__pyx_v_offset)); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_8); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, NULL}; __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_minutes, __pyx_t_10, __pyx_t_12, __pyx_callargs+1, 0) < (0)) __PYX_ERR(12, 344, __pyx_L1_error) __pyx_t_6 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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_4)) __PYX_ERR(12, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_11 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL}; __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_tzinfo, __pyx_t_4, __pyx_t_7, __pyx_callargs+1, 0) < (0)) __PYX_ERR(12, 344, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_replace, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 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_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(12, 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 == ((void *)NULL))) __PYX_ERR(12, 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_PyLong_From_int64_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyLong_From_int32_t(__pyx_v_offset_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 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) != (0)) __PYX_ERR(12, 352, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(12, 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", 0); /* "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_mstate_global->__pyx_n_u_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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_mstate_global->__pyx_n_u_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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_mstate_global->__pyx_n_u_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int32_t __pyx_t_9; int64_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("interval_encode_tuple", 0); /* "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(12, 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(12, 374, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 3); if (unlikely(__pyx_t_2)) { /* "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 = NULL; /* "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_6 = __pyx_mstate_global->__pyx_kp_u_interval_tuple_encoder_expecting; __Pyx_INCREF(__pyx_t_6); if (unlikely(__pyx_v_obj == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(12, 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(12, 377, __pyx_L1_error) __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 375, __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(12, 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(12, 379, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyLong_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_months = __pyx_t_9; /* "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(12, 380, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_obj, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyLong_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_days = __pyx_t_9; /* "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(12, 381, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_obj, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyLong_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_microseconds = __pyx_t_10; /* "asyncpg/pgproto/codecs/datetime.pyx":383 * microseconds = obj[2] * * buf.write_int32(16) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * buf.write_int32(days) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 16); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_days); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":386 * buf.write_int64(microseconds) * buf.write_int32(days) * buf.write_int32(months) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_months); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_XDECREF(__pyx_t_7); __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; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; size_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("interval_decode", 0); /* "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(12, 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 == ((void *)NULL))) __PYX_ERR(12, 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 == ((void *)NULL))) __PYX_ERR(12, 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, 1))); /* "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, 1))); /* "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, 1)); /* "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, 1)); } __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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_timedelta); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyLong_From_long(((__pyx_v_days + (__pyx_v_months * 30)) + (__pyx_v_years * 0x16D))); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/pgproto/codecs/datetime.pyx":410 * * return datetime.timedelta(days=days + months * 30 + years * 365, * seconds=seconds, microseconds=microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_8 = __Pyx_PyLong_From_int64_t(__pyx_v_seconds); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyLong_From_int32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_5, NULL}; __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_days, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(12, 409, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_seconds, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(12, 409, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_microseconds, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(12, 409, __pyx_L1_error) __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; __pyx_t_4 = 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_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(12, 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 == ((void *)NULL))) __PYX_ERR(12, 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 == ((void *)NULL))) __PYX_ERR(12, 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_PyLong_From_int32_t(__pyx_v_months); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyLong_From_int32_t(__pyx_v_days); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 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) != (0)) __PYX_ERR(12, 423, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(12, 423, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(12, 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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("float4_encode", 0); /* "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(13, 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_5 = NULL; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_value_out_of_float32_range}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 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(13, 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(13, 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(13, 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_XDECREF(__pyx_t_5); __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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(13, 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(13, 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", 0); /* "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(13, 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(13, 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(13, 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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(13, 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(13, 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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; char __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bool_encode", 0); /* "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 = NULL; __pyx_t_5 = __pyx_mstate_global->__pyx_kp_u_a_boolean_is_required_got_type; __Pyx_INCREF(__pyx_t_5); /* "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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(14, 10, __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(14, 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_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_8 = '\x01'; } else { __pyx_t_8 = '\x00'; } __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(__pyx_v_buf, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_XDECREF(__pyx_t_6); __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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(14, 18, __pyx_L1_error) __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_t_1[0]) == '\x01')); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 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; size_t __pyx_t_10; 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 *)(&PyLong_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_mstate_global->__pyx_n_u_int_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(14, 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(14, 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(14, 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(((PyObject *)(((PyTypeObject*)PyExc_OverflowError)))); if (__pyx_t_8) { __Pyx_ErrRestore(0,0,0); /* "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; 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_9 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_value_out_of_int16_range}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 35, __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(14, 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_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":38 * * buf.write_int32(2) * buf.write_int16(val) # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_val)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(14, 42, __pyx_L1_error) __pyx_t_2 = PyLong_FromLong(unpack_int16(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 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; size_t __pyx_t_10; 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 *)(&PyLong_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_mstate_global->__pyx_n_u_int_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(14, 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(14, 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(14, 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(((PyObject *)(((PyTypeObject*)PyExc_OverflowError)))); if (__pyx_t_8) { __Pyx_ErrRestore(0,0,0); /* "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; 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_9 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_value_out_of_int32_range}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 60, __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(14, 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_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":63 * * buf.write_int32(4) * buf.write_int32(val) # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_val)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(14, 67, __pyx_L1_error) __pyx_t_2 = PyLong_FromLong(unpack_int32(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 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; size_t __pyx_t_10; 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 *)(&PyLong_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_mstate_global->__pyx_n_u_int_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(14, 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(14, 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(14, 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(((PyObject *)(((PyTypeObject*)PyExc_OverflowError)))); if (__pyx_t_8) { __Pyx_ErrRestore(0,0,0); /* "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; 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_9 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_value_out_of_uint32_range}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 85, __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(14, 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_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":88 * * buf.write_int32(4) * buf.write_int32(val) # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_val)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(14, 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(14, 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; size_t __pyx_t_10; 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 *)(&PyLong_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_mstate_global->__pyx_n_u_int_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(14, 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(14, 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(14, 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(((PyObject *)(((PyTypeObject*)PyExc_OverflowError)))); if (__pyx_t_8) { __Pyx_ErrRestore(0,0,0); /* "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; 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_9 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_value_out_of_int64_range}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 111, __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(14, 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_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":114 * * buf.write_int32(8) * buf.write_int64(val) # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, ((int64_t)__pyx_v_val)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(14, 118, __pyx_L1_error) __pyx_t_2 = PyLong_FromLongLong(unpack_int64(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 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; size_t __pyx_t_10; 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 *)(&PyLong_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_mstate_global->__pyx_n_u_int_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(14, 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(14, 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(14, 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(((PyObject *)(((PyTypeObject*)PyExc_OverflowError)))); if (__pyx_t_8) { __Pyx_ErrRestore(0,0,0); /* "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; 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_9 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_value_out_of_uint64_range}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 136, __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(14, 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_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":139 * * buf.write_int32(8) * buf.write_int64(val) # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, ((int64_t)__pyx_v_val)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(14, 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(14, 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; size_t __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_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_json_encoder(__pyx_v_settings, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(15, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_string_too_long}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; 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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("jsonb_decode", 0); /* "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 == ((void *)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 = NULL; __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_unexpected_JSONB_format; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyLong_From_uint8_t(__pyx_v_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(15, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rv = __pyx_t_3; __pyx_t_3 = 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_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->is_decoding_json(__pyx_v_settings); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 34, __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(15, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_json_decoder(__pyx_v_settings, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_rv}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3); __pyx_t_3 = 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_XDECREF(__pyx_t_7); __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; size_t __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_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_json_encoder(__pyx_v_settings, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(15, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("json_decode", 0); /* "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_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_json_decoder(__pyx_v_settings, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_rv}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(15, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("jsonpath_encode", 0); /* "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_3 = NULL; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_string_too_long}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; 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_XDECREF(__pyx_t_3); __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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("jsonpath_decode", 0); /* "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 == ((void *)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 = NULL; __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_unexpected_jsonpath_format; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyLong_From_uint8_t(__pyx_v_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(16, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 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_XDECREF(__pyx_t_7); __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 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("uuid_encode", 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) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pg_UUID); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_obj)) == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "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_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = __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_1)) __PYX_ERR(17, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_2 = PyUnicode_Check(__pyx_v_obj); if (__pyx_t_2) { /* "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) */ __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(17, 16, __pyx_L1_error) __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_bytes_from_str(((PyObject*)__pyx_t_1), __pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 16, __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/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_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_wbuf, __pyx_v_buf, 16); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode(__pyx_v_settings, __pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 20, __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; } __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_1); __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; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; char const *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uuid_decode", 0); /* "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":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_3 = NULL; /* "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_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_buf->len, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_cannot_decode_UUID_expected_16_b, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 25, __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(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_7 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(__pyx_v_buf); if (unlikely(__pyx_t_7 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(17, 27, __pyx_L1_error) __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_from_buf(__pyx_t_7); 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_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __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", 0); /* "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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("numeric_decode_text", 0); /* "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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Dec); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__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_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; size_t __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", 0); /* "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_mstate_global->__pyx_n_u_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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Dec); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(18, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_4 = __pyx_v_dec; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_as_tuple, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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_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_mstate_global->__pyx_n_u_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_mstate_global->__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_mstate_global->__pyx_n_u_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_mstate_global->__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_mstate_global->__pyx_n_u_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_mstate_global->__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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_exponent); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyLong_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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_cannot_encode_Decimal_value_into}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; 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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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) - 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) + 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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_cannot_encode_Decimal_value_into_2}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; 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, 1); /* "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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_cannot_encode_Decimal_value_into_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; 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_mstate_global->__pyx_tuple[1], __pyx_v_pydigits); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[1]); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_pydigits, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 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_1 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_cannot_encode_Decimal_value_into}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 114, __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(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_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, (0x8 + (2 * ((uint16_t)__pyx_v_num_pgdigits)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_num_pgdigits)); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_weight)); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_sign)); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, __pyx_v_dscale); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_v_j, int64_t, 1, __Pyx_PyLong_From_int64_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_t_4, __pyx_mstate_global->__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_4); __pyx_t_4 = 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_4 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_t_11, int64_t, 1, __Pyx_PyLong_From_int64_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyLong_MultiplyObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_100, 0x64, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 130, __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; /* "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_3 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_t_11, int64_t, 1, __Pyx_PyLong_From_int64_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyLong_MultiplyObjC(__pyx_t_3, __pyx_mstate_global->__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_3); __pyx_t_3 = 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_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 130, __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; /* "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_PyLong_From_int64_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 131, __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; __pyx_t_12 = __Pyx_PyLong_As_int16_t(__pyx_t_4); if (unlikely((__pyx_t_12 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(18, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, __pyx_v_pgdigit); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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[256]; 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; size_t __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int64_t __pyx_t_9; char *__pyx_t_10; uint16_t __pyx_t_11; uint16_t __pyx_t_12; Py_ssize_t __pyx_t_13; Py_ssize_t __pyx_t_14; Py_ssize_t __pyx_t_15; 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("numeric_decode_binary_ex", 0); /* "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 == ((void *)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 == ((void *)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 == ((void *)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 == ((void *)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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Dec); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_NaN}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(18, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Dec); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Infinity}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Dec); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Infinity_2}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(18, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Dec); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyLong_From_uint16_t(__pyx_v_dscale); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_0e, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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 == ((void *)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_PyLong_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_9 = __Pyx_PyLong_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((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_9; /* "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_10 = __pyx_f_7asyncpg_7pgproto_7pgproto__unpack_digit_stripping_lzeros(__pyx_v_bufptr, __pyx_v_pgdigit0); if (unlikely(__pyx_t_10 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(18, 249, __pyx_L10_error) __pyx_v_bufptr = __pyx_t_10; /* "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_10 = __pyx_f_7asyncpg_7pgproto_7pgproto__unpack_digit(__pyx_v_bufptr, __pyx_v_pgdigit0); if (unlikely(__pyx_t_10 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(18, 251, __pyx_L10_error) __pyx_v_bufptr = __pyx_t_10; } __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_11 = __pyx_v_num_pgdigits; __pyx_t_12 = __pyx_t_11; for (__pyx_t_13 = 1; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; /* "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 == ((void *)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_10 = __pyx_f_7asyncpg_7pgproto_7pgproto__unpack_digit(__pyx_v_bufptr, __pyx_v_pgdigit); if (unlikely(__pyx_t_10 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(18, 255, __pyx_L10_error) __pyx_v_bufptr = __pyx_t_10; } /* "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_13 = __pyx_v_trailing_fract_zeros_adj; __pyx_t_14 = __pyx_t_13; for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { __pyx_v_i = __pyx_t_15; /* "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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Dec); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 294, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_pydigits}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 294, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); } __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_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_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; __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ( 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; { 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_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_L1_error; } __pyx_L9_return: { __pyx_t_24 = __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_24; __pyx_t_24 = 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_XDECREF(__pyx_t_8); __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", 0); /* "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, 1); /* "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, 1); /* "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, 1); /* "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, 1); /* "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, 1); /* "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, 1); /* "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; size_t __pyx_t_5; Py_ssize_t __pyx_t_6; Py_ssize_t __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("bits_encode", 0); /* "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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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_v_obj; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_len, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_6 = PyLong_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_6 == (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_6; /* "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_7 = __pyx_v_pybuf.len; __pyx_v_len = __pyx_t_7; /* "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_2 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_bit_value_too_long}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; 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_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_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ( 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_4 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __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) * */ } } __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_4; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; 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_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; size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bits_decode", 0); /* "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 == ((void *)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 == ((void *)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_6, __pyx_mstate_global->__pyx_n_u_pgproto_types); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_BitString); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyLong_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_8 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_bytes_, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_frombytes, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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_4)) __PYX_ERR(19, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __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", 0); /* "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 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(20, 11, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE 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 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif ++__pyx_t_2; } if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 11, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(20, 11, __pyx_L1_error) PyErr_Clear(); } 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); 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; size_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decode_points", 0); /* "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 == ((void *)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 == ((void *)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 == ((void *)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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pgproto_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_7, __pyx_t_9}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_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", 0); /* "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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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) != (0)) __PYX_ERR(20, 37, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __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; PyObject *__pyx_t_9 = NULL; size_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("box_decode", 0); /* "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 == ((void *)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 == ((void *)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 == ((void *)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 == ((void *)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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pgproto_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Box); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pgproto_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyFloat_FromDouble(__pyx_v_high_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyFloat_FromDouble(__pyx_v_high_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_7, __pyx_t_9}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } /* "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_t_9 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pgproto_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __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_11 = PyFloat_FromDouble(__pyx_v_low_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(20, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_9); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_11}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_9); __Pyx_XDECREF(__pyx_t_11); __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", 0); /* "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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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; size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line_decode", 0); /* "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 == ((void *)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 == ((void *)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 == ((void *)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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pgproto_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Line); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble(__pyx_v_A); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_B); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_C); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_4, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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", 0); /* "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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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) != (0)) __PYX_ERR(20, 70, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __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; PyObject *__pyx_t_8 = NULL; size_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lseg_decode", 0); /* "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 == ((void *)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 == ((void *)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 == ((void *)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 == ((void *)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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pgproto_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_LineSegment); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble(__pyx_v_p1_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_p1_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __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_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(20, 80, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(20, 80, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_p2_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyFloat_FromDouble(__pyx_v_p2_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6) != (0)) __PYX_ERR(20, 80, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4) != (0)) __PYX_ERR(20, 80, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_XDECREF(__pyx_t_8); __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", 0); /* "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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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; size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("point_decode", 0); /* "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 == ((void *)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 == ((void *)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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pgproto_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; __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_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; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("path_encode", 0); /* "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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_is_closed); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyLong_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_2 = NULL; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_path_value_too_long}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; 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", 0); /* "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 == ((void *)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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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; PyObject *__pyx_t_4 = NULL; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("poly_encode", 0); /* "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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_polygon_value_too_long}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; 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_XDECREF(__pyx_t_4); __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", 0); /* "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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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", 0); /* "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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle_decode", 0); /* "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 == ((void *)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 == ((void *)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 == ((void *)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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pgproto_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Circle); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble(__pyx_v_center_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_center_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4) != (0)) __PYX_ERR(20, 164, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(20, 164, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_radius); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_7, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_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_XDECREF(__pyx_t_7); __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; size_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; 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", 0); /* "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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_hstore_value_is_too_large}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; 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_mstate_global->__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_v_obj; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_items, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_6 = 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_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 26, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(21, 26, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE 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 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif ++__pyx_t_2; } if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 26, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(21, 26, __pyx_L1_error) PyErr_Clear(); } 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_7 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 26, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(21, 26, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_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 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); 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_7); __pyx_t_7 = 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_8 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_null_value_not_allowed_in_hstore}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; 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_PyLong_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_7); __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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hstore_decode", 0); /* "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 == ((void *)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 == ((void *)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_7 = NULL; __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_null_value_not_allowed_in_hstore}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; 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 == ((void *)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("str", __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 == ((void *)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 == ((void *)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("str", __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_XDECREF(__pyx_t_7); __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", 0); /* "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", 0); /* 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", 0); /* "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; size_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int32_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("net_decode", 0); /* "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 == ((void *)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 == ((void *)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 == ((void *)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 == ((void *)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_5 = NULL; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_unexpected_CIDR_flag_set_in_non}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; 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 = NULL; __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_invalid_address_family_in_value; __Pyx_INCREF(__pyx_t_8); /* "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_mstate_global->__pyx_n_u_cidr); __pyx_t_9 = __pyx_mstate_global->__pyx_n_u_cidr; } else { __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_inet); __pyx_t_9 = __pyx_mstate_global->__pyx_n_u_inet; } __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 77, __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, 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_7 = NULL; __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_invalid_network_prefix_length_in; __Pyx_INCREF(__pyx_t_9); /* "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_mstate_global->__pyx_n_u_cidr); __pyx_t_8 = __pyx_mstate_global->__pyx_n_u_cidr; } else { __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_inet); __pyx_t_8 = __pyx_mstate_global->__pyx_n_u_inet; } __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(23, 84, __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, 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_10 = __pyx_f_7asyncpg_7pgproto_7pgproto__ip_addr_len(__pyx_v_family); if (unlikely(__pyx_t_10 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(23, 88, __pyx_L1_error) __pyx_t_3 = (__pyx_v_addrlen != __pyx_t_10); 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 = NULL; __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_invalid_address_length_in_value; __Pyx_INCREF(__pyx_t_8); /* "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_mstate_global->__pyx_n_u_cidr); __pyx_t_9 = __pyx_mstate_global->__pyx_n_u_cidr; } else { __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_inet); __pyx_t_9 = __pyx_mstate_global->__pyx_n_u_inet; } __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 89, __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, 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 == ((void *)NULL))) __PYX_ERR(23, 93, __pyx_L1_error) __pyx_t_4 = PyBytes_FromStringAndSize(__pyx_t_1, __pyx_v_addrlen); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_addr = ((PyObject*)__pyx_t_4); __pyx_t_4 = 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_11 = (__pyx_v_bits != __pyx_v_max_prefix_len); __pyx_t_3 = __pyx_t_11; __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_4 = PyLong_FromLong(__pyx_v_bits); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(23, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_prefix_len = __pyx_t_12; /* "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_t_7 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ipnet); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_prefix_len); if (unlikely(!__pyx_t_9)) __PYX_ERR(23, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_addr) != (0)) __PYX_ERR(23, 99, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(23, 99, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; __pyx_t_4 = 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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ipiface); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyLong_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_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(23, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_addr) != (0)) __PYX_ERR(23, 101, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(23, 101, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; __pyx_t_4 = 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_t_8 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ipaddr); if (unlikely(!__pyx_t_9)) __PYX_ERR(23, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_8); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_addr}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; __pyx_t_4 = 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_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __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; size_t __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", 0); /* "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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ipnet); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__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_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_mstate_global->__pyx_n_u_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyLong_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_mstate_global->__pyx_n_u_prefixlen); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyLong_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_mstate_global->__pyx_n_u_network_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_packed); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 113, __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(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_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 113, __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/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", 0); /* "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; size_t __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", 0); /* "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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ipaddr); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 126, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_obj}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__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_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_mstate_global->__pyx_n_u_version); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 134, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyLong_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_mstate_global->__pyx_n_u_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_6 = __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_6)) __PYX_ERR(23, 135, __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; } __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(((PyObject *)(((PyTypeObject*)PyExc_ValueError)))); if (__pyx_t_11) { __Pyx_AddTraceback("asyncpg.pgproto.pgproto.inet_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(23, 127, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /* "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_t_13 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ipiface); if (unlikely(!__pyx_t_14)) __PYX_ERR(23, 130, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14); assert(__pyx_t_13); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_14, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_obj}; __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__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_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_mstate_global->__pyx_n_u_version); if (unlikely(!__pyx_t_12)) __PYX_ERR(23, 131, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = __Pyx_PyLong_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_mstate_global->__pyx_n_u_network); if (unlikely(!__pyx_t_12)) __PYX_ERR(23, 132, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_prefixlen); if (unlikely(!__pyx_t_14)) __PYX_ERR(23, 132, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_15 = __Pyx_PyLong_As_uint32_t(__pyx_t_14); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(23, 132, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipaddr, __pyx_mstate_global->__pyx_n_u_packed); if (unlikely(!__pyx_t_14)) __PYX_ERR(23, 132, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_14); if (!(likely(PyBytes_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_14))) __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_14)); if (unlikely(!__pyx_t_12)) __PYX_ERR(23, 132, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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", 0); /* "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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned long __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tid_encode", 0); /* "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":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 = NULL; /* "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_6 = __pyx_mstate_global->__pyx_kp_u_list_or_tuple_expected_got_type; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_obj))}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 13, __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(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_8 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(24, 16, __pyx_L1_error) __pyx_t_2 = (__pyx_t_8 != 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_5 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_invalid_number_of_elements_in_ti}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 17, __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(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_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { /* "asyncpg/pgproto/codecs/tid.pyx":21 * * try: * block = cpython.PyLong_AsUnsignedLong(obj[0]) # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 21, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = PyLong_AsUnsignedLong(__pyx_t_3); if (unlikely(__pyx_t_12 == ((unsigned long)-1L) && PyErr_Occurred())) __PYX_ERR(24, 21, __pyx_L7_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_block = __pyx_t_12; /* "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_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_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; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/tid.pyx":22 * try: * block = cpython.PyLong_AsUnsignedLong(obj[0]) * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_OverflowError)))); if (__pyx_t_13) { __Pyx_ErrRestore(0,0,0); /* "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; 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_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_L8_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_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 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_tuple_id_block_value_out_of_uint}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 27, __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(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_11, &__pyx_t_10, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "asyncpg/pgproto/codecs/tid.pyx":30 * * try: * offset = cpython.PyLong_AsUnsignedLong(obj[1]) # <<<<<<<<<<<<<< * overflow = 0 * except OverflowError: */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 30, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = PyLong_AsUnsignedLong(__pyx_t_3); if (unlikely(__pyx_t_12 == ((unsigned long)-1L) && PyErr_Occurred())) __PYX_ERR(24, 30, __pyx_L19_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_offset = __pyx_t_12; /* "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_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/tid.pyx":32 * offset = cpython.PyLong_AsUnsignedLong(obj[1]) * overflow = 0 * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_OverflowError)))); if (__pyx_t_13) { __Pyx_ErrRestore(0,0,0); /* "asyncpg/pgproto/codecs/tid.pyx":33 * overflow = 0 * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * if overflow or offset > 65535: */ __pyx_v_overflow = 1; 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_11); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); goto __pyx_L1_error; __pyx_L20_exception_handled:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9); __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_5 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_tuple_id_offset_value_out_of_uin}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 36, __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(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_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 6); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/tid.pyx":39 * * buf.write_int32(6) * buf.write_int32(block) # <<<<<<<<<<<<<< * buf.write_int16(offset) * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_block)); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/tid.pyx":40 * buf.write_int32(6) * buf.write_int32(block) * buf.write_int16(offset) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_offset)); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_XDECREF(__pyx_t_6); __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", 0); /* "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 == ((void *)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 == ((void *)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_PyLong_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_PyLong_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) != (0)) __PYX_ERR(24, 51, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; Py_ssize_t __pyx_t_8; uint64_t __pyx_t_9; Py_ssize_t __pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; unsigned PY_LONG_LONG __pyx_t_13; int32_t __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pg_snapshot_encode", 0); /* "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":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 = NULL; /* "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_6 = __pyx_mstate_global->__pyx_kp_u_list_or_tuple_expected_got_type; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_obj))}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 17, __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(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_8 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(25, 20, __pyx_L1_error) __pyx_t_3 = (__pyx_t_8 != 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_5 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_invalid_number_of_elements_in_tx}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 21, __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(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_1 = __Pyx_GetItemInt(__pyx_v_obj, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(25, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nxip = __pyx_t_8; /* "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_5 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_txid_snapshot_value_is_too_long}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 26, __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(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_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(25, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_xmin = __pyx_t_9; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":29 * * xmin = obj[0] * xmax = obj[1] # <<<<<<<<<<<<<< * * for i in range(nxip): */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(25, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_xmax = __pyx_t_9; /* "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_10 = __pyx_v_nxip; __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/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_1 = __Pyx_GetItemInt(__pyx_v_obj, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = PyLong_AsUnsignedLongLong(__pyx_t_5); if (unlikely(__pyx_t_13 == ((unsigned PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(25, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_xip_buf, ((int64_t)__pyx_t_13)); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_xip_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_20, __pyx_t_5, 20, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_14 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_14 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(25, 35, __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_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_nxip)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, ((int64_t)__pyx_v_xmin)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, ((int64_t)__pyx_v_xmax)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":40 * buf.write_int64(xmin) * buf.write_int64(xmax) * buf.write_buffer(xip_buf) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_buffer(__pyx_v_buf, __pyx_v_xip_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_XDECREF(__pyx_t_6); __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", 0); /* "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 == ((void *)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 == ((void *)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 == ((void *)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 == ((void *)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_PyLong_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_PyLong_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) != (0)) __PYX_ERR(25, 63, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __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) != (0)) __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)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle___UUIDReplaceMe(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 4, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle___UUIDReplaceMe", 0) < (0)) __PYX_ERR(8, 4, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___UUIDReplaceMe", 1, 3, 3, i); __PYX_ERR(8, 4, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 4, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 4, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 4, __pyx_L3_error) } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(8, 4, __pyx_L3_error) __pyx_v___pyx_state = ((PyObject*)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___UUIDReplaceMe", 1, 3, 3, __pyx_nargs); __PYX_ERR(8, 4, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(8, 4, __pyx_L1_error) __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 */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle___UUIDReplaceMe", 0); /* "(tree fragment)":6 * def __pyx_unpickle___UUIDReplaceMe(__pyx_type, long __pyx_checksum, tuple __pyx_state): * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') # <<<<<<<<<<<<<< * __pyx_result = __UUIDReplaceMe.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, ((char const *)"")); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 6, __pyx_L1_error) /* "(tree fragment)":7 * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') * __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 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v___pyx_result = __pyx_t_2; __pyx_t_2 = 0; /* "(tree fragment)":8 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') * __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None)); if (__pyx_t_5) { /* "(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, __pyx_state: tuple): */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'"); __PYX_ERR(8, 9, __pyx_L1_error) } __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle___UUIDReplaceMe__set_state(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":8 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') * __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, __pyx_state: tuple): * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle___UUIDReplaceMe(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__pyx_unpickle___UUIDReplaceMe", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __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, __pyx_state: tuple): # <<<<<<<<<<<<<< * __Pyx_UpdateUnpickledDict(__pyx_result, __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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle___UUIDReplaceMe__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle___UUIDReplaceMe__set_state(__UUIDReplaceMe __pyx_result, __pyx_state: tuple): * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0) # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 12, __pyx_L1_error) /* "(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, __pyx_state: tuple): # <<<<<<<<<<<<<< * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __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)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle_CodecContext(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 4, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_CodecContext", 0) < (0)) __PYX_ERR(8, 4, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CodecContext", 1, 3, 3, i); __PYX_ERR(8, 4, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 4, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 4, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 4, __pyx_L3_error) } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(8, 4, __pyx_L3_error) __pyx_v___pyx_state = ((PyObject*)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CodecContext", 1, 3, 3, __pyx_nargs); __PYX_ERR(8, 4, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(8, 4, __pyx_L1_error) __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 */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_CodecContext", 0); /* "(tree fragment)":6 * def __pyx_unpickle_CodecContext(__pyx_type, long __pyx_checksum, tuple __pyx_state): * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') # <<<<<<<<<<<<<< * __pyx_result = CodecContext.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, ((char const *)"")); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 6, __pyx_L1_error) /* "(tree fragment)":7 * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') * __pyx_result = CodecContext.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_CodecContext__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v___pyx_result = __pyx_t_2; __pyx_t_2 = 0; /* "(tree fragment)":8 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') * __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None)); if (__pyx_t_5) { /* "(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, __pyx_state: tuple): */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'"); __PYX_ERR(8, 9, __pyx_L1_error) } __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle_CodecContext__set_state(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":8 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') * __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, __pyx_state: tuple): * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle_CodecContext(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__pyx_unpickle_CodecContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __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, __pyx_state: tuple): # <<<<<<<<<<<<<< * __Pyx_UpdateUnpickledDict(__pyx_result, __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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_CodecContext__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_CodecContext__set_state(CodecContext __pyx_result, __pyx_state: tuple): * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0) # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 12, __pyx_L1_error) /* "(tree fragment)":11 * __pyx_unpickle_CodecContext__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CodecContext__set_state(CodecContext __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<< * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __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; } /* #### Code section: module_exttypes ### */ static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer; 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_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_7pgproto_7pgproto_WriteBuffer > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer, sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_7pgproto_7pgproto_WriteBuffer[--__pyx_mstate_global->__pyx_freecount_7asyncpg_7pgproto_7pgproto_WriteBuffer]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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_mstate_global->__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_7pgproto_7pgproto_WriteBuffer < 256) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer, sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_7pgproto_7pgproto_WriteBuffer[__pyx_mstate_global->__pyx_freecount_7asyncpg_7pgproto_7pgproto_WriteBuffer++] = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #endif } } static PyMethodDef __pyx_methods_7asyncpg_7pgproto_7pgproto_WriteBuffer[] = { {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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 = { __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 = { __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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; 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_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_7pgproto_7pgproto_ReadBuffer > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer, sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_7pgproto_7pgproto_ReadBuffer[--__pyx_mstate_global->__pyx_freecount_7asyncpg_7pgproto_7pgproto_ReadBuffer]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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_mstate_global->__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_7pgproto_7pgproto_ReadBuffer < 256) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer, sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_7pgproto_7pgproto_ReadBuffer[__pyx_mstate_global->__pyx_freecount_7asyncpg_7pgproto_7pgproto_ReadBuffer++] = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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; o = __Pyx_AllocateExtensionType(t, 0); if (unlikely(!o)) return 0; 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(__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 PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #endif } static PyMethodDef __pyx_methods_7asyncpg_7pgproto_7pgproto_CodecContext[] = { {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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; o = __Pyx_AllocateExtensionType(t, 0); if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(__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 PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #endif } static PyMethodDef __pyx_methods_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe[] = { {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_mstate_global->__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; #if !CYTHON_USE_MODULE_STATE e = 0; if (likely(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe)) { traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe, tp_traverse, traverseproc); if (traverse) { e = traverse(o, v, a); } } else #endif { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7asyncpg_7pgproto_7pgproto_UUID); } if (e) return e; { e = __Pyx_call_type_traverse(o, 0, v, a); 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 PyMethodDef __pyx_methods_7asyncpg_7pgproto_7pgproto_UUID[] = { {"__reduce__", (PyCFunction)(void(*)(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[] = { {"bytes", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_bytes, 0, 0, 0}, {"int", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_int, 0, 0, 0}, {"is_safe", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_is_safe, 0, 0, 0}, {"hex", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_hex, 0, 0, 0}, {"bytes_le", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_bytes_le, 0, 0, 0}, {"fields", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_fields, 0, 0, 0}, {"time_low", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time_low, 0, 0, 0}, {"time_mid", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time_mid, 0, 0, 0}, {"time_hi_version", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time_hi_version, 0, 0, 0}, {"clock_seq_hi_variant", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_clock_seq_hi_variant, 0, 0, 0}, {"clock_seq_low", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_clock_seq_low, 0, 0, 0}, {"time", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time, 0, 0, 0}, {"clock_seq", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_clock_seq, 0, 0, 0}, {"node", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_node, 0, 0, 0}, {"urn", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_urn, 0, 0, 0}, {"variant", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_variant, 0, 0, 0}, {"version", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_version, 0, 0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyMemberDef __pyx_type_7asyncpg_7pgproto_7pgproto_UUID_members[] = { #if !CYTHON_USE_TYPE_SLOTS {"__weaklistoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID, __weakref__), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 #if defined(__GNUC__) || defined(__clang__) #warning "asyncpg/pgproto/./uuid.pyx:144:15: : __weakref__ is unsupported in the Limited API when running on Python <3.9." #elif defined(_MSC_VER) #pragma message("asyncpg/pgproto/./uuid.pyx:144:15: : __weakref__ is unsupported in the Limited API when running on Python <3.9.") #endif #endif 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__}, {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}, {Py_tp_members, (void*)__pyx_type_7asyncpg_7pgproto_7pgproto_UUID_members}, {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*/ 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*/ __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_25__int__, /*nb_int*/ 0, /*nb_long (reserved)*/ 0, /*nb_float*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 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*/ 0, /*nb_matrix_multiply*/ 0, /*nb_inplace_matrix_multiply*/ }; 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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ __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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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} }; /* #### Code section: initfunc_declarations ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ /* #### Code section: init_module ### */ static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ { __pyx_t_1 = __Pyx_ApiExport_GetApiDict(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); const char * __pyx_export_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_PyObject_struct___pyx_obj_7async); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(!__pyx_export_signature)) __PYX_ERR(0, 1, __pyx_L1_error) #endif const char * __pyx_export_name = __pyx_export_signature + 660; void (*const __pyx_export_pointers[])(void) = {(void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bool_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_box_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_circle_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode_tuple, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float4_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float8_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_inet_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int2_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int4_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode_tuple, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_json_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_line_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_binary, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_text, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_path_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_point_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_poly_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_tid_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode_tuple, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode_tuple, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_void_encode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bool_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_box_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_circle_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode_tuple, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float4_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float8_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_inet_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int2_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int4_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode_tuple, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_json_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_line_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_text, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_path_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_point_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_poly_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_tid_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode_tuple, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode_tuple, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_void_decode, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary_ex, (void (*)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_frb_check, (void (*)(void)) NULL}; void (*const *__pyx_export_pointer)(void) = __pyx_export_pointers; const char *__pyx_export_current_signature = __pyx_export_signature; while (*__pyx_export_pointer) { if (__Pyx_ExportFunction(__pyx_t_1, __pyx_export_name, *__pyx_export_pointer, __pyx_export_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) ++__pyx_export_pointer; __pyx_export_name = strchr(__pyx_export_name, '\0') + 1; __pyx_export_signature = strchr(__pyx_export_signature, '\0') + 1; if (*__pyx_export_signature != '\0') __pyx_export_current_signature = __pyx_export_signature; } __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_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); 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.__pyx_new = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new; #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer)) __PYX_ERR(1, 17, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer->tp_getattro = PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer, __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_WriteBuffer, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) __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 = (int32_t (*)(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_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer)) __PYX_ERR(1, 240, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer_spec, __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) < (0)) __PYX_ERR(1, 240, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) < (0)) __PYX_ERR(1, 240, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer->tp_getattro = PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer, __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer) < (0)) __PYX_ERR(1, 240, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) < (0)) __PYX_ERR(1, 240, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ReadBuffer, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) < (0)) __PYX_ERR(1, 240, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) < (0)) __PYX_ERR(1, 240, __pyx_L1_error) __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_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) __PYX_ERR(9, 8, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext_spec, __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) < (0)) __PYX_ERR(9, 8, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) < (0)) __PYX_ERR(9, 8, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_getattro = PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext) < (0)) __PYX_ERR(9, 8, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) < (0)) __PYX_ERR(9, 8, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CodecContext, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) < (0)) __PYX_ERR(9, 8, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) < (0)) __PYX_ERR(9, 8, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe)) __PYX_ERR(2, 125, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe_spec, __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe) < (0)) __PYX_ERR(2, 125, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe) < (0)) __PYX_ERR(2, 125, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe->tp_getattro = PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_UUIDReplaceMe, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe) < (0)) __PYX_ERR(2, 125, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe) < (0)) __PYX_ERR(2, 125, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)) __PYX_ERR(2, 136, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_7pgproto_7pgproto_UUID_spec, __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID) < (0)) __PYX_ERR(2, 136, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID = &__pyx_type_7asyncpg_7pgproto_7pgproto_UUID; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_base = __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID) < (0)) __PYX_ERR(2, 136, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_getattro = PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_UUID_2, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID) < (0)) __PYX_ERR(2, 136, __pyx_L1_error) #if CYTHON_USE_TYPE_SLOTS if (__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_weaklistoffset = offsetof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID, __weakref__); #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); 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_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_2_1(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API 0, 0, #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__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_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_2_1(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyLongObject), #elif CYTHON_COMPILING_IN_LIMITED_API 0, 0, #else sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyLongObject), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__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, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_2_1(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyComplexObject), #elif CYTHON_COMPILING_IN_LIMITED_API 0, 0, #else sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyComplexObject), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(28, 16, __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(6, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_mstate->__pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType_3_2_1(__pyx_t_1, "datetime", "date", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_Date), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_Date), #else sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_Date), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_date) __PYX_ERR(6, 43, __pyx_L1_error) __pyx_mstate->__pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType_3_2_1(__pyx_t_1, "datetime", "time", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_Time), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_Time), #else sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_Time), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_time) __PYX_ERR(6, 56, __pyx_L1_error) __pyx_mstate->__pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType_3_2_1(__pyx_t_1, "datetime", "datetime", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_DateTime), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_DateTime), #else sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_DateTime), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_datetime) __PYX_ERR(6, 82, __pyx_L1_error) __pyx_mstate->__pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType_3_2_1(__pyx_t_1, "datetime", "timedelta", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_Delta), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_Delta), #else sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_Delta), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_timedelta) __PYX_ERR(6, 120, __pyx_L1_error) __pyx_mstate->__pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType_3_2_1(__pyx_t_1, "datetime", "tzinfo", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_TZInfo), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_TZInfo), #else sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyDateTime_TZInfo), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_tzinfo) __PYX_ERR(6, 133, __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(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #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}, #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING {Py_mod_gil, Py_MOD_GIL_NOT_USED}, #endif #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED}, #endif {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_USE_MODULE_STATE sizeof(__pyx_mstatetype), /* m_size */ #else (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -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 /* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif __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); } /* ModuleCreationPEP489 */ #if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { { PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think if (!module) { PyErr_Clear(); // just try the 3.8-3.12 version module = PyImport_ImportModule("_xxsubinterpreters"); if (!module) goto bad; } PyObject *current = PyObject_CallMethod(module, "get_current", NULL); Py_DECREF(module); if (!current) goto bad; if (PyTuple_Check(current)) { PyObject *new_current = PySequence_GetItem(current, 0); Py_DECREF(current); current = new_current; if (!new_current) goto bad; } long long as_c_int = PyLong_AsLongLong(current); Py_DECREF(current); return as_c_int; } bad: PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); return -1; } #endif #if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { static PY_INT64_T main_interpreter_id = -1; #if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); #elif CYTHON_COMPILING_IN_GRAAL PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); #elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); #elif CYTHON_COMPILING_IN_LIMITED_API PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); #else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); #endif if (unlikely(current_id == -1)) { return -1; } if (main_interpreter_id == -1) { main_interpreter_id = current_id; return 0; } else if (unlikely(main_interpreter_id != current_id)) { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #endif 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) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } 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 !CYTHON_USE_MODULE_STATE if (__Pyx_check_single_interpreter()) return NULL; #endif 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; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; 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 { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif __pyx_mstatetype *__pyx_mstate = 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; PyObject *__pyx_t_6 = NULL; static char __pyx_t_7[256]; int __pyx_t_8; size_t __pyx_t_9; long __pyx_t_10; PyObject *__pyx_t_11 = NULL; 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; } #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_t_1 = __pyx_pyinit_module; Py_INCREF(__pyx_t_1); #else __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #if CYTHON_USE_MODULE_STATE { int add_module_result = __Pyx_State_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(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = __pyx_t_1; #endif #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED); #endif __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_mstate->__pyx_d); __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /* ImportRefnannyAPI */ #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("PyInit_pgproto", 0); __Pyx_init_runtime_version(); 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) __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Library function declarations ---*/ /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error) if (__pyx_module_is_main_asyncpg__pgproto__pgproto) { if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) } { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "asyncpg.pgproto.pgproto")) { if (unlikely((PyDict_SetItemString(modules, "asyncpg.pgproto.pgproto", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(__pyx_mstate); (void)__Pyx_modinit_variable_export_code(__pyx_mstate); if (unlikely((__Pyx_modinit_function_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(__pyx_mstate); (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ /* "asyncpg/pgproto/pgproto.pyx":23 * * from .debug cimport PG_DEBUG * from . import types as pgproto_types # <<<<<<<<<<<<<< * * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_, __pyx_imported_names, 1, __pyx_mstate_global->__pyx_kp_u_asyncpg_pgproto, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) } __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types}; __pyx_t_3 = 0; { __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); switch (__pyx_t_3) { case 0: if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pgproto_types, __pyx_t_4) < (0)) __PYX_ERR(0, 23, __pyx_L1_error) break; default:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":10 * from libc.string cimport memcpy * * import collections # <<<<<<<<<<<<<< * * class BufferError(Exception): */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_collections, __pyx_t_2) < (0)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":12 * import collections * * class BufferError(Exception): # <<<<<<<<<<<<<< * pass * */ __pyx_t_2 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_BufferError, __pyx_mstate_global->__pyx_n_u_BufferError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(1, 12, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BufferError, __pyx_t_4, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_BufferError, __pyx_t_2) < (0)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_11WriteBuffer_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_WriteBuffer___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(8, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_11WriteBuffer_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_WriteBuffer___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(8, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_10ReadBuffer_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ReadBuffer___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(8, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_10ReadBuffer_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ReadBuffer___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(8, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/uuid.pyx":1 * import functools # <<<<<<<<<<<<<< * import uuid * */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_functools, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_functools, __pyx_t_4) < (0)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/uuid.pyx":2 * import functools * import uuid # <<<<<<<<<<<<<< * * cimport cython */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_uuid, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_uuid, __pyx_t_4) < (0)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_7[0] = -1; __pyx_t_7[1] = -1; __pyx_t_7[2] = -1; __pyx_t_7[3] = -1; __pyx_t_7[4] = -1; __pyx_t_7[5] = -1; __pyx_t_7[6] = -1; __pyx_t_7[7] = -1; __pyx_t_7[8] = -1; __pyx_t_7[9] = -1; __pyx_t_7[10] = -1; __pyx_t_7[11] = -1; __pyx_t_7[12] = -1; __pyx_t_7[13] = -1; __pyx_t_7[14] = -1; __pyx_t_7[15] = -1; __pyx_t_7[16] = -1; __pyx_t_7[17] = -1; __pyx_t_7[18] = -1; __pyx_t_7[19] = -1; __pyx_t_7[20] = -1; __pyx_t_7[21] = -1; __pyx_t_7[22] = -1; __pyx_t_7[23] = -1; __pyx_t_7[24] = -1; __pyx_t_7[25] = -1; __pyx_t_7[26] = -1; __pyx_t_7[27] = -1; __pyx_t_7[28] = -1; __pyx_t_7[29] = -1; __pyx_t_7[30] = -1; __pyx_t_7[31] = -1; __pyx_t_7[32] = -1; __pyx_t_7[33] = -1; __pyx_t_7[34] = -1; __pyx_t_7[35] = -1; __pyx_t_7[36] = -1; __pyx_t_7[37] = -1; __pyx_t_7[38] = -1; __pyx_t_7[39] = -1; __pyx_t_7[40] = -1; __pyx_t_7[41] = -1; __pyx_t_7[42] = -1; __pyx_t_7[43] = -1; __pyx_t_7[44] = -1; __pyx_t_7[45] = -1; __pyx_t_7[46] = -1; __pyx_t_7[47] = -1; __pyx_t_7[48] = 0; __pyx_t_7[49] = 1; __pyx_t_7[50] = 2; __pyx_t_7[51] = 3; __pyx_t_7[52] = 4; __pyx_t_7[53] = 5; __pyx_t_7[54] = 6; __pyx_t_7[55] = 7; __pyx_t_7[56] = 8; __pyx_t_7[57] = 9; __pyx_t_7[58] = -1; __pyx_t_7[59] = -1; __pyx_t_7[60] = -1; __pyx_t_7[61] = -1; __pyx_t_7[62] = -1; __pyx_t_7[63] = -1; __pyx_t_7[64] = -1; __pyx_t_7[65] = 10; __pyx_t_7[66] = 11; __pyx_t_7[67] = 12; __pyx_t_7[68] = 13; __pyx_t_7[69] = 14; __pyx_t_7[70] = 15; __pyx_t_7[71] = -1; __pyx_t_7[72] = -1; __pyx_t_7[73] = -1; __pyx_t_7[74] = -1; __pyx_t_7[75] = -1; __pyx_t_7[76] = -1; __pyx_t_7[77] = -1; __pyx_t_7[78] = -1; __pyx_t_7[79] = -1; __pyx_t_7[80] = -1; __pyx_t_7[81] = -1; __pyx_t_7[82] = -1; __pyx_t_7[83] = -1; __pyx_t_7[84] = -1; __pyx_t_7[85] = -1; __pyx_t_7[86] = -1; __pyx_t_7[87] = -1; __pyx_t_7[88] = -1; __pyx_t_7[89] = -1; __pyx_t_7[90] = -1; __pyx_t_7[91] = -1; __pyx_t_7[92] = -1; __pyx_t_7[93] = -1; __pyx_t_7[94] = -1; __pyx_t_7[95] = -1; __pyx_t_7[96] = -1; __pyx_t_7[97] = 10; __pyx_t_7[98] = 11; __pyx_t_7[99] = 12; __pyx_t_7[100] = 13; __pyx_t_7[101] = 14; __pyx_t_7[102] = 15; __pyx_t_7[103] = -1; __pyx_t_7[104] = -1; __pyx_t_7[105] = -1; __pyx_t_7[106] = -1; __pyx_t_7[107] = -1; __pyx_t_7[108] = -1; __pyx_t_7[109] = -1; __pyx_t_7[110] = -1; __pyx_t_7[111] = -1; __pyx_t_7[112] = -1; __pyx_t_7[113] = -1; __pyx_t_7[114] = -1; __pyx_t_7[115] = -1; __pyx_t_7[116] = -1; __pyx_t_7[117] = -1; __pyx_t_7[118] = -1; __pyx_t_7[119] = -1; __pyx_t_7[120] = -1; __pyx_t_7[121] = -1; __pyx_t_7[122] = -1; __pyx_t_7[123] = -1; __pyx_t_7[124] = -1; __pyx_t_7[125] = -1; __pyx_t_7[126] = -1; __pyx_t_7[127] = -1; __pyx_t_7[128] = -1; __pyx_t_7[129] = -1; __pyx_t_7[130] = -1; __pyx_t_7[131] = -1; __pyx_t_7[132] = -1; __pyx_t_7[133] = -1; __pyx_t_7[134] = -1; __pyx_t_7[135] = -1; __pyx_t_7[136] = -1; __pyx_t_7[137] = -1; __pyx_t_7[138] = -1; __pyx_t_7[139] = -1; __pyx_t_7[140] = -1; __pyx_t_7[141] = -1; __pyx_t_7[142] = -1; __pyx_t_7[143] = -1; __pyx_t_7[144] = -1; __pyx_t_7[145] = -1; __pyx_t_7[146] = -1; __pyx_t_7[147] = -1; __pyx_t_7[148] = -1; __pyx_t_7[149] = -1; __pyx_t_7[150] = -1; __pyx_t_7[151] = -1; __pyx_t_7[152] = -1; __pyx_t_7[153] = -1; __pyx_t_7[154] = -1; __pyx_t_7[155] = -1; __pyx_t_7[156] = -1; __pyx_t_7[157] = -1; __pyx_t_7[158] = -1; __pyx_t_7[159] = -1; __pyx_t_7[160] = -1; __pyx_t_7[161] = -1; __pyx_t_7[162] = -1; __pyx_t_7[163] = -1; __pyx_t_7[164] = -1; __pyx_t_7[165] = -1; __pyx_t_7[166] = -1; __pyx_t_7[167] = -1; __pyx_t_7[168] = -1; __pyx_t_7[169] = -1; __pyx_t_7[170] = -1; __pyx_t_7[171] = -1; __pyx_t_7[172] = -1; __pyx_t_7[173] = -1; __pyx_t_7[174] = -1; __pyx_t_7[175] = -1; __pyx_t_7[176] = -1; __pyx_t_7[177] = -1; __pyx_t_7[178] = -1; __pyx_t_7[179] = -1; __pyx_t_7[180] = -1; __pyx_t_7[181] = -1; __pyx_t_7[182] = -1; __pyx_t_7[183] = -1; __pyx_t_7[184] = -1; __pyx_t_7[185] = -1; __pyx_t_7[186] = -1; __pyx_t_7[187] = -1; __pyx_t_7[188] = -1; __pyx_t_7[189] = -1; __pyx_t_7[190] = -1; __pyx_t_7[191] = -1; __pyx_t_7[192] = -1; __pyx_t_7[193] = -1; __pyx_t_7[194] = -1; __pyx_t_7[195] = -1; __pyx_t_7[196] = -1; __pyx_t_7[197] = -1; __pyx_t_7[198] = -1; __pyx_t_7[199] = -1; __pyx_t_7[200] = -1; __pyx_t_7[201] = -1; __pyx_t_7[202] = -1; __pyx_t_7[203] = -1; __pyx_t_7[204] = -1; __pyx_t_7[205] = -1; __pyx_t_7[206] = -1; __pyx_t_7[207] = -1; __pyx_t_7[208] = -1; __pyx_t_7[209] = -1; __pyx_t_7[210] = -1; __pyx_t_7[211] = -1; __pyx_t_7[212] = -1; __pyx_t_7[213] = -1; __pyx_t_7[214] = -1; __pyx_t_7[215] = -1; __pyx_t_7[216] = -1; __pyx_t_7[217] = -1; __pyx_t_7[218] = -1; __pyx_t_7[219] = -1; __pyx_t_7[220] = -1; __pyx_t_7[221] = -1; __pyx_t_7[222] = -1; __pyx_t_7[223] = -1; __pyx_t_7[224] = -1; __pyx_t_7[225] = -1; __pyx_t_7[226] = -1; __pyx_t_7[227] = -1; __pyx_t_7[228] = -1; __pyx_t_7[229] = -1; __pyx_t_7[230] = -1; __pyx_t_7[231] = -1; __pyx_t_7[232] = -1; __pyx_t_7[233] = -1; __pyx_t_7[234] = -1; __pyx_t_7[235] = -1; __pyx_t_7[236] = -1; __pyx_t_7[237] = -1; __pyx_t_7[238] = -1; __pyx_t_7[239] = -1; __pyx_t_7[240] = -1; __pyx_t_7[241] = -1; __pyx_t_7[242] = -1; __pyx_t_7[243] = -1; __pyx_t_7[244] = -1; __pyx_t_7[245] = -1; __pyx_t_7[246] = -1; __pyx_t_7[247] = -1; __pyx_t_7[248] = -1; __pyx_t_7[249] = -1; __pyx_t_7[250] = -1; __pyx_t_7[251] = -1; __pyx_t_7[252] = -1; __pyx_t_7[253] = -1; __pyx_t_7[254] = -1; __pyx_t_7[255] = -1; memcpy(&(__pyx_v_7asyncpg_7pgproto_7pgproto__hextable[0]), __pyx_t_7, sizeof(__pyx_v_7asyncpg_7pgproto_7pgproto__hextable[0]) * (256)); /* "asyncpg/pgproto/uuid.pyx":75 * * * std_UUID = uuid.UUID # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_uuid); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UUID_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_std_UUID, __pyx_t_5) < (0)) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_UUIDReplaceMe___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < (0)) __PYX_ERR(8, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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) */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_UUIDReplaceMe___setstate_cytho, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < (0)) __PYX_ERR(8, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/uuid.pyx":202 * return f"UUID('{self}')" * * def __reduce__(self): # <<<<<<<<<<<<<< * return (type(self), (self.bytes,)) * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_4UUID_9__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_UUID___reduce, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_5) < (0)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/uuid.pyx":350 * # 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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID), __pyx_mstate_global->__pyx_n_u_bases); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = (__pyx_t_4 == ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe)); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_8)) { __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0); __PYX_ERR(2, 350, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(2, 350, __pyx_L1_error) #endif /* "asyncpg/pgproto/uuid.pyx":351 * # * 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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID), __pyx_mstate_global->__pyx_n_u_mro); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (__pyx_t_5 == ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe)); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_8)) { __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0); __PYX_ERR(2, 351, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(2, 351, __pyx_L1_error) #endif /* "asyncpg/pgproto/uuid.pyx":352 * 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_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_std_UUID); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); Py_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/uuid.pyx":353 * 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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID), __pyx_mstate_global->__pyx_n_u_bases); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_std_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/uuid.pyx":354 * 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_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_std_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); Py_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/uuid.pyx":355 * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID), __pyx_mstate_global->__pyx_n_u_mro); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_std_UUID); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/uuid.pyx":359 * * * pg_UUID = UUID # <<<<<<<<<<<<<< */ if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pg_UUID, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)) < (0)) __PYX_ERR(2, 359, __pyx_L1_error) /* "asyncpg/pgproto/codecs/context.pyx":10 * cdef class CodecContext: * * cpdef get_text_codec(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_1get_text_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CodecContext_get_text_codec, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_mstate_global->__pyx_n_u_get_text_codec, __pyx_t_5) < (0)) __PYX_ERR(9, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/context.pyx":16 * raise NotImplementedError * * cpdef get_json_decoder(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_3get_json_decoder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CodecContext_get_json_decoder, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_mstate_global->__pyx_n_u_get_json_decoder, __pyx_t_5) < (0)) __PYX_ERR(9, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/context.pyx":22 * return False * * cpdef get_json_encoder(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_5get_json_encoder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CodecContext_get_json_encoder, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_mstate_global->__pyx_n_u_get_json_encoder, __pyx_t_5) < (0)) __PYX_ERR(9, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CodecContext___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < (0)) __PYX_ERR(8, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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) */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CodecContext___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < (0)) __PYX_ERR(8, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":9 * * cimport cpython.datetime * import datetime # <<<<<<<<<<<<<< * * cpython.datetime.import_datetime() */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_datetime, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 9, __pyx_L1_error) __pyx_t_5 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_datetime, __pyx_t_5) < (0)) __PYX_ERR(12, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_utc); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_utc, __pyx_t_5) < (0)) __PYX_ERR(12, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":14 * * utc = datetime.timezone.utc * date_from_ordinal = datetime.date.fromordinal # <<<<<<<<<<<<<< * timedelta = datetime.timedelta * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fromordinal); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_date_from_ordinal, __pyx_t_5) < (0)) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_timedelta, __pyx_t_4) < (0)) __PYX_ERR(12, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 17, __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_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pg_epoch_datetime, __pyx_t_4) < (0)) __PYX_ERR(12, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pg_epoch_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_pg_epoch_datetime_ts = ((int32_t)__pyx_t_10); /* "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_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 21, __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(12, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_utc); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_tzinfo, __pyx_t_5) < (0)) __PYX_ERR(12, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2], __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 21, __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_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pg_epoch_datetime_utc, __pyx_t_5) < (0)) __PYX_ERR(12, 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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pg_epoch_datetime_utc); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = PyLong_AsLong(__pyx_t_6); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_pg_epoch_datetime_utc_ts = ((int32_t)__pyx_t_10); /* "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_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pg_epoch_date, __pyx_t_6) < (0)) __PYX_ERR(12, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pg_epoch_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_toordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_10 = PyLong_AsLong(__pyx_t_6); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_offset_ord = ((int32_t)__pyx_t_10); /* "asyncpg/pgproto/codecs/datetime.pyx":35 * cdef const int32_t pg_date_negative_infinity = 0x80000000 * * infinity_datetime = datetime.datetime( # <<<<<<<<<<<<<< * datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) * */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MAXYEAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[8] = {__pyx_t_4, __pyx_t_11, __pyx_mstate_global->__pyx_int_12, __pyx_mstate_global->__pyx_int_31, __pyx_mstate_global->__pyx_int_23, __pyx_mstate_global->__pyx_int_59, __pyx_mstate_global->__pyx_int_59, __pyx_mstate_global->__pyx_int_999999}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (8-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_infinity_datetime, __pyx_t_6) < (0)) __PYX_ERR(12, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_infinity_datetime); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_toordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } /* "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_10 = PyLong_AsLong(__pyx_t_6); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_datetime_ord = ((int32_t)__pyx_t_10); /* "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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __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_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MINYEAR); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[8] = {__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (8-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_negative_infinity_datetime, __pyx_t_6) < (0)) __PYX_ERR(12, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_t_11 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_negative_infinity_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_toordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } /* "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_10 = PyLong_AsLong(__pyx_t_6); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_datetime_ord = ((int32_t)__pyx_t_10); /* "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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MAXYEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_int_12, __pyx_mstate_global->__pyx_int_31}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_infinity_date, __pyx_t_6) < (0)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_infinity_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_toordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } /* "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_10 = PyLong_AsLong(__pyx_t_6); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_date_ord = ((int32_t)__pyx_t_10); /* "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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MINYEAR); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_11, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_negative_infinity_date, __pyx_t_6) < (0)) __PYX_ERR(12, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":59 * * cdef int32_t negative_infinity_date_ord = cpython.PyLong_AsLong( * negative_infinity_date.toordinal()) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_negative_infinity_date); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_toordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } /* "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_10 = PyLong_AsLong(__pyx_t_6); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_date_ord = ((int32_t)__pyx_t_10); /* "asyncpg/pgproto/codecs/numeric.pyx":11 * from libc.stdio cimport snprintf * * import decimal # <<<<<<<<<<<<<< * * # defined in postgresql/src/backend/utils/adt/numeric.c */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_decimal, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 11, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_decimal, __pyx_t_6) < (0)) __PYX_ERR(18, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":22 * DEF NUMERIC_NINF = 0xF000 * * _Dec = decimal.Decimal # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_decimal); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ipaddress, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 8, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_ipaddress); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ip_address); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ipaddr, __pyx_t_6) < (0)) __PYX_ERR(23, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/network.pyx":18 * * _ipaddr = ipaddress.ip_address * _ipiface = ipaddress.ip_interface # <<<<<<<<<<<<<< * _ipnet = ipaddress.ip_network * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ipaddress); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ip_interface); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_ipaddress); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ip_network); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ipnet, __pyx_t_6) < (0)) __PYX_ERR(23, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "(tree fragment)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle___UUIDReplaceMe(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'') */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_1__pyx_unpickle___UUIDReplaceMe, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle___UUIDReplaceMe, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle___UUIDReplaceMe, __pyx_t_6) < (0)) __PYX_ERR(8, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "(tree fragment)":1 * cdef extern from *: # <<<<<<<<<<<<<< * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 */ __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_3__pyx_unpickle_CodecContext, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CodecContext, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_pgproto_pgproto, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CodecContext, __pyx_t_6) < (0)) __PYX_ERR(8, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/pgproto.pyx":1 * # Copyright (C) 2016-present the asyncpg authors and contributors # <<<<<<<<<<<<<< * # * # */ __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_6) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); if (__pyx_m) { if (__pyx_mstate->__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; #else return __pyx_m; #endif } /* #### Code section: pystring_table ### */ /* #### Code section: cached_builtins ### */ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(1, 807, __pyx_L1_error) __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(2, 210, __pyx_L1_error) /* Cached unbound methods */ __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type; __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values; return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = ('False',) # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, None), state */ __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(8, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); /* "asyncpg/pgproto/uuid.pyx":263 * 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_mstate_global->__pyx_slice[0] = PySlice_New(__pyx_mstate_global->__pyx_int_3, Py_None, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(2, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); __pyx_mstate_global->__pyx_slice[1] = PySlice_New(__pyx_mstate_global->__pyx_int_5, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(2, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]); __pyx_mstate_global->__pyx_slice[2] = PySlice_New(__pyx_mstate_global->__pyx_int_7, __pyx_mstate_global->__pyx_int_5, __pyx_mstate_global->__pyx_int_neg_1); if (unlikely(!__pyx_mstate_global->__pyx_slice[2])) __PYX_ERR(2, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]); /* "asyncpg/pgproto/uuid.pyx":264 * bytes = self.bytes * return (bytes[4-1::-1] + bytes[6-1:4-1:-1] + bytes[8-1:6-1:-1] + * bytes[8:]) # <<<<<<<<<<<<<< * * @property */ __pyx_mstate_global->__pyx_slice[3] = PySlice_New(__pyx_mstate_global->__pyx_int_8, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[3])) __PYX_ERR(2, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]); /* "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_mstate_global->__pyx_tuple[1] = PyTuple_New(1 * 4); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(18, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 4; __pyx_temp++) { __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[1], __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(18, 110, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); /* "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_mstate_global->__pyx_tuple[2] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_2000, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(12, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); #if CYTHON_IMMORTAL_CONSTANTS { PyObject **table = __pyx_mstate->__pyx_tuple; for (Py_ssize_t i=0; i<3; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); #else Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); #endif } } #endif #if CYTHON_IMMORTAL_CONSTANTS { PyObject **table = __pyx_mstate->__pyx_slice; for (Py_ssize_t i=0; i<4; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); #else Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); #endif } } #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { const struct { const unsigned int length: 11; } index[] = {{0},{3},{28},{45},{9},{179},{6},{2},{1},{1},{35},{36},{8},{16},{34},{24},{18},{15},{43},{63},{63},{71},{36},{43},{73},{56},{47},{56},{42},{43},{31},{31},{7},{45},{12},{18},{6},{32},{49},{33},{64},{20},{45},{47},{2},{25},{39},{61},{13},{40},{36},{36},{43},{52},{62},{9},{48},{36},{46},{50},{21},{21},{32},{32},{36},{19},{22},{30},{72},{11},{19},{15},{14},{31},{56},{58},{61},{40},{41},{31},{42},{27},{23},{30},{9},{26},{24},{24},{24},{25},{25},{0},{9},{3},{11},{6},{12},{30},{32},{29},{29},{27},{4},{7},{1},{5},{8},{4},{11},{7},{7},{1},{3},{14},{4},{5},{7},{20},{15},{18},{12},{8},{10},{28},{30},{8},{15},{33},{35},{4},{15},{11},{29},{31},{7},{6},{8},{10},{18},{23},{9},{3},{5},{4},{17},{18},{20},{13},{11},{4},{17},{8},{3},{4},{7},{6},{5},{8},{5},{6},{7},{6},{8},{4},{6},{10},{9},{11},{8},{9},{16},{16},{14},{12},{4},{4},{13},{17},{3},{3},{7},{10},{12},{10},{7},{9},{8},{6},{9},{13},{5},{7},{8},{13},{11},{12},{6},{7},{10},{5},{7},{15},{1},{8},{22},{26},{7},{15},{7},{4},{3},{6},{7},{13},{17},{21},{13},{3},{7},{9},{11},{5},{12},{14},{12},{11},{10},{27},{30},{14},{12},{10},{17},{13},{7},{6},{7},{4},{12},{10},{12},{19},{4},{5},{8},{8},{4},{15},{8},{8},{9},{9},{8},{9},{5},{6},{7},{6},{12},{3},{9},{4},{6},{7},{7},{4},{0},{1898},{1},{11},{15},{89},{89},{7},{9},{11},{57},{55}}; #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (2543 bytes) */ const char* const cstring = "(\265/\375`\004\033-O\000\312d\314\022@ \223\322\001\000\034\265\300\001j\202\001%\242F[\020\020\016R\334\217Mbe\022\331vJk\213\211\354\235\244\224l\210P\247V\334'\332W\213\020~\243q\374\361\256\301C\263\24633[\236%\373\003\004\001\003\001\023\001\262\027F\237\371R*\345V\354\247%\237)~KE\205PJf\337\333\356q\034\267\232\315\374\233\241V\354z\231\005\266\217\271\247\033\343\3128\325\016\231O\2502\3549\364xN\322eq\236\264\337\322\355sw\341\002\307\337\243EY\034\312r}I\335\367n\357i\310Yt\235 \003\006{\247$\260\267\221g\314F]\350\036b\372\2013adD\202JK\212\024\234\225PYV\206\337m\344\307FZ;\277\276w\353\010\373\225\254W\252\305\374\331\333m6\375bS\013\343\310\265\256g\315\017yr&WJ\205.4%\223\357\326\305F\366Z\231\311\006\023\022\227\025\027\326q\337q|\311.\270\257qC\014\3671\311\254]\364W\n{\025=\333\367\317\365\334\265\217\372\001\255\322\346\370\275\255y\024}/\234\317\367gs%=:\326\337\205\355\255t\350\232\344u:5\253\265o\266\232\033\3776\307\351\242F5\t\335\337\365\234Z{\315\371k\355=yA\365Vy\234\332\276>\351\026Bw\337\312Qe\032\213Z\214\203q\032Z\247\361[s\253\366\371\227j\255Q,Wj\2505\271\315?=\272""\3438\267\277\220\332\244\276^\313zO\3679\256h[b\235BkA\255\355\244/%%\035\223\226\302\002zI\371\240`1\361b\002\224\322Rb\005\224\002E\n\226\246\262\242\002\264\362\262\002\232\026\364i\357X\205t\271\264\346\362\315\356\"zuykU-\357\237\217~>\237\226\022 \224\225\026,PJP\373\262\315$X\334\2524\327z\367\265\366\372\362W\266\3468))\013]\344\224\3501\256\220\034\304\3133\010\223\023u8y<\035g\273t\361Z\201\370\230x\021\021\037\273fF)\234\030H\245%\345\244\363+\247\245Z#+\311\360\315\363\247\007\235\231\001 7(8\332\306\214\032\255\341|\324\304\324 \321t\350\314\014\000\271y\001\345\370\334P)\311\221\300\246C\243\241\024\243#\241\306\207\322\002\220\033\320\211\034078\330\030`\203\201\345\210\241\201\000\242\343\203\006\212\315Ts\242\206\344D\251\302\214\000\2351\200\322\301\021\342\306\003\033#6\tlP\324\220\304\350P\034\243\033#l\254\260A\261\001\261\301p \307\201\220\233\230\017\032\007!:bJ\rBnDJ\nBnN\3200\240Y)\255\230\221\241\021\000\344FkX\240a)uJ!f\010\200\334\240\314\024\000\340\021\262\343\203F\202\032(hX\224PJ %\004!7(4\022\330\234\324\210\324P\000\271\371\240\341\021\212\223\007i\333>\227\231\363\305o\365\370\202\315\356qEm\016Q+C&%\277\301\304CI\320]>\207<\332kmM\3527\203X\336cB\333\027,e\243\300\230\005\rMC\233\361\245\004\n&.\227\250{\311\225\323\232\r\323\323\247\346\027\357\257\017\367=\256\332Y\306m\255\275\227M\261\234\340J\322B\2351-\244/\263\020\306\261\325\023\316jJ\030\267\242\326\330RgmT\353\247\205\226[\356g\0239\267\226\262\336Z#\357}>\n\202\177\250\"d\226sL\251\021\021\221$I\322\032\342\030\206\207\3040\214{\314\007\002\2014\014\225\224AF\022cDFd$\020\t$\210\222\024$\005Ic@\020p\003\262\311\217W\346\374\013MeZ\253\"\nN\tP\377p\246\255T\342h^\322\010\242q)\211\303\225;\000\317[\303(\020V\232-F\200$\375\027\026\243\2638#\201+\374\"\001\215\317\354:\324\263J@9\251\030\030YgYf\211\007\tL\341Bc\336l\353\002\323\236\310w3\200\243\024\275\305A\211\002\024\236\360\024~HA\311\346\200\020\266k)\265\024\377x\200z\000\274\273\274\273\3431DB\334\260]\355\323""\240dLC\260\205U\256\237\317\347\0021\270\261\206\241F\376\343V\335\016\217d\367\rv\262f\364\027\244\036Xx!\034\240\017t\347B\014\2313\350d\341\240fs\201oP,\240\264@\326\332\357O\325\036\316\254j\363\201\323\005r[\270\321\027\344\310K\242\200\030\241\350_\265\035\t \270\224\016\326]K_\261\037\003a\022\037\256\326T\202\000\274(\313%\t\000\347\2215\020Bi\223V\306;'K\216\324\002@\244\031\245:\364\210\330gGQ\253w\275\210-Z\370\373>\305\332\203\354\271\215\027\035\030\016\033H\266\252?E\200\233\336\252v\377~\023\034)\376\035\202\0354\264\2017?>d\254M\271\314\341\215O\270}\211\007\251\006\305c\316\023Sw\266\310f\237\373\036\\%\276\350\177\016]\260\014B\016t9a\223\354U\013\345\373\007\234\014\214+:$[I\016\223\361\261\016t\255\032\261o\017\352\203\220\237\323\207w\321\252!\022,L\317`\022-\t;X\362\323\000\321CN\216w\236\0041\272[\234\240\302\020\014\235\337\314\312\324(\361\201;\0240\235\"\346D\245\240\201\340e\315\300\020J\270\363\2400y\022\367\323\r\034\034\364\026\214\215>\017*!f\221\020%\201\247^\214Js\242\360\327d\370\0327As\341\371\334\275\226+v\313\202wxAN/\r\316\260E\3041$\023\273\311u\244\345\372%\230\033\323\2568\220\026\264\313\"\242\354pX\207\312\336\250\022\240L\345\274\323\223XV)\362R\314\262\003$J\311\374\351\374.\374\343\210r)\363\205\030' xg\315\227\006\234\205`\246PS%\201r\256\206\222\033\246M\021%q\177\032\311\346\n\212\001\007\322\350\367\022\247\356E\205\\\227l\246\tX\252z\032U\202\206y\212\374\3550\003\260t\035\001\202\233\213\311\014A\" \356I\327K/Qy\206E*\375\304\376\027\257\273\207\370g\364\303e\353)\272\004/Y\260#\222\336\262\006<\\\302\001\207\323)\266K\261\177\274\340m\r\251\270\314\323xHj\2478k\030\324\200\2424\024Xy}=\300\215\201\" \333|-\330\300\207\257\r\250\360XQ\2058{i\241\261R\263b\353$\237\370\351t\274\030W\215&\000h\037\370\244F9\324\305B\331\311\026\357j\311\301\3619\"\311\2575\241d\023(k?\250QO\\=\005U\223~\225\353A1\353\354\006~\205\354\022\250\037y\254\226N:\204\323sg\254=\034\252P\371+\272\326!|i$I\014F\\1\231-,\263\344E\310\224Qjz)""\305\316p\333\346#Q\004\020/\321\033\032:\302\273@\027\014\264b\363X\301w\353D\226%=\203\3346\220\230\304car.\320#\027B<\r\305\202\006\252E\007\0223n\027\\^\377\206\203\336\206\005O,\255Bn\020\020\225Qc\200\243} y\300\200\031\212\270\036\004\014\314'\261o\277\024\026\343\035\230(\215\220L\365\237\224p\353\241\004\333\330\\jA.x\365\316+\254\255\261\3024\211\300C.\234\260\352\214xs\004\037\031\333\210\233u[(\344x\307T\004 \302ph\002\026\030u\370\376(\030\244\354h\226\340\200\264\213\317\221\026%\220\351\004\216dU\335\200\232\235\240@`\331\020\226+KPE\202)\342I\266\244\254r\370\014\226\326\316\242\321\262\017\364\331\340z\206C$\274\022\016@h\315z\363\350\251\271\267\227\214\344J%\372\360\350\273\244,\250\305\332\007\3122;7\212\007\037P\212U\350\247\301\327N\025\361'\307\345\\\366\233\306\013\310d&OB0O\346\336\021D\367\352\321\352\334\351\035\217v\342\230\242\351Y\244\221\245\255zh+\n\303\367/:\301\271\317\010\266?y\2515\341\224\026!\033\335\362\372\313\215\362\256\325S\023\246\305J,\250b\022)\340\"8\177\316\367\373\336\320\026p\263\326n\256\243\332\327(\345ORD\006@8\214\344T\205].X\236A\246\235\010%2/d\222\354\0067\033\032?}0b\232U\201\361\225\013\270\273A\351\3419\010\256\300\240\002\r\005\232~f\225\236\344\334\306\322\3649\315K\"\210\276\311Q\264\240\177\271\035\005\342#\253\003\343\251|X\017\327\372\010\231h\005"; PyObject *data = __Pyx_DecompressString(cstring, 2543, 3); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (2813 bytes) */ const char* const cstring = "BZh91AY&SY\207\304\265.\000\001\212\377\377\346\337\374\310\362\377\375\335\277\277\377\340\277\377\377\376\300@@@@@@@@@@@@\000@\000`\014\306\344\343\236\316\201\"\211\250\2500\243 a\362ph\022\333(\371\327\372\257\274\375\370\272D\366\263\n\034\3734\322\316\033\325\304\343\230\264\307r<\241c\234\241R\303X\016\230B\022\202\362J\271\202\0205\014c(,\204I\036\313\004P\230eJ\222\265\311\232\265\240\0250k\032V\216\260\004\230\337\345\257\217?\006\334=,\263\323-u{V\306{a|p\354Y\0337g|\2129\273$plJ/E\010\302\221\247-+X#\003S\201\020D\344\222\222\361\246\032R\350\024\0130k\3064r\241l2f\250\343\234\"\335\033\222\332\232F\022\371\032w\323H\267\261\315w@\254\303e\014\n\225\311\364I\310\203\230\275\337\\\242\373\235\017A\007\241\205C\221\037\333_%\2032\375\"\236\317\177\323\216\273\360&\"\027@`\324\2645\220\364\233\004\341\230a\"B-\035\246\244\003\246 \273\226|:hR\324\263\001\253N\274\362B[\230\320\341P\030\365\253\\\346\346\026\235:\032\255\n\215nt\222\271_\251\030\363Q%\206\346*td\353\357\n\360;\to\237\252t\346IqU\307\027\314\275JrS+T\317\261L1\217$\334P?y\371lX\2121\210$N\254`Z\260H\251IH\021l)\3140\026\271\\y\223\301\"\374\204h\270\000\375\000U8{\345rX|\326K\327{J\025\3775\016\363$\302C\200\247\343\225.3\226eD\257\230\036\264X\014\004x \224\262\204\311?\021\0168\203\310\204\300\230U\242\022e\242\240=]\273[q\326G\322\224\031\025\311R\200\263\304#\300W\024WD\376\235\227\315lL\203\003\234\374Q5Q\305!\202#HD\277\300\326\242\250\237\200\311L\001\304\227%\316s\004\020=\013\216u5\322\324\350\304\346\370\327}\3154\2572\332\2740\347\300\360\340\265\301\025;\037\344\230i\342\372\326\232\354\025\302\224\243\036\252\264h\227v\252\273Q\327\032\000\247\"\022\273\262\320\320\266d\330\225h3#\204\210\312\274)\005<\210\374~G\3543&\014l\370\2602\234MC\317\305\305<:EU\304\276\316k\225\233\247\317\216\210\014\372\231\357\365\310q\200q\t?\000yko\277\362\227\272Hk,\200\364\254s\234\266\334\n\013\3675\2274\3101\305\255jo\311\034\013jR\353\237\217J\\0]\236\317G\342\003\217\212;\214\322\340\003K\261\220\320+i\030\224\033]n\244\226\312\024\014:\2363^t\204r\312@\225\222\343\034\026e#C\254\211\237 Z\203c\016m\006c$`K\276Q\222\262\025\364\211E\021\277\214P\255\374K\316\332\206\310\030Q\\0'_\324\307\211\303Da\245\t\311bX\232T\364\313h\227c\237.U\222\252\252\210\252\252\252\210\252\252\212\252\252\242*\"\252\202(\252\252\254\216\t\2216\333)\363m(\273\"\330|7\005}\014\000\334\006B`\236\252\020U\327\001\020\212\215\252B\253\007!\004\023\001,\2268\207\010\212\366E\004\352\246\244Py,\0368l\017\225U*Gc_\005\276\316h;\022B>\251\204,\260\020\030\2601d\024O\213\306[\005\254T\245w\010\273-5\267\020\323aYM\020a\224\327\334\304\264\030\003\032\004\333l`\306/S\016\260bG}E\257\031$\247\243\265Q\226\366c7\030\025\254\326J\004\330\255:\030\257SG\342\351\372\345\314\025\236!\205\270T\037\262\223w\005""\343\r\035)\244\351\2056W\253c\033x<2\264\272E)Iu\210\t\340RM9\030\202\234\013\213\356!\207\332\317\321X\3223\305\n\314\344@G1\200-QB>t\034\222\014\264\227\222=l\370Y\225\210\360!@\334g\214\3623\217\2134\021\267]3\342_\233\n#\264(\256\330\325\315)\217\256\264\211rB\301\344\200\036e\224\363!A\016\230\024L}\323\301\001t\300hep:c\245\003h\300\341\347+a\217(\013\351\021\330\023E\300\274\235\242<\323X\014TCcR\372\262\216\206 O\220\330\321\325c\003\251\013\223\227\303\204\035Z\256\246\354\315\000\351\000=\363\265g%\211P\206a\027\276l\243E\213;C\023|d&\241{\022\212i\261\271'6\272\310)\301\013\336\321\333\231\360\211}\353r\323|\363\251\352\247T\205\310\022\310\215x\212\352\351\236\300a\322\223]\372\027/(\370\360H\325\256\241\251\004 v MF\332Y\"x\220\230\323\366\350\341\274\312\245\221s\027\3526\017\3004\255\250\220\305\017c\274h<\023I\203CO\313B\0228\204F\025\3541\363>\013r;\330\035lx\036\276\342\266\r\032w\355=\021\021\021\3528\206S\027\327ON\206\376\027\307\024f\2005I:\363\272\305r\374\207%\201\330m\027\360~\331\002\231w\306\355k\307Qe\305\276OR!\303l\210\206\372c\303)\"\326\006\267<\342\330\257\247M\216\206N\266\225\366\354o\307e\232\026XU}\276\235\177\017n\241~\036A\360\030\026\025B\332\256J\242W\351\300lg\026r\273c\016\352A9\270\372\212\243fw1\262\021\336\216\030\243\000\245J\2105iS\332Ol\230\327\005\352e\211\3316\031m\347iEjh\227#:\350*h\320pF:``\207\245\035\214K\342\262\326\240.P\357H\260E\240\302l\215\315\325\225\250\214S\tM-\034`\273\032&@\320\250\230\323\t\003&\224w;\347|(e\023T{i\022&W\031\261\212\251.\312G\020\334\266\300\220\207\243A\023\030L%.\010\\(d\022\252ik\372\340\020\230)\245(\233\254\211\241\345\364\343Z\3250\354\213v\332\317\024q.\222\301\246\307\220\014\213\004@\025\205D\251|!\3027\ryB\245L\335\326&N#w\001A@\201\261g\016\005 \245\220\241\022\3603\026\350\357\262\014?g\320\265r\206\321\n\020@\350\322\016\215\276\210\311\031\033O4\327jHG\222CFm#\322`\222\217Q\364\\\340\250\341N\241K/oL\202\010`w\013\223,\213\036\274\223\307\212)\356x+\3346@\331\264\234""\301|\t\232\036f!\246\0359\341-uF\013B\230\034w9\266&\316p6\227\311\004\303\250\221\351\203\036v8\201a\230\226\037\253sNl\031\305\2367/\252\334U\272\324\315D\005\264\251\020$\327\350\217\226\364M3T\001\217\347S*\322e\024*\010/.e\250\265\017\035\326\376\2151\354\363\370;\014D\213\006\250-L\330\226\346\244\265\366;\376\2238\313(\265c\230\010T`X\222\267\2512\nD\314N\223\304\363F\240:z~.\275U1V\"\0243\272\350\313\263\"\3473v\014\352\2603\"\222]\021C41\214\016\006\255\030M\276\260\247\000-\332l\036||L\304\214\r4>\246\271)Z\001(\205_\344\tU^.\301\022\246d\225 3\334\363\3224\302\007\302\362;\224 \314\230@R\007\333\347\036\303~\335\250\372:\230\343\332A\235\316\224K\253\214\213\366\2059\230\303.i!\207\322\221\337\013F\333b\n\301\0258\342\270Q\007,\215\314\032%\320\277\330\013Y\266R?\357\350\n\r\321\227\216\370\010\272\027\254\357\0261\rOY\003\246\322v'\213\025Le\023Z\260\034\024`\366\204\253\226B\204d\306\306\301\261\261\221I\"\265X\224%\345W\214\030\336\26333!\310k${\367\2368\241\031e\227\005Kj\373\363\301\360\006\205*j\225\230^\261\020Z\3560u*\306\211\025Z8\325!\224\004\316\362'\003\266\032\210%\206\250\377\306\256\221^Ss\201\3642\001\343\345\007{U\250f\315Xm\341\317\221}\322\270\340\210f\251j\230s\022\030*W\020\361a\243\301\237q\237\224\300\225\316\361\n\340gq\031\013jBS\026h\227\305\030\t\311_8\215\235,6g\307\360\375\356\372\035\020u\003!(j\254\033>a|\310\0306\230Y\230\235Q\034\027p\331|w\356L\351\223p\2300$\341\266+M\310\267\210\205C\266\335'\243\003\2565\271C\337\374\333\231\365E\222\324U\272\201\215-\336\\\273\303Br\237-\n|fX\030b(\200\210s\037,c8\313 `\023a\321\002=\334O\032\203;\232\217\235\215&\020RJSz\233!k\215@\267\200\007\332\355\021\236}D\030\013\202x\231#\371\323\021\314\352Z$*$y\252]\347\375s\2607\244\327#\357\3707\r\303\030\335\336\337,\034g\350\333\313*\226+~\214\207x\3317L\207\277\370k\360o\362\033\027\274\034\233f\302ys\364=\301\367\204\267|\331\230\224\370\227\313\306_\351\271\3762\232\035\337>@\224\253\3527\262\222\013\032\330\334S\204h\312\002\312]""\007\017>\3200\377\027rE8P\220\207\304\265."; PyObject *data = __Pyx_DecompressString(cstring, 2813, 2); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2605 bytes) */ const char* const cstring = "x\332\325X;o\034\311\021\246\000\032&|\266\317\262\r\330\200\0037/\321\303\344\236H\021\222@\037|\240\3708\320\266(j)Y\347\250\321;\323\263\333\307\331\351\341\277\231D*Q\305`K\027\222\025=Q\260\325A\321\323\tS9\013e\254:2\023\205\214\007,/2\205E2bJ\330\366\372\366\374\322\203%&\222\220e\362;,\237\263\274\354\004\261\310s\250\245#\254\254b\250\300\212A*\363\026\333\214\330@\227,\221X\277\320,\005_}B\321\223\t\313eA\004\273!\222D\027\330\200N8\246c\0377X\2502,\242\366%\315\336\020q.[\317\236m\256\335\274q\343V\353k\301:Z\307R\030\2553\271W\2029d7\311\032\264<;zyK8\203\351\214v\302t\207t\036\261\234\010C\216\205\245\310\007I\220v[i7\315t\241[\256\375\245k\177\031\350P\0069^I!\017\213V:8\034\345(K\025R\177G\025l_\304%i\255Y\254\223\256s\210\336\227Y&E\030\230\255\302\322$\223\321\216\346*\245\230\367\262\325\316\261\312\304\260\256\311@\365E\354\244\253\004VI\312\276\204\217\226I\200NdR\2205h\335\034\214\361\247O\217E\326\225\037?\035D\207v\030\301g]\005\\L\020\223\226\005P\230\347\242+1A{\232\025b\027+X\236\274\020Y\301\375H\004\307\t\260&\363\262\237\026\003\007l\270 \307\272<*\343\330\263\346\260T\034\303|\000\261\250\007\200\306\242\202\005\272\237\306\022`\217T\226WZ|\277\240\024\332(\264\007\214\374\366Q\363l\324\261\203\014~g}Bb((\312J(\340,\231-;wS\260.0\031\313\276\261|b\271\254\347\217^\206\262Sv\227\235\312\036B\021kC\223\207\266\005#\033\3038\316\2344\013\257f]v\260#\367\260\030\272\333\320\366\250k\014#a\310\346p\250r\321\211\345\354\354,\374\234\007\"\013i\013\336]G\263\331KV&\306T\330\264X6=u\327Y\272\276#\231\220@\231\204\274\202F\247\322\270\302qm\234B\002\316\201K:\262a\363\006t\032\002\375\314:&\253x\023\244\252,T_\266\214\243\000\271F\007\021p\r\244'\201w\r\355\312\317Gb""\361\016\213\204\212m\2463&@<\031\253Y(\215\2428BR\344\326J\2654E\204\31021\030MV\335\240\227\027\344\017\027}\265\255@9HT\201\"\020\221DB\222]d\331$F\231\223\242\010X\231a\366\345P\274\353\241\230\217aQ%\230\251B\223\254X\243qT\302\032\313p{e\221\240'2A\247\206\347C\212\315\010i\221\350+\370\r\262\2778z\371\205\335\311(\017\\\335\2053'\362$\2628\320\331.K3\031\251\303\253Y\253|\324\330\022F\334\266\206\273^\374\2369\207*\344y\"\322\274G'\313\350\354%\225[\010\207\313^\241~I\350\206\357\241.\200\310\356.\266Zw\357\r\315\342R{\254\300\006\227;wx\3535\016\260Dv\2059\377\234h\233\020\321\230\2676\000\277\205\216\3315!\202+\\\361\020\217\262#\202\335\200r\n\324\332\343=\305\367E\246\220\220\207}8%\002\215\032/\240{aN\365\030\375x\224\351>\327T}\212\330\027i\241\030\340?\017-\312,^C\252~8\017\t\035\366e\257'\240u\300\035n\375\325\007\200\014m*0\342\315&\210\252\010\267 G\341\237\004\366\211\224\025\347\243A2\032\027#\241@\326\260>\340\270\236 \240\241\276\213\006*\010e\243A;S\t\256\303\330\200}\244\334\325J\240LM\027\301\222\240]u\004\006\032\267Op\241\255\210\003oZ(\207\013t\216\322\223(\357S\362\rl\202\272\202\360@\207\236y\313BX\367\361\276\n2m\257\02752\357\253\244\304T\363$.\035\226\261\244wR\364\360\312\264\021\203\027\254\233)b\201\340D\340\352\304}e\303\033\273\235\334K6p\273\363\233\364\233\203\234\003*cB\324\036\007)\340$\303\264k\242\005/\231\352\240g$4\032$n\254\203\227E\340\221l\276^\244:\305\177,\243\302\226Z\3068 q%\224D\030g\340\266\317\003\221*\332\247\241{2\330E\re[\320\020\265\230\245\235\303\211$\361\226*\341\330`\027&\253g\316\221\241\261dB\243\373\005\225\234\264\352^)bk\321af\230\220`\\\207<$\322\210r.\264\317\\\306\221\311\r\316;\240\\%Y\313\030|B\366\310U71=y\021r\233\373\210\306\02365v\245\250F\315\213\3605M\004\264y\367Uh\202V\306\364\315\307\025'>\351 \252l\250\031O\024/\200\006]&\273pqR\246\344\2612\227\225.p\034\376m\311Ag\2679?s\227I\334\322\003\\\252\266\007\217\355\225\352\366M\324je@E2\331\022\027-~\337%5~\337c\240\"\352\256a\267\347\330P\314\234)+\330m\323\311\021\217/$G\367\255\251\377\322J?dn-\3117\225\2745\365\261\177\377\013\255\213\253fn\264\275\302\377\027J\316Q\365v\271s?Z\312\020+\267\246p\336\202\337^\035\270HP\024c`\252C'\224=;\246\350\033\347\220>\254H\372N\340\033\346\244\255h\252\006}\313\034\226\343\264=\344\247L]\273\344\307M\353\201o\331[\231o\321\0315\244\213\305\032\275T\243\037\324h\363""\255\341\222\266[\277vF\032\272SoPe\356\333\246h\360t.\273\236v\237\037\275\324\016RF6\030\355%\237O\325\245\221\305\335\335\243\352\242\222r\330\210\007\2366\t\331\323\270\264Td_N\240\335\276\252|Vg\251w\214\362\025/\352\234\227\264\334\244\262n\363\262ntJ~\236\336\327C\332\300\311\226&\026N\025}X\221\006N\256a\340T\321\006N\256e 4N7\341\344\306\035\234\\\313\301\311\265\014\234*\032p\032\322K5\372A\215\266\360\231\334\256\303\311qX8\325\032\006\000\256m\340\344i\202\223\243=p\234\324\0218\371\265*8\271Yu8\371.\003\247\252\00189\332\300\311\323\360PE\366\345\004z\014N5\226z\307\0048\3258/i5\340\344\030\312\272\321\r\234\034m\340t\225\225PYLEY\307\026@S\257\256]L\337>\233=\273w~\375\325\312\305\314/N\246OVN\276=}\372\372\372\253k\377\232\231\372\321\317\216W.\246\177z\374\315\311\302\311\306\351\334kq1\375\343W\373\307\317O\326O\177}\372\344b\346\227'\263\0273\2779\331\3730\363\333\323k4\266w1\363\371\373\317\357\234O\237\257\234?\177\363\227\267\007\357\304\207f\317\336\177\"x\376\354\351\371\365\363\033o~\367\366\233w\013\037\232=+\264\201\237\037\013\332\322O\216\377p\362\204\210\371\263'g\321\371\312\253k\037\246\177\177\272\367\236\3359\377\354\315\037\337\356\276\177\322\276\230\376\325\311\327\257ob\357\013$\377\037'\367O\261\344\302\371\365\367\213ko\267\336\267w.\246?;^\270d\342W\247\207\257\367\316\256\325&\266\316\304\331?\337$\357V\314\264\177\003\035&\210\373"; PyObject *data = __Pyx_DecompressString(cstring, 2605, 1); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif #else /* compression: none (7172 bytes) */ const char* const bytes = "0e-16 bytes were expected, got Deallocating buffer with attached memoryviews-InfinityNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.UUID('').?a boolean is required (got type {})a bytes or str object expected, got add_noteasyncpg.pgproto.asyncpg/pgproto/codecs/context.pyxasyncpg/pgproto/uuid.pyxbit value too longbuffer overreadcannot decode UUID, expected 16 bytes, got cannot encode Decimal value into numeric: exponent is too smallcannot encode Decimal value into numeric: exponent is too largecannot encode Decimal value into numeric: number of digits is too largecannot put message: no message takencannot start_message for a non-empty bufferconsume_full_messages called on a buffer without a complete first messageconsume_full_messages called on a partially read messageconsume_full_messages called with a wrong mtypedate tuple encoder: expecting 1 element in tuple, got {}debug: first buffer of ReadBuffer is emptydebug: second buffer of ReadBuffer is empty: decodes to less than 16 bytes: decodes to more than 16 bytesdisable!!! discarding message {!r} unread data: {!r}empty bufferempty first bufferenableend_message: buffer is too smallend_message can only be called with start_messageend_message: message is too largeexpected a datetime.date or datetime.datetime instance, got {!r}expected str, got {}failed to read one byte on a non-empty bufferfeed_data: a bytes or bytearray object expectedgchstore value is too largeinsufficient data in buffer: requested interval tuple encoder: expecting 3 elements in tuple, got {}invalid UUID invalid UUID {u!r}: unexpected characterinvalid address family in \"{}\" valueinvalid address length in \"{}\" valueinvalid network prefix length in \"{}\" valueinvalid number of elements in tid tuple, expecting 2invalid number of elements in txid_snapshot tuple, expecting 4isenabled: length must be between 32..36 characte""rs, got list or tuple expected (got type {})negative length for a len-prefixed bytes valueno default __reduce__ due to non-trivial __cinit__no message to consumeno message to discardnot enough data to read {} bytesnot enough data to read one bytenull value not allowed in hstore keypath value too longpolygon value too longread_null_str: buffer overreadread_null_str only works when the message guaranteed to be in the buffer remaining string is too largestring too longthe buffer is in read-only modetime tuple encoder: expecting 1 element in tuple, got {}time tuple encoder: expecting 2 elements2 in tuple, got {}timestamp tuple encoder: expecting 1 element in tuple, got {}tuple id block value out of uint32 rangetuple id offset value out of uint16 rangetxid_snapshot value is too longunexpected CIDR flag set in non-cidr valueunexpected JSONB format: {}: unexpected character unexpected jsonpath format: {}urn:uuid:value out of float32 rangevalue out of int16 rangevalue out of int32 rangevalue out of int64 rangevalue out of uint32 rangevalue out of uint64 rangeBitStringBoxBufferErrorCircleCodecContextCodecContext.__reduce_cython__CodecContext.__setstate_cython__CodecContext.get_json_decoderCodecContext.get_json_encoderCodecContext.get_text_codec_DecDecimalFFalseInfinityLineLineSegmentMAXYEARMINYEARNNaNNotImplementedPathPointPolygon__Pyx_PyDict_NextRefRESERVED_FUTURERESERVED_MICROSOFTRESERVED_NCSRFC_4122ReadBufferReadBuffer.__reduce_cython__ReadBuffer.__setstate_cython__SafeUUID__UUIDReplaceMe__UUIDReplaceMe.__reduce_cython____UUIDReplaceMe.__setstate_cython__UUIDUUID.__reduce__WriteBufferWriteBuffer.__reduce_cython__WriteBuffer.__setstate_cython____add__appendas_tupleastimezoneasyncio.coroutinesasyncpg.pgproto.pgproto__bases__bigbytescidr__class_getitem__cline_in_tracebackclock_seq_hi_variantclock_seq_lowcollectionsdatedate_from_ordinaldatetimedaydaysdecimaldecodedeque__dict___dictdigits__doc__encodeexponentfindformatfrom_bytesfrombytesfromordinal__func__functoo""lsget_json_decoderget_json_encoderget_text_codec__getstate__hourinetinfinity_dateinfinity_datetimeinpint__int__ip_addressip_interfaceip_network_ipaddripaddress_ipiface_ipnetis_closed_is_coroutineitems__len____main____metaclass__microsecondmicrosecondsminuteminutes__module__month__mro____mro_entries__n__name__negative_infinity_datenegative_infinity_datetimenetworknetwork_address__new__nodenowpackedpg_UUIDpg_epoch_datepg_epoch_datetimepg_epoch_datetime_utcpgproto_typespoppopleftprefixlen__prepare__print__pyx_capi____pyx_checksum__pyx_result__pyx_state__pyx_type__pyx_unpickle_CodecContext__pyx_unpickle___UUIDReplaceMe__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex__replacesecondsecondsself__set_name__setdefault__setstate____setstate_cython__signstatestd_UUID__test__timetime_hi_versiontime_lowtime_midtimedeltatimestamptimezonetoordinaltypestzinfounknownupdateuse_setstateutcutcoffsetuuidvaluesvariantversionyearPyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, PyObject *, char **, Py_ssize_t *)\000PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, int)\000PyObject *(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t)\000as_pg_string_and_size\000bits_encode\000bool_encode\000box_encode\000bytea_encode\000cidr_encode\000circle_encode\000date_encode\000date_encode_tuple""\000float4_encode\000float8_encode\000hstore_encode\000inet_encode\000int2_encode\000int4_encode\000int8_encode\000interval_encode\000interval_encode_tuple\000json_encode\000jsonb_encode\000jsonpath_encode\000line_encode\000lseg_encode\000numeric_encode_binary\000numeric_encode_text\000path_encode\000pg_snapshot_encode\000point_encode\000poly_encode\000text_encode\000tid_encode\000time_encode\000time_encode_tuple\000timestamp_encode\000timestamp_encode_tuple\000timestamptz_encode\000timetz_encode\000timetz_encode_tuple\000uint4_encode\000uint8_encode\000uuid_encode\000void_encode\000bits_decode\000bool_decode\000box_decode\000bytea_decode\000cidr_decode\000circle_decode\000date_decode\000date_decode_tuple\000float4_decode\000float8_decode\000hstore_decode\000inet_decode\000int2_decode\000int4_decode\000int8_decode\000interval_decode\000interval_decode_tuple\000json_decode\000jsonb_decode\000jsonpath_decode\000line_decode\000lseg_decode\000numeric_decode_binary\000numeric_decode_text\000path_decode\000pg_snapshot_decode\000point_decode\000poly_decode\000text_decode\000tid_decode\000time_decode\000time_decode_tuple\000timestamp_decode\000timestamp_decode_tuple\000timestamptz_decode\000timetz_decode\000timetz_decode_tuple\000uint4_decode\000uint8_decode\000uuid_decode\000void_decode\000numeric_decode_binary_ex\000frb_check\000\200\001\330\004*\250!\2506\260\021\200A\330\010\020\220\004\220A\220X\230T\240\021\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\030\230\001\330\004\007\200q\330\010\017\320\0170\260\004\260A\260W\270K\300w\310a\340\010\017\320\0170\260\004\260A\260W\270K\300q\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\030\230\001\330\004\007\200q\330\010\017\320\017-\250T\260\021\260'\270\033\300G\3101\340\010\017\320\017-\250T\260\021\260'\270\033\300A""\200A\330\010\016\210a\200\001\330\004\n\210+\220Q\200\001\330\004-\250Q\250f\260A\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220?\240(\250!\2501\330\004\007\200|\2207\230!\330\0101\260\021\3202D\300N\320RS\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220<\230x\240q\250\001\330\004\007\200|\2207\230!\330\010.\250a\250\177\270n\310A\330\004\013\2101"; PyObject *data = NULL; CYTHON_UNUSED_VAR(__Pyx_DecompressString); #endif PyObject **stringtab = __pyx_mstate->__pyx_string_tab; Py_ssize_t pos = 0; for (int i = 0; i < 266; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); if (likely(string) && i >= 91) PyUnicode_InternInPlace(&string); if (unlikely(!string)) { Py_XDECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } stringtab[i] = string; pos += bytes_length; } for (int i = 266; i < 278; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); stringtab[i] = string; pos += bytes_length; if (unlikely(!string)) { Py_XDECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } } Py_XDECREF(data); for (Py_ssize_t i = 0; i < 278; i++) { if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { __PYX_ERR(0, 1, __pyx_L1_error) } } #if CYTHON_IMMORTAL_CONSTANTS { PyObject **table = stringtab + 266; for (Py_ssize_t i=0; i<12; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); #else Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); #endif } } #endif } { PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0; int8_t const cint_constants_1[] = {0,-1,1,3,5,7,8,10,12,15,20,23,31,32,48,56,59,63,64,76,80,96,100}; int16_t const cint_constants_2[] = {255,1000,2000,4095}; int32_t const cint_constants_4[] = {65535L,999999L,238750788L}; int64_t const cint_constants_8[] = {281474976710655LL,2305843009213693952LL,4611686018427387904LL}; for (int i = 0; i < 33; i++) { numbertab[i] = PyLong_FromLongLong((i < 23 ? cint_constants_1[i - 0] : (i < 27 ? cint_constants_2[i - 23] : (i < 30 ? cint_constants_4[i - 27] : cint_constants_8[i - 30])))); if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error) } } { PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 33; const char* c_constant = "8000000000000"; for (int i = 0; i < 1; i++) { char *end_pos; numbertab[i] = PyLong_FromString(c_constant, &end_pos, 32); if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error) c_constant = end_pos + 1; } } #if CYTHON_IMMORTAL_CONSTANTS { PyObject **table = __pyx_mstate->__pyx_number_tab; for (Py_ssize_t i=0; i<34; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); #else Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); #endif } } #endif return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_codeobjects ### */ typedef struct { unsigned int argcount : 2; unsigned int num_posonly_args : 1; unsigned int num_kwonly_args : 1; unsigned int nlocals : 3; unsigned int flags : 10; unsigned int first_line : 8; } __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( const __Pyx_PyCode_New_function_description descr, PyObject * const *varnames, PyObject *filename, PyObject *funcname, PyObject *line_table, PyObject *tuple_dedup_map ); static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate}; __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_0_AWKwa_0_AWK, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 202}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_pgproto_uuid_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_AXT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 10}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_pgproto_codecs_context_p, __pyx_mstate->__pyx_n_u_get_text_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_pgproto_codecs_context_p, __pyx_mstate->__pyx_n_u_get_json_decoder, __pyx_mstate->__pyx_kp_b_iso88591_A_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 22}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_pgproto_codecs_context_p, __pyx_mstate->__pyx_n_u_get_json_encoder, __pyx_mstate->__pyx_kp_b_iso88591_A_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate}; __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_T_G1_T_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result}; __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle___UUIDReplaceMe, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_1_7_1_2DNRS_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result}; __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_CodecContext, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_xq_7_a_nA_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; bad: Py_DECREF(tuple_dedup_map); return -1; } /* #### Code section: init_globals ### */ static int __Pyx_InitGlobals(void) { /* PythonCompatibility.init */ if (likely(__Pyx_init_co_variables() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CommonTypesMetaclass.init */ if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CachedMethodType.init */ #if CYTHON_COMPILING_IN_LIMITED_API { PyObject *typesModule=NULL; typesModule = PyImport_ImportModule("types"); if (typesModule) { __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); } } // error handling follows #endif if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CythonFunctionShared.init */ if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### 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 (used by PyObjectGetAttrStrNoError) */ #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); 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 (used by PyObjectGetAttrStrNoError) */ #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 (used by PyObjectGetAttrStrNoError) */ #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); return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError (used by GetBuiltinName) */ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 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 >= 0x030d0000 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS 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_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, "name '%U' is not defined", name); } 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_GetFullyQualifiedName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetFullyQualifiedName(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; } /* CIntToDigits (used by CIntToPyUnicode) */ 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 (used by COrdinalToPyUnicode) */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const 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; void *udata; uval = PyUnicode_New(ulength, 127); if (unlikely(!uval)) return NULL; udata = PyUnicode_DATA(uval); 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 = PySequence_Repeat(padding, uoffset - prepend_sign); 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 = PyUnicode_Concat(padding, uval); Py_DECREF(uval); uval = tmp; } if (likely(uval) && sign) { PyObject *tmp = PyUnicode_Concat(sign, uval); Py_DECREF(uval); uval = tmp; } done_or_error: Py_XDECREF(padding); Py_XDECREF(sign); } #endif return uval; } /* COrdinalToPyUnicode (used by CIntToPyUnicode) */ static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) { return value <= 1114111; } static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) { Py_ssize_t padding_length = ulength - 1; if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) { char chars[256]; if (value <= 255) { memset(chars, padding_char, (size_t) padding_length); chars[ulength-1] = (char) value; return PyUnicode_DecodeLatin1(chars, ulength, NULL); } char *cpos = chars + sizeof(chars); if (value < 0x800) { *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0xc0 | (value & 0x1f)); } else if (value < 0x10000) { *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0xe0 | (value & 0x0f)); } else { *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0xf0 | (value & 0x07)); } cpos -= padding_length; memset(cpos, padding_char, (size_t) padding_length); return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL); } if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) { const char chars[1] = {(char) value}; return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char); } { PyObject *uchar, *padding_uchar, *padding, *result; padding_uchar = PyUnicode_FromOrdinal(padding_char); if (unlikely(!padding_uchar)) return NULL; padding = PySequence_Repeat(padding_uchar, padding_length); Py_DECREF(padding_uchar); if (unlikely(!padding)) return NULL; uchar = PyUnicode_FromOrdinal(value); if (unlikely(!uchar)) { Py_DECREF(padding); return NULL; } result = PyUnicode_Concat(padding, uchar); Py_DECREF(padding); Py_DECREF(uchar); return result; } } /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char) { #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 (unlikely(!(is_unsigned || value == 0 || value > 0) || !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) { PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)"); return NULL; } if (width <= 1) { return PyUnicode_FromOrdinal((int) value); } return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char); } static CYTHON_INLINE PyObject* __Pyx____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** values, 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; if (max_char > 1114111) max_char = 1114111; 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); assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) goto overflow; char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; PyObject *uval = values[i]; #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_PyUnicode_READY(uval) == (-1)) goto bad; #endif ulength = __Pyx_PyUnicode_GET_LENGTH(uval); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(ulength < 0)) goto bad; #endif 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 (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 || 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 Py_ssize_t i; PyObject *result = NULL; PyObject *value_tuple = PyTuple_New(value_count); if (unlikely(!value_tuple)) return NULL; CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); for (i=0; i__pyx_empty_unicode, value_tuple); bad: Py_DECREF(value_tuple); return result; #endif } /* PyObjectCall (used by PyObjectFastCall) */ #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 (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; 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 /* PyObjectCallMethO (used by PyObjectFastCall) */ #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 (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; 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 * const*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 #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x03090000 #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) #elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { PyTypeObject *tp = Py_TYPE(callable); #if defined(__Pyx_CyFunction_USED) if (__Pyx_CyFunction_CheckExact(callable)) { return __Pyx_CyFunction_func_vectorcall(callable); } #endif if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { return NULL; } assert(PyCallable_Check(callable)); Py_ssize_t offset = tp->tp_vectorcall_offset; assert(offset > 0); vectorcallfunc ptr; memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); return ptr; } #else #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) #endif #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *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 (kwargs == NULL) { #if CYTHON_VECTORCALL #if CYTHON_COMPILING_IN_LIMITED_API return PyObject_Vectorcall(func, args, _nargs, NULL); #else vectorcallfunc f = __Pyx_PyVectorcall_Function(func); if (f) { return f(func, args, _nargs, NULL); } #endif #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_mstate_global->__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 } /* RaiseException */ 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; } /* TupleAndListFromArray (used by fastcall) */ #if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; Py_ssize_t i; if (n <= 0) { return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; for (i = 0; i < n; i++) { if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) { Py_DECREF(res); return NULL; } Py_INCREF(src[i]); } return res; } #elif 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) { return __Pyx_NewRef(__pyx_mstate_global->__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 (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) 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 (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else 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 (s1_is_unicode & s2_is_unicode) { Py_ssize_t length, length2; int kind; void *data1, *data2; #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(length < 0)) return -1; #endif length2 = __Pyx_PyUnicode_GET_LENGTH(s2); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(length2 < 0)) return -1; #endif if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; 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)); 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_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: return (equals == Py_EQ); return_ne: 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 = __Pyx_PyTuple_GET_SIZE(kwnames); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(n == -1)) return NULL; #endif for (i = 0; i < n; i++) { PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(!namei)) return NULL; #endif if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(!namei)) return NULL; #endif int eq = __Pyx_PyUnicode_Equals(s, namei, 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_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs; PyObject *dict; #if !CYTHON_ASSUME_SAFE_SIZE nkwargs = PyTuple_Size(kwnames); if (unlikely(nkwargs < 0)) return NULL; #else nkwargs = PyTuple_GET_SIZE(kwnames); #endif dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itype, *target->method_name); if (unlikely(!method)) return -1; result = method; #if CYTHON_COMPILING_IN_CPYTHON if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) { 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); result = unbound_method; } } #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING if (unlikely(target->method)) { Py_DECREF(result); } else #endif target->method = result; return 0; } /* CallUnboundCMethod0 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); if (likely(was_initialized == 2 && cfunc->func)) { if (likely(cfunc->flag == METH_NOARGS)) return __Pyx_CallCFunction(cfunc, self, NULL); if (likely(cfunc->flag == METH_FASTCALL)) return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (cfunc->flag == METH_VARARGS) return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); return __Pyx__CallUnboundCMethod0(cfunc, self); } #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING else if (unlikely(was_initialized == 1)) { __Pyx_CachedCFunction tmp_cfunc = { #ifndef __cplusplus 0 #endif }; tmp_cfunc.type = cfunc->type; tmp_cfunc.method_name = cfunc->method_name; return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); } #endif PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); return result; } #endif static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { PyObject *result; if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; result = __Pyx_PyObject_CallOneArg(cfunc->method, self); return result; } /* py_dict_items (used by OwnedDictNext) */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d); } /* py_dict_values (used by OwnedDictNext) */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d); } /* OwnedDictNext (used by RejectKeywords) */ #if CYTHON_AVOID_BORROWED_REFS static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) { PyObject *next = NULL; if (!*ppos) { if (pvalue) { PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p); if (unlikely(!dictview)) goto bad; *ppos = PyObject_GetIter(dictview); Py_DECREF(dictview); } else { *ppos = PyObject_GetIter(p); } if (unlikely(!*ppos)) goto bad; } next = PyIter_Next(*ppos); if (!next) { if (PyErr_Occurred()) goto bad; return 0; } if (pkey && pvalue) { *pkey = __Pyx_PySequence_ITEM(next, 0); if (unlikely(*pkey)) goto bad; *pvalue = __Pyx_PySequence_ITEM(next, 1); if (unlikely(*pvalue)) goto bad; Py_DECREF(next); } else if (pkey) { *pkey = next; } else { assert(pvalue); *pvalue = next; } return 1; bad: Py_XDECREF(next); #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef"); #else PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef); #endif if (pkey) *pkey = NULL; if (pvalue) *pvalue = NULL; return 0; } #else // !CYTHON_AVOID_BORROWED_REFS static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) { int result = PyDict_Next(p, ppos, pkey, pvalue); if (likely(result == 1)) { if (pkey) Py_INCREF(*pkey); if (pvalue) Py_INCREF(*pvalue); } return result; } #endif /* RejectKeywords */ static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) { PyObject *key = NULL; if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) { key = __Pyx_PySequence_ITEM(kwds, 0); } else { #if CYTHON_AVOID_BORROWED_REFS PyObject *pos = NULL; #else Py_ssize_t pos = 0; #endif #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return; #endif __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(pos); #endif } if (likely(key)) { PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); Py_DECREF(key); } } /* PyDictVersioning (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_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_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { if (!PyErr_Occurred()) PyErr_SetNone(PyExc_NameError); return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } PyErr_Clear(); #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return result; } #else result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__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 PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; 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); } ctx = PyUnicode_FromString(name); __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } if (nogil) PyGILState_Release(state); } /* PyObjectFastCallMethod */ #if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) { PyObject *result; PyObject *attr = PyObject_GetAttr(args[0], name); if (unlikely(!attr)) return NULL; result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1); Py_DECREF(attr); return result; } #endif /* RaiseDoubleKeywords (used by ParseKeywordsImpl) */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, "%s() got multiple values for keyword argument '%U'", func_name, kw_name); } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); if (likely(was_initialized == 2 && cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { return __Pyx_CallCFunctionFast(cfunc, self, args, 2); } if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); } #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING else if (unlikely(was_initialized == 1)) { __Pyx_CachedCFunction tmp_cfunc = { #ifndef __cplusplus 0 #endif }; tmp_cfunc.type = cfunc->type; tmp_cfunc.method_name = cfunc->method_name; return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); } #endif PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); return result; } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ 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)) { PyObject *result = NULL; PyObject *args = PyTuple_New(2); if (unlikely(!args)) return NULL; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); else result = __Pyx_CallCFunction(cfunc, self, args); Py_DECREF(args); return result; } #endif { PyObject *args[4] = {NULL, self, arg1, arg2}; return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } } /* ParseKeywordsImpl (used by ParseKeywords) */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], PyObject ** const *first_kw_arg, const char* function_name) { PyObject ** const *name = argnames; while (name != first_kw_arg) { PyObject *key = **name; int found = PyDict_Contains(kwds, key); if (unlikely(found)) { if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; } name++; } return 0; bad: return -1; } #if CYTHON_USE_UNICODE_INTERNALS static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { int kind; Py_ssize_t len = PyUnicode_GET_LENGTH(s1); if (len != PyUnicode_GET_LENGTH(s2)) return 0; kind = PyUnicode_KIND(s1); if (kind != PyUnicode_KIND(s2)) return 0; const void *data1 = PyUnicode_DATA(s1); const void *data2 = PyUnicode_DATA(s2); return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); } #endif static int __Pyx_MatchKeywordArg_str( PyObject *key, PyObject ** const argnames[], PyObject ** const *first_kw_arg, size_t *index_found, const char *function_name) { PyObject ** const *name; #if CYTHON_USE_UNICODE_INTERNALS Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; if (unlikely(key_hash == -1)) { key_hash = PyObject_Hash(key); if (unlikely(key_hash == -1)) goto bad; } #endif name = first_kw_arg; while (*name) { PyObject *name_str = **name; #if CYTHON_USE_UNICODE_INTERNALS if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { *index_found = (size_t) (name - argnames); return 1; } #else #if CYTHON_ASSUME_SAFE_SIZE if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) #endif { int cmp = PyUnicode_Compare(name_str, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { *index_found = (size_t) (name - argnames); return 1; } } #endif name++; } name = argnames; while (name != first_kw_arg) { PyObject *name_str = **name; #if CYTHON_USE_UNICODE_INTERNALS if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { if (__Pyx_UnicodeKeywordsEqual(name_str, key)) goto arg_passed_twice; } #else #if CYTHON_ASSUME_SAFE_SIZE if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) #endif { if (unlikely(name_str == key)) goto arg_passed_twice; int cmp = PyUnicode_Compare(name_str, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; } #endif name++; } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; bad: return -1; } static int __Pyx_MatchKeywordArg_nostr( PyObject *key, PyObject ** const argnames[], PyObject ** const *first_kw_arg, size_t *index_found, const char *function_name) { PyObject ** const *name; if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; name = first_kw_arg; while (*name) { int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); if (cmp == 1) { *index_found = (size_t) (name - argnames); return 1; } if (unlikely(cmp == -1)) goto bad; name++; } name = argnames; while (name != first_kw_arg) { int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); if (unlikely(cmp != 0)) { if (cmp == 1) goto arg_passed_twice; else goto bad; } name++; } 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; bad: return -1; } static CYTHON_INLINE int __Pyx_MatchKeywordArg( PyObject *key, PyObject ** const argnames[], PyObject ** const *first_kw_arg, size_t *index_found, const char *function_name) { return likely(PyUnicode_CheckExact(key)) ? __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); } static void __Pyx_RejectUnknownKeyword( PyObject *kwds, PyObject ** const argnames[], PyObject ** const *first_kw_arg, const char *function_name) { #if CYTHON_AVOID_BORROWED_REFS PyObject *pos = NULL; #else Py_ssize_t pos = 0; #endif PyObject *key = NULL; __Pyx_BEGIN_CRITICAL_SECTION(kwds); while ( #if CYTHON_AVOID_BORROWED_REFS __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL) #else PyDict_Next(kwds, &pos, &key, NULL) #endif ) { PyObject** const *name = first_kw_arg; while (*name && (**name != key)) name++; if (!*name) { size_t index_found = 0; int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); if (cmp != 1) { if (cmp == 0) { PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(key); #endif break; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(key); #endif } __Pyx_END_CRITICAL_SECTION(); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(pos); #endif assert(PyErr_Occurred()); } static int __Pyx_ParseKeywordDict( PyObject *kwds, PyObject ** const argnames[], PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs) { PyObject** const *name; PyObject** const *first_kw_arg = argnames + num_pos_args; Py_ssize_t extracted = 0; #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; #endif name = first_kw_arg; while (*name && num_kwargs > extracted) { PyObject * key = **name; PyObject *value; int found = 0; #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 found = PyDict_GetItemRef(kwds, key, &value); #else value = PyDict_GetItemWithError(kwds, key); if (value) { Py_INCREF(value); found = 1; } else { if (unlikely(PyErr_Occurred())) goto bad; } #endif if (found) { if (unlikely(found < 0)) goto bad; values[name-argnames] = value; extracted++; } name++; } if (num_kwargs > extracted) { if (ignore_unknown_kwargs) { if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) goto bad; } else { __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); goto bad; } } return 0; bad: return -1; } static int __Pyx_ParseKeywordDictToDict( PyObject *kwds, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject** const *name; PyObject** const *first_kw_arg = argnames + num_pos_args; Py_ssize_t len; #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; #endif if (PyDict_Update(kwds2, kwds) < 0) goto bad; name = first_kw_arg; while (*name) { PyObject *key = **name; PyObject *value; #if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) int found = PyDict_Pop(kwds2, key, &value); if (found) { if (unlikely(found < 0)) goto bad; values[name-argnames] = value; } #elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 int found = PyDict_GetItemRef(kwds2, key, &value); if (found) { if (unlikely(found < 0)) goto bad; values[name-argnames] = value; if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; } #else #if CYTHON_COMPILING_IN_CPYTHON value = _PyDict_Pop(kwds2, key, kwds2); #else value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); #endif if (value == kwds2) { Py_DECREF(value); } else { if (unlikely(!value)) goto bad; values[name-argnames] = value; } #endif name++; } len = PyDict_Size(kwds2); if (len > 0) { return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); } else if (unlikely(len == -1)) { goto bad; } return 0; bad: return -1; } static int __Pyx_ParseKeywordsTuple( PyObject *kwds, PyObject * const *kwvalues, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs) { PyObject *key = NULL; PyObject** const * name; PyObject** const *first_kw_arg = argnames + num_pos_args; for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); #else key = __Pyx_PyTuple_GET_ITEM(kwds, pos); #endif #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(!key)) goto bad; #endif name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { PyObject *value = kwvalues[pos]; values[name-argnames] = __Pyx_NewRef(value); } else { size_t index_found = 0; int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); if (cmp == 1) { PyObject *value = kwvalues[pos]; values[index_found] = __Pyx_NewRef(value); } else { if (unlikely(cmp == -1)) goto bad; if (kwds2) { PyObject *value = kwvalues[pos]; if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else if (!ignore_unknown_kwargs) { goto invalid_keyword; } } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(key); key = NULL; #endif } return 0; invalid_keyword: PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); goto bad; bad: #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(key); #endif return -1; } /* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs) { if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); else if (kwds2) return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); else return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); } /* 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, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); #if CYTHON_ASSUME_SAFE_SIZE Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) { return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared); } else if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else (void)wraparound; (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); #if CYTHON_ASSUME_SAFE_SIZE && 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)))) { return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else (void)wraparound; (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) { return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared); } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { return __Pyx_NewRef(PyList_GET_ITEM(o, n)); } } else #if !CYTHON_AVOID_BORROWED_REFS 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)))) { return __Pyx_NewRef(PyTuple_GET_ITEM(o, n)); } } else #endif #endif #if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (!is_list && mm && mm->mp_subscript) { PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (is_list || 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 (void)wraparound; (void)boundscheck; return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } /* decode_c_bytes (used by decode_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_mstate_global->__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); } } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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; } /* RaiseUnboundLocalError */ static 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; 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 < 0x030d0000 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 >= 0x030d0000 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyUnicode_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, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(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_mstate_global->__pyx_n_u_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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, CYTHON_UNUSED int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #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 = PyLong_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 = PyLong_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_GetFullyQualifiedName(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; } /* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_Fallback___Pyx_PyLong_AndObjC(PyObject *op1, PyObject *op2, int inplace) { return (inplace ? PyNumber_InPlaceAnd : PyNumber_And)(op1, op2); } #if CYTHON_USE_PYLONG_INTERNALS static PyObject* __Pyx_Unpacked___Pyx_PyLong_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; long a; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla; if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } const int is_positive = __Pyx_PyLong_IsPos(op1); if ((intval & PyLong_MASK) == intval) { long last_digit = (long) __Pyx_PyLong_Digits(op1)[0]; long result = intval & (likely(is_positive) ? last_digit : (PyLong_MASK - last_digit + 1)); return PyLong_FromLong(result); } const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); if (likely(size == 1)) { a = (long) digits[0]; if (!is_positive) a *= -1; } else { switch (size) { case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; } return PyLong_Type.tp_as_number->nb_and(op1, op2); } calculate_long: { long x; x = a & b; return PyLong_FromLong(x); } calculate_long_long: { PY_LONG_LONG llx; llx = lla & llb; return PyLong_FromLongLong(llx); } } #endif static CYTHON_INLINE PyObject* __Pyx_PyLong_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(zerodivision_check); #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { return __Pyx_Unpacked___Pyx_PyLong_AndObjC(op1, op2, intval, inplace, zerodivision_check); } #endif return __Pyx_Fallback___Pyx_PyLong_AndObjC(op1, op2, inplace); } #endif /* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_Fallback___Pyx_PyLong_RshiftObjC(PyObject *op1, PyObject *op2, int inplace) { return (inplace ? PyNumber_InPlaceRshift : PyNumber_Rshift)(op1, op2); } #if CYTHON_USE_PYLONG_INTERNALS static PyObject* __Pyx_Unpacked___Pyx_PyLong_RshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; long a; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla; #if (defined(__cplusplus) && __cplusplus >= 202002L)\ || (defined(__GNUC__) || (defined(__clang__))) &&\ (defined(__arm__) || defined(__x86_64__) || defined(__i386__))\ || (defined(_MSC_VER) &&\ (defined(_M_ARM) || defined(_M_AMD64) || defined(_M_IX86))) const int negative_shift_works = 1; #else const int negative_shift_works = 0; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } const int is_positive = __Pyx_PyLong_IsPos(op1); const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); if (likely(size == 1)) { a = (long) digits[0]; if (!is_positive) a *= -1; } else { switch (size) { case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; } return PyLong_Type.tp_as_number->nb_rshift(op1, op2); } calculate_long: if ((!negative_shift_works) && unlikely(a < 0)) goto fallback; { long x; if (unlikely(b >= (long) (sizeof(long)*8))) { x = (a < 0) ? -1 : 0; } else x = a >> b; return PyLong_FromLong(x); } calculate_long_long: if ((!negative_shift_works) && unlikely(lla < 0)) goto fallback; { PY_LONG_LONG llx; if (unlikely(llb >= (long long) (sizeof(long long)*8))) { llx = (lla < 0) ? -1 : 0; } else llx = lla >> llb; return PyLong_FromLongLong(llx); } fallback: return __Pyx_Fallback___Pyx_PyLong_RshiftObjC(op1, op2, inplace); } #endif static CYTHON_INLINE PyObject* __Pyx_PyLong_RshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(zerodivision_check); #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { return __Pyx_Unpacked___Pyx_PyLong_RshiftObjC(op1, op2, intval, inplace, zerodivision_check); } #endif return __Pyx_Fallback___Pyx_PyLong_RshiftObjC(op1, op2, inplace); } #endif /* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_Fallback___Pyx_PyLong_LshiftObjC(PyObject *op1, PyObject *op2, int inplace) { return (inplace ? PyNumber_InPlaceLshift : PyNumber_Lshift)(op1, op2); } #if CYTHON_USE_PYLONG_INTERNALS static PyObject* __Pyx_Unpacked___Pyx_PyLong_LshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; long a; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla; #if (defined(__cplusplus) && __cplusplus >= 202002L)\ || (defined(__GNUC__) || (defined(__clang__))) &&\ (defined(__arm__) || defined(__x86_64__) || defined(__i386__))\ || (defined(_MSC_VER) &&\ (defined(_M_ARM) || defined(_M_AMD64) || defined(_M_IX86))) const int negative_shift_works = 1; #else const int negative_shift_works = 0; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } const int is_positive = __Pyx_PyLong_IsPos(op1); const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); if (likely(size == 1)) { a = (long) digits[0]; if (!is_positive) a *= -1; } else { switch (size) { case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; } return PyLong_Type.tp_as_number->nb_lshift(op1, op2); } calculate_long: if ((!negative_shift_works) && unlikely(a < 0)) goto fallback; { long x; x = a << b; if (unlikely(!(b < (long) (sizeof(long)*8) && a == x >> b)) && a) { lla = a; goto calculate_long_long; } return PyLong_FromLong(x); } calculate_long_long: { PY_LONG_LONG llx; llx = lla << llb; if (unlikely(lla != llx >> llb)) goto fallback; return PyLong_FromLongLong(llx); } fallback: return __Pyx_Fallback___Pyx_PyLong_LshiftObjC(op1, op2, inplace); } #endif static CYTHON_INLINE PyObject* __Pyx_PyLong_LshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(zerodivision_check); #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { return __Pyx_Unpacked___Pyx_PyLong_LshiftObjC(op1, op2, intval, inplace, zerodivision_check); } #endif return __Pyx_Fallback___Pyx_PyLong_LshiftObjC(op1, op2, inplace); } #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 >= 0x030C0000 local_value = tstate->current_exception; tstate->current_exception = 0; #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 #elif __PYX_LIMITED_VERSION_HEX > 0x030C0000 local_value = PyErr_GetRaisedException(); #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif #if __PYX_LIMITED_VERSION_HEX > 0x030C0000 if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 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); #elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000 PyErr_SetHandledException(local_value); Py_XDECREF(local_value); Py_XDECREF(local_type); Py_XDECREF(local_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; #if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; #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 /* GetTopmostException (used by SaveResetException) */ #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, int b_is_constant) { int64_t q = a / b; int64_t r = a - q*b; int64_t adapt_python = (b_is_constant ? ((r != 0) & ((r < 0) ^ (b < 0))) : ((r != 0) & ((r ^ b) < 0)) ); return q - adapt_python; } /* ModInt[int64_t] */ static CYTHON_INLINE int64_t __Pyx_mod_int64_t(int64_t a, int64_t b, int b_is_constant) { int64_t r = a % b; int64_t adapt_python = (b_is_constant ? ((r != 0) & ((r < 0) ^ (b < 0))) : ((r != 0) & ((r ^ b) < 0)) ); return r + adapt_python * b; } /* PyObjectVectorCallKwBuilder */ #if CYTHON_VECTORCALL static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { (void)__Pyx_PyObject_FastCallDict; if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; Py_INCREF(key); args[n] = value; return 0; } CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { (void)__Pyx_VectorcallBuilder_AddArgStr; if (unlikely(!PyUnicode_Check(key))) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); return -1; } return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); } static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { PyObject *pyKey = PyUnicode_FromString(key); if (!pyKey) return -1; return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); } #else // CYTHON_VECTORCALL CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { if (unlikely(!PyUnicode_Check(key))) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); return -1; } return PyDict_SetItem(builder, key, value); } #endif /* PyObjectVectorCallMethodKwBuilder */ #if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) { PyObject *result; PyObject *obj = PyObject_GetAttr(args[0], name); if (unlikely(!obj)) return NULL; result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames); Py_DECREF(obj); return result; } #endif /* DivInt[long] */ static CYTHON_INLINE long __Pyx_div_long(long a, long b, int b_is_constant) { long q = a / b; long r = a - q*b; long adapt_python = (b_is_constant ? ((r != 0) & ((r < 0) ^ (b < 0))) : ((r != 0) & ((r ^ b) < 0)) ); return q - adapt_python; } /* ModInt[long] */ static CYTHON_INLINE long __Pyx_mod_long(long a, long b, int b_is_constant) { long r = a % b; long adapt_python = (b_is_constant ? ((r != 0) & ((r < 0) ^ (b < 0))) : ((r != 0) & ((r ^ b) < 0)) ); return r + adapt_python * b; } /* HasAttr */ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!PyUnicode_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (!r) { return (unlikely(PyErr_Occurred())) ? -1 : 0; } else { Py_DECREF(r); return 1; } } #endif /* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_Fallback___Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, int inplace) { return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #if CYTHON_USE_PYLONG_INTERNALS static PyObject* __Pyx_Unpacked___Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; long a; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla; if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } const int is_positive = __Pyx_PyLong_IsPos(op1); const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); if (likely(size == 1)) { a = (long) digits[0]; if (!is_positive) a *= -1; } else { 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; } return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } calculate_long: CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); lla = a; goto calculate_long_long; calculate_long_long: { PY_LONG_LONG llx; llx = lla * llb; return PyLong_FromLongLong(llx); } } #endif static PyObject* __Pyx_Float___Pyx_PyLong_MultiplyObjC(PyObject *float_val, long intval, int zerodivision_check) { CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; double a = __Pyx_PyFloat_AS_DOUBLE(float_val); double result; result = ((double)a) * (double)b; return PyFloat_FromDouble(result); } static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(zerodivision_check); #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { return __Pyx_Unpacked___Pyx_PyLong_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check); } #endif if (PyFloat_CheckExact(op1)) { return __Pyx_Float___Pyx_PyLong_MultiplyObjC(op1, intval, zerodivision_check); } return __Pyx_Fallback___Pyx_PyLong_MultiplyObjC(op1, op2, inplace); } #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 { 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(); } /* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_Fallback___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, int inplace) { return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #if CYTHON_USE_PYLONG_INTERNALS static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long a = intval; long b; const PY_LONG_LONG lla = intval; PY_LONG_LONG llb; if (unlikely(__Pyx_PyLong_IsZero(op2))) { return __Pyx_NewRef(op1); } const int is_positive = __Pyx_PyLong_IsPos(op2); const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_DigitCount(op2); if (likely(size == 1)) { b = (long) digits[0]; if (!is_positive) b *= -1; } else { switch (size) { case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if (!is_positive) b *= -1; goto calculate_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])); if (!is_positive) llb *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) b *= -1; goto calculate_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])); if (!is_positive) llb *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) b *= -1; goto calculate_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])); if (!is_positive) llb *= -1; goto calculate_long_long; } break; } return PyLong_Type.tp_as_number->nb_add(op1, op2); } calculate_long: { long x; x = a + b; return PyLong_FromLong(x); } calculate_long_long: { PY_LONG_LONG llx; llx = lla + llb; return PyLong_FromLongLong(llx); } } #endif static PyObject* __Pyx_Float___Pyx_PyLong_AddCObj(PyObject *float_val, long intval, int zerodivision_check) { CYTHON_UNUSED_VAR(zerodivision_check); const long a = intval; double b = __Pyx_PyFloat_AS_DOUBLE(float_val); double result; result = ((double)a) + (double)b; return PyFloat_FromDouble(result); } static CYTHON_INLINE PyObject* __Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(zerodivision_check); #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { return __Pyx_Unpacked___Pyx_PyLong_AddCObj(op1, op2, intval, inplace, zerodivision_check); } #endif if (PyFloat_CheckExact(op2)) { return __Pyx_Float___Pyx_PyLong_AddCObj(op2, intval, zerodivision_check); } return __Pyx_Fallback___Pyx_PyLong_AddCObj(op1, op2, inplace); } #endif /* ArgTypeTestFunc (used by ArgTypeTest) */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; int from_annotation_subclass = 0; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (!exact) { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } else if (exact == 2) { if (__Pyx_TypeCheck(obj, type)) { from_annotation_subclass = 1; extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; } } type_name = __Pyx_PyType_GetFullyQualifiedName(type); obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")" #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 "%s%U" #endif , name, type_name, obj_type_name #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 , (from_annotation_subclass ? ". " : ""), extra_info #endif ); #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 if (exact == 2 && from_annotation_subclass) { PyObject *res; PyObject *vargs[2]; vargs[0] = PyErr_GetRaisedException(); vargs[1] = extra_info; res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); Py_XDECREF(res); PyErr_SetRaisedException(vargs[0]); } #endif __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* AllocateExtensionType */ static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) { if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc); return alloc_func(t, 0); } else { newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc); #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 if (!tp_new) { PyObject *new_str = PyUnicode_FromString("__new__"); if (likely(new_str)) { PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL); Py_DECREF(new_str); return o; } else return NULL; } else #endif return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0); } } /* CallTypeTraverse */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 if (__Pyx_get_runtime_version() < 0x03090000) return 0; #endif if (!always_call) { PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); unsigned long flags = PyType_GetFlags(base); if (flags & Py_TPFLAGS_HEAPTYPE) { return 0; } } Py_VISIT((PyObject*)Py_TYPE(o)); return 0; } #endif /* 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; } /* FunctionExport */ static int __Pyx_ExportFunction(PyObject *api_dict, const char *name, void (*f)(void), const char *sig) { PyObject *cobj; union { void (*fp)(void); void *p; } tmp; tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(api_dict, name, cobj) < 0) goto bad; Py_DECREF(cobj); return 0; bad: Py_XDECREF(cobj); return -1; } /* GetApiDict */ static PyObject *__Pyx_ApiExport_GetApiDict(void) { PyObject *d; if (__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_capi, &d) == -1) return NULL; if (!d) { d = PyDict_New(); if (!d) goto bad; if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_pyx_capi, d) < 0) goto bad; } return d; bad: Py_XDECREF(d); return NULL; } /* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static Py_ssize_t __Pyx_GetTypeDictOffset(void) { PyObject *tp_dictoffset_o; Py_ssize_t tp_dictoffset; tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__"); if (unlikely(!tp_dictoffset_o)) return -1; tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o); Py_DECREF(tp_dictoffset_o); if (unlikely(tp_dictoffset == 0)) { PyErr_SetString( PyExc_TypeError, "'type' doesn't have a dictoffset"); return -1; } else if (unlikely(tp_dictoffset < 0)) { PyErr_SetString( PyExc_TypeError, "'type' has an unexpected negative dictoffset. " "Please report this as Cython bug"); return -1; } return tp_dictoffset; } static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { static Py_ssize_t tp_dictoffset = 0; if (unlikely(tp_dictoffset == 0)) { tp_dictoffset = __Pyx_GetTypeDictOffset(); if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) { tp_dictoffset = 0; // try again next time? return NULL; } } return *(PyObject**)((char*)tp + tp_dictoffset); } #endif /* SetItemOnTypeDict (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { int result; PyObject *tp_dict; #if CYTHON_COMPILING_IN_LIMITED_API tp_dict = __Pyx_GetTypeDict(tp); if (unlikely(!tp_dict)) return -1; #else tp_dict = tp->tp_dict; #endif result = PyDict_SetItem(tp_dict, k, v); if (likely(!result)) { PyType_Modified(tp); if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) { PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL); if (!setNameResult) return -1; Py_DECREF(setNameResult); } } return result; } /* FixUpExtensionType */ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if __PYX_LIMITED_VERSION_HEX > 0x030900B1 CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #else const PyType_Slot *slot = spec->slots; int changed = 0; #if !CYTHON_COMPILING_IN_LIMITED_API while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { #if !CYTHON_COMPILING_IN_CPYTHON const #endif // !CYTHON_COMPILING_IN_CPYTHON) PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { 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); type->tp_vectorcall_offset = memb->offset; changed = 1; } #endif // CYTHON_METH_FASTCALL #if !CYTHON_COMPILING_IN_PYPY 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; int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); Py_DECREF(descr); if (unlikely(set_item_result < 0)) { return -1; } changed = 1; } #endif // !CYTHON_COMPILING_IN_PYPY } memb++; } } #endif // !CYTHON_COMPILING_IN_LIMITED_API #if !CYTHON_COMPILING_IN_PYPY slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_getset) slot++; if (slot && slot->slot == Py_tp_getset) { PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc; while (getset && getset->name) { if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) { PyObject *descr = PyDescr_NewGetSet(type, getset); if (unlikely(!descr)) return -1; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *pyname = PyUnicode_FromString(getset->name); if (unlikely(!pyname)) { Py_DECREF(descr); return -1; } int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr); Py_DECREF(pyname); #else CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); #endif Py_DECREF(descr); if (unlikely(set_item_result < 0)) { return -1; } changed = 1; } ++getset; } } #else CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #endif // !CYTHON_COMPILING_IN_PYPY if (changed) PyType_Modified(type); #endif // PY_VERSION_HEX > 0x030900B1 return 0; } /* PyObjectCallNoArg (used by PyObjectCallMethod0) */ 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 (used by PyObjectCallMethod0) */ #if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) 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)) #else #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 #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_GetFullyQualifiedName(tp); PyErr_Format(PyExc_AttributeError, "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); __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; } #endif /* PyObjectCallMethod0 (used by PyType_Ready) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { #if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[1] = {obj}; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_CallNoArg; return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else 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; #endif } /* ValidateBasesTuple (used by PyType_Ready) */ #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_SIZE n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (unlikely(n < 0)) return -1; #endif for (i = 1; i < n; i++) { PyTypeObject *b; #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 b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(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 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_GetFullyQualifiedName(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 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 */ CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) { while (t) { PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases) { return 1; } t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*); } return 0; } static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || 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; if (!__Pyx_PyType_HasMultipleInheritance(t)) { return PyType_Ready(t); } 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 !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 (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ !CYTHON_COMPILING_IN_GRAAL gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__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_mstate_global->__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 !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_mstate_global->__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_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable (used by MergeVTables) */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_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 */ static int __Pyx_MergeVtables(PyTypeObject *type) { int i=0; Py_ssize_t size; void** base_vtables; __Pyx_TypeName tp_base_name = NULL; __Pyx_TypeName base_name = NULL; void* unknown = (void*)-1; PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*); int base_depth = 0; { PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); while (base) { base_depth += 1; base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*); } } base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; #if CYTHON_COMPILING_IN_LIMITED_API size = PyTuple_Size(bases); if (size < 0) goto other_failure; #else size = PyTuple_GET_SIZE(bases); #endif for (i = 1; i < size; i++) { PyObject *basei; void* base_vtable; #if CYTHON_AVOID_BORROWED_REFS basei = PySequence_GetItem(bases, i); if (unlikely(!basei)) goto other_failure; #elif !CYTHON_ASSUME_SAFE_MACROS basei = PyTuple_GetItem(bases, i); if (unlikely(!basei)) goto other_failure; #else basei = PyTuple_GET_ITEM(bases, i); #endif base_vtable = __Pyx_GetVtable((PyTypeObject*)basei); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(basei); #endif if (base_vtable != NULL) { int j; PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); 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 = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*); } } } PyErr_Clear(); PyMem_Free(base_vtables); return 0; bad: { PyTypeObject* basei = NULL; PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base); #if CYTHON_AVOID_BORROWED_REFS basei = (PyTypeObject*)PySequence_GetItem(bases, i); if (unlikely(!basei)) goto really_bad; #elif !CYTHON_ASSUME_SAFE_MACROS basei = (PyTypeObject*)PyTuple_GetItem(bases, i); if (unlikely(!basei)) goto really_bad; #else basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i); #endif base_name = __Pyx_PyType_GetFullyQualifiedName(basei); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(basei); #endif } PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); #if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS really_bad: // bad has failed! #endif __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS other_failure: #endif PyMem_Free(base_vtables); return -1; } /* DelItemOnTypeDict (used by SetupReduce) */ static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) { int result; PyObject *tp_dict; #if CYTHON_COMPILING_IN_LIMITED_API tp_dict = __Pyx_GetTypeDict(tp); if (unlikely(!tp_dict)) return -1; #else tp_dict = tp->tp_dict; #endif result = PyDict_DelItem(tp_dict, k); if (likely(!result)) PyType_Modified(tp); return result; } /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (likely(reduce_cython)) { ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (likely(setstate_cython)) { ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_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_GetFullyQualifiedName((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; } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_2_1 #define __PYX_HAVE_RT_ImportType_3_2_1 static PyTypeObject *__Pyx_ImportType_3_2_1(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_1 check_size) { PyObject *result = 0; Py_ssize_t basicsize; Py_ssize_t itemsize; #if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && 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 !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) ) basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else if (size == 0) { return (PyTypeObject *)result; } 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_2_1 && ((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_2_1 && (size_t)basicsize > size) { if (PyErr_WarnFormat(NULL, 0, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize) < 0) { goto bad; } } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* ImportImpl (used by Import) */ static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) { PyObject *imported_module = PyImport_GetModule(qualname); if (unlikely(!imported_module)) { *module = NULL; if (PyErr_Occurred()) { return -1; } return 0; } *module = imported_module; return 1; } static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) { PyObject *imported_module; PyObject *top_level_package_name; Py_ssize_t i; int status, module_found; Py_ssize_t dot_index; module_found = __Pyx__Import_GetModule(qualname, &imported_module); if (unlikely(!module_found || module_found == -1)) { *module = NULL; return module_found; } if (imported_names) { for (i = 0; i < len_imported_names; i++) { PyObject *imported_name = imported_names[i]; #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name); #else int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name); if (unlikely(has_imported_attribute == -1)) goto error; #endif if (!has_imported_attribute) { goto not_found; } } *module = imported_module; return 1; } dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1); if (dot_index == -1) { *module = imported_module; return 1; } if (unlikely(dot_index == -2)) goto error; top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index); if (unlikely(!top_level_package_name)) goto error; Py_DECREF(imported_module); status = __Pyx__Import_GetModule(top_level_package_name, module); Py_DECREF(top_level_package_name); return status; error: Py_DECREF(imported_module); *module = NULL; return -1; not_found: Py_DECREF(imported_module); *module = NULL; return 0; } static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *from_list = 0; int module_found; if (!qualname) { qualname = name; } module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module); if (likely(module_found == 1)) { return module; } else if (unlikely(module_found == -1)) { return NULL; } empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; if (imported_names) { #if CYTHON_COMPILING_IN_CPYTHON from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names); if (unlikely(!from_list)) goto bad; #else from_list = PyList_New(len_imported_names); if (unlikely(!from_list)) goto bad; for (Py_ssize_t i=0; i__pyx_d, level); } /* 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_mstate_global->__pyx_kp_u__4); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ CYTHON_COMPILING_IN_GRAAL { 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, "cannot import name %S", name); } return value; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL; #if CYTHON_ASSUME_SAFE_SIZE size_bases = PyTuple_GET_SIZE(bases); #else size_bases = PyTuple_Size(bases); if (size_bases < 0) return NULL; #endif for (i = 0; i < size_bases; i++) { #if CYTHON_AVOID_BORROWED_REFS Py_CLEAR(base); #endif #if CYTHON_ASSUME_SAFE_MACROS base = PyTuple_GET_ITEM(bases, i); #else base = PyTuple_GetItem(bases, i); if (!base) goto error; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(base); #endif if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_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++) { PyObject *base_from_list; #if CYTHON_ASSUME_SAFE_MACROS base_from_list = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base_from_list); Py_INCREF(base_from_list); #else base_from_list = PyTuple_GetItem(bases, j); if (!base_from_list) goto error; Py_INCREF(base_from_list); if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error; #endif } } #if CYTHON_ASSUME_SAFE_SIZE j = PyList_GET_SIZE(new_bases); #else j = PyList_Size(new_bases); if (j < 0) goto error; #endif 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); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(base); #endif return result; error: Py_XDECREF(new_bases); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(base); #endif return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_SIZE 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 (!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) { metaclass = &PyType_Type; } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectCall2Args (used by Py3ClassCreate) */ 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 (used by Py3ClassCreate) */ #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); 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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } 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_mstate_global->__pyx_n_u_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, mkw); Py_XDECREF(owned_metaclass); return result; } /* dict_setdefault (used by FetchCommonType) */ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) { PyObject* value; #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 PyObject *args[] = {d, key, default_value}; value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #elif CYTHON_COMPILING_IN_LIMITED_API value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL); #elif PY_VERSION_HEX >= 0x030d0000 PyDict_SetDefaultRef(d, key, default_value, &value); #else value = PyDict_SetDefault(d, key, default_value); if (unlikely(!value)) return NULL; Py_INCREF(value); #endif return value; } /* AddModuleRef (used by FetchSharedCythonModule) */ #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) { PyObject *module_dict = PyImport_GetModuleDict(); PyObject *m; if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) { return NULL; } if (m != NULL && PyModule_Check(m)) { return m; } Py_XDECREF(m); m = PyModule_NewObject(name); if (m == NULL) return NULL; if (PyDict_CheckExact(module_dict)) { PyObject *new_m; (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m); Py_DECREF(m); return new_m; } else { if (PyObject_SetItem(module_dict, name, m) != 0) { Py_DECREF(m); return NULL; } return m; } } static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *py_name = PyUnicode_FromString(name); if (!py_name) return NULL; PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name); Py_DECREF(py_name); return module; } #elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif /* FetchSharedCythonModule (used by FetchCommonType) */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } /* FetchCommonType (used by CommonTypesMetaclass) */ #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases); if (result && metaclass) { PyObject *old_tp = (PyObject*)Py_TYPE(result); Py_INCREF((PyObject*)metaclass); #if __PYX_LIMITED_VERSION_HEX >= 0x03090000 Py_SET_TYPE(result, metaclass); #else result->ob_type = metaclass; #endif Py_DECREF(old_tp); } return result; } #else #define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b) #endif static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t expected_basicsize) { Py_ssize_t basicsize; if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (expected_basicsize == 0) { return 0; // size is inherited, nothing useful to check } #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) return -1; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = NULL; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1; #else basicsize = ((PyTypeObject*) cached_type)->tp_basicsize; #endif if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; py_object_name = PyUnicode_FromString(object_name); if (!py_object_name) return NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) goto done; abi_module_dict = PyModule_GetDict(abi_module); if (!abi_module_dict) goto done; get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type); if (get_item_ref_result == 1) { if (__Pyx_VerifyCachedType( cached_type, object_name, spec->basicsize) < 0) { goto bad; } goto done; } else if (unlikely(get_item_ref_result == -1)) { goto bad; } cached_type = __Pyx_PyType_FromMetaclass( metaclass, CYTHON_USE_MODULE_STATE ? module : 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; new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type); if (unlikely(new_cached_type != cached_type)) { if (unlikely(!new_cached_type)) goto bad; Py_DECREF(cached_type); cached_type = new_cached_type; if (__Pyx_VerifyCachedType( cached_type, object_name, spec->basicsize) < 0) { goto bad; } goto done; } else { Py_DECREF(new_cached_type); } done: Py_XDECREF(abi_module); Py_DECREF(py_object_name); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* CommonTypesMetaclass (used by CythonFunctionShared) */ static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); } #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) { PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types"); return NULL; } static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) { PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable"); return -1; } #endif static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = { {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = { {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset}, #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call}, {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call}, {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr}, #endif {0, 0} }; static PyType_Spec __pyx_CommonTypesMetaclass_spec = { __PYX_TYPE_MODULE_PREFIX "_common_types_metatype", 0, 0, Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT, __pyx_CommonTypesMetaclass_slots }; static int __pyx_CommonTypesMetaclass_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); PyObject *bases = PyTuple_Pack(1, &PyType_Type); if (unlikely(!bases)) { return -1; } mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); Py_DECREF(bases); if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { return -1; } return 0; } /* PyMethodNew (used by CythonFunctionShared) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *result; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 { PyObject *args[] = {func, self}; result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); } #else result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); #endif return result; } #else 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); } #endif /* PyVectorcallFastCallDict (used by CythonFunctionShared) */ #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL 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; #if CYTHON_AVOID_BORROWED_REFS PyObject *pos; #else Py_ssize_t pos; #endif size_t j; PyObject *key, *value; unsigned long keys_are_strings; #if !CYTHON_ASSUME_SAFE_SIZE Py_ssize_t nkw = PyDict_Size(kw); if (unlikely(nkw == -1)) return NULL; #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); #endif 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 = 0; i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) { keys_are_strings &= #if CYTHON_COMPILING_IN_LIMITED_API PyType_GetFlags(Py_TYPE(key)); #else Py_TYPE(key)->tp_flags; #endif #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; #else PyTuple_SET_ITEM(kwnames, i, key); #endif 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: #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(pos); #endif 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) { Py_ssize_t kw_size = likely(kw == NULL) ? 0 : #if !CYTHON_ASSUME_SAFE_SIZE PyDict_Size(kw); #else PyDict_GET_SIZE(kw); #endif if (kw_size == 0) { return vc(func, args, nargs, NULL); } #if !CYTHON_ASSUME_SAFE_SIZE else if (unlikely(kw_size == -1)) { return NULL; } #endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared (used by CythonFunction) */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { 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; } static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { int result; PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); if (unlikely(!newFunc)) { PyErr_Clear(); // It's only an optimization, so don't throw an error return 0; } result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); Py_DECREF(newFunc); return result; } return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { if (PyMethod_Check(func)) { func = PyMethod_GET_FUNCTION(func); } 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_locked(__pyx_CyFunctionObject *op) { 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) { op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); 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 PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { PyObject *result; CYTHON_UNUSED_VAR(closure); __Pyx_BEGIN_CRITICAL_SECTION(op); result = __Pyx_CyFunction_get_doc_locked(op); __Pyx_END_CRITICAL_SECTION(); return result; } 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_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_doc, value); __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #else op->func_name = PyUnicode_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 PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { PyObject *result = NULL; CYTHON_UNUSED_VAR(context); __Pyx_BEGIN_CRITICAL_SECTION(op); result = __Pyx_CyFunction_get_name_locked(op); __Pyx_END_CRITICAL_SECTION(); return result; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_name, value); __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); PyObject *result; __Pyx_BEGIN_CRITICAL_SECTION(op); Py_INCREF(op->func_qualname); result = op->func_qualname; __Pyx_END_CRITICAL_SECTION(); return result; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_qualname, value); __Pyx_END_CRITICAL_SECTION(); return 0; } #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 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; } #endif 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_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; 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 PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = NULL; CYTHON_UNUSED_VAR(context); __Pyx_BEGIN_CRITICAL_SECTION(op); result = __Pyx_CyFunction_get_defaults_locked(op); __Pyx_END_CRITICAL_SECTION(); 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_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; 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 PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result; CYTHON_UNUSED_VAR(context); __Pyx_BEGIN_CRITICAL_SECTION(op); result = __Pyx_CyFunction_get_kwdefaults_locked(op); __Pyx_END_CRITICAL_SECTION(); 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_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; 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_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject *result; CYTHON_UNUSED_VAR(context); __Pyx_BEGIN_CRITICAL_SECTION(op); result = __Pyx_CyFunction_get_annotations_locked(op); __Pyx_END_CRITICAL_SECTION(); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; if (is_coroutine) { PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(is_coroutine_value)) { return is_coroutine_value; } ignore: PyErr_Clear(); } return __Pyx_PyBool_FromLong(is_coroutine); } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { PyObject *result; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } result = __Pyx_CyFunction_get_is_coroutine_value(op); if (unlikely(!result)) return NULL; __Pyx_BEGIN_CRITICAL_SECTION(op); if (op->func_is_coroutine) { Py_DECREF(result); result = __Pyx_NewRef(op->func_is_coroutine); } else { op->func_is_coroutine = __Pyx_NewRef(result); } __Pyx_END_CRITICAL_SECTION(); return result; } static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); if (!py_name) return; PyErr_Format(PyExc_TypeError, "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, message, size); Py_DECREF(py_name); #else const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; PyErr_Format(PyExc_TypeError, "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", name, message, size); #endif } static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); if (!py_name) return; PyErr_Format(PyExc_TypeError, "%.200S() %s", py_name, message); Py_DECREF(py_name); #else const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; PyErr_Format(PyExc_TypeError, "%.200s() %s", name, message); #endif } #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[] = { {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, #else {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, #endif {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {"_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 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #endif #if CYTHON_METH_FASTCALL #if CYTHON_COMPILING_IN_LIMITED_API {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #if CYTHON_COMPILING_IN_LIMITED_API {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {"__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) { PyObject *result = NULL; CYTHON_UNUSED_VAR(args); __Pyx_BEGIN_CRITICAL_SECTION(m); Py_INCREF(m->func_qualname); result = m->func_qualname; __Pyx_END_CRITICAL_SECTION(); return result; } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if 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 #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API op->func_dict = NULL; #endif 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 = 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 #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func_dict); #elif PY_VERSION_HEX < 0x030d0000 _PyObject_ClearManagedDict((PyObject*)m); #else PyObject_ClearManagedDict((PyObject*)m); #endif 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); Py_CLEAR(m->defaults); 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) { { int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); if (e) return e; } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func_dict); #else { int e = #if PY_VERSION_HEX < 0x030d0000 _PyObject_VisitManagedDict #else PyObject_VisitManagedDict #endif ((PyObject*)m, visit, arg); if (e != 0) return e; } #endif __Pyx_VISIT_CONST(m->func_name); __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); __Pyx_VISIT_CONST(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); Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { PyObject *repr; __Pyx_BEGIN_CRITICAL_SECTION(op); repr = PyUnicode_FromFormat("", op->func_qualname, (void *)op); __Pyx_END_CRITICAL_SECTION(); return repr; } 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; 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(*)(void))meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_SIZE 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); __Pyx_CyFunction_raise_argument_count_error( (__pyx_CyFunctionObject*)func, "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_SIZE 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; } __Pyx_CyFunction_raise_argument_count_error( (__pyx_CyFunctionObject*)func, "takes exactly one argument", size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } __Pyx_CyFunction_raise_type_error( (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); 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 && CYTHON_VECTORCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE 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_SIZE 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); PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); 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 && CYTHON_VECTORCALL 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)) { __Pyx_CyFunction_raise_type_error( cyfunc, "needs an argument"); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { __Pyx_CyFunction_raise_type_error( cyfunc, "takes no keyword arguments"); 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; Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); if (unlikely(!meth)) return NULL; #else PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; #endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)cyfunc)->m_self; #endif break; default: return NULL; } if (unlikely(nargs != 0)) { __Pyx_CyFunction_raise_argument_count_error( cyfunc, "takes no arguments", nargs); return NULL; } return 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; Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); if (unlikely(!meth)) return NULL; #else PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; #endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)cyfunc)->m_self; #endif break; default: return NULL; } if (unlikely(nargs != 1)) { __Pyx_CyFunction_raise_argument_count_error( cyfunc, "takes exactly one argument", nargs); return NULL; } return 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; Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); if (unlikely(!meth)) return NULL; #else PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; #endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)cyfunc)->m_self; #endif break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))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; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); if (unlikely(!meth)) return NULL; #else PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; #endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)cyfunc)->m_self; #endif break; default: return NULL; } #if PY_VERSION_HEX < 0x030e00A6 size_t nargs_value = (size_t) nargs; #else Py_ssize_t nargs_value = nargs; #endif return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames); } #endif 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 CYTHON_METH_FASTCALL #if defined(Py_TPFLAGS_HAVE_VECTORCALL) Py_TPFLAGS_HAVE_VECTORCALL | #elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif #endif // CYTHON_METH_FASTCALL #if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_TPFLAGS_MANAGED_DICT | #endif Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; static int __pyx_CyFunction_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec( mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL); if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) return NULL; 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_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 #define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o)) #elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL); #else PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) { PyObject **dict_ptr = _PyObject_GetDictPtr(o); return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL; } #endif static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline = NULL; PyObject *ptype, *pvalue, *ptraceback; PyObject *cython_runtime_dict; CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, cython_runtime_dict, __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False)) } if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } Py_XDECREF(use_cline); Py_XDECREF(cython_runtime_dict); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache (used by AddTraceback) */ 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 __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { __Pyx_CachedCodeObjectType* code_object; int pos; if (unlikely(!code_line) || unlikely(!code_cache->entries)) { return NULL; } pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { return NULL; } code_object = code_cache->entries[pos].code_object; Py_INCREF(code_object); return code_object; } static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS (void)__pyx__find_code_object; return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. #else struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); if (old_count < 0) { __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); return NULL; } #endif __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); #endif return result; #endif } static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { code_cache->entries = entries; code_cache->max_count = 64; 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(code_cache->entries, code_cache->count, code_line); if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_INCREF(code_object); Py_DECREF(tmp); return; } if (code_cache->count == code_cache->max_count) { int new_max = code_cache->max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } code_cache->entries = entries; code_cache->max_count = new_max; } for (i=code_cache->count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; code_cache->count++; Py_INCREF(code_object); } static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS (void)__pyx__insert_code_object; return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. #else struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING __pyx_nonatomic_int_type expected = 0; if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { return; } #endif __pyx__insert_code_object(code_cache, code_line, code_object); #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); #endif #endif } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #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 = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); return NULL; } 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) { c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = __pyx_find_code_object(c_line ? -c_line : py_line); if (!code_object) { 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; if (c_line) { py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); } else { 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; __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); } else { dict = PyDict_New(); } 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 (c_line) { 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; } py_code = PyCode_NewEmpty(filename, funcname, py_line); Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); 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_mstate_global->__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 /* CheckUnpickleChecksum */ static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) { PyObject *pickle_module = PyImport_ImportModule("pickle"); if (unlikely(!pickle_module)) return; PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError"); Py_DECREF(pickle_module); if (unlikely(!pickle_error)) return; if (checksum2 == checksum1) { PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))", checksum, checksum1, members); } else if (checksum3 == checksum2) { PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))", checksum, checksum1, checksum2, members); } else { PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))", checksum, checksum1, checksum2, checksum3, members); } Py_DECREF(pickle_error); } static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) { int found = 0; found |= checksum1 == checksum; found |= checksum2 == checksum; found |= checksum3 == checksum; if (likely(found)) return 0; __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members); return -1; } /* 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_PyLong_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 (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int64_t __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) { int64_t val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 (unlikely(!PyLong_Check(x))) { int32_t val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int32_t) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE unsigned char __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) { unsigned char val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (unsigned char) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(unsigned char) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int16_t __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) { int16_t val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int16_t) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(int16_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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; } /* CIntFromPy */ static CYTHON_INLINE char __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) { char val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (char) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int8_t __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) { int8_t val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int8_t) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(int8_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) { uint32_t val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint64_t __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) { uint64_t val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (uint64_t) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(uint64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) 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 >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[2] = {obj, arg}; (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 } /* UpdateUnpickledDict */ static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) { PyObject *state_dict = __Pyx_PySequence_ITEM(state, index); if (unlikely(!state_dict)) { return -1; } int non_empty = PyObject_IsTrue(state_dict); if (non_empty == 0) { Py_DECREF(state_dict); return 0; } else if (unlikely(non_empty == -1)) { return -1; } PyObject *dict; #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 dict = PyObject_GetAttrString(obj, "__dict__"); #else dict = PyObject_GenericGetDict(obj, NULL); #endif if (unlikely(!dict)) { Py_DECREF(state_dict); return -1; } int result; if (likely(PyDict_CheckExact(dict))) { result = PyDict_Update(dict, state_dict); } else { PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict); if (likely(obj_result)) { Py_DECREF(obj_result); result = 0; } else { result = -1; } } Py_DECREF(state_dict); Py_DECREF(dict); return result; } static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) { Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(state_size == -1)) return -1; #endif if (state_size <= index) { return 0; } return __Pyx__UpdateUnpickledDict(obj, state, index); } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) { PyObject *module = NULL, *name = NULL, *result = NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_mstate_global->__pyx_n_u_qualname); #else name = PyType_GetQualName(tp); #endif if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { result = name; name = NULL; goto done; } result = PyUnicode_FromFormat("%U.%U", module, name); if (unlikely(result == NULL)) goto bad; done: Py_XDECREF(name); Py_XDECREF(module); return result; bad: PyErr_Clear(); if (name) { result = name; name = NULL; } else { result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__5); } goto done; } #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); } 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); } } 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); for (i=0; i>= 8; ++i; } __Pyx_cached_runtime_version = version; } } #endif static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 return Py_Version & ~0xFFUL; #else return __Pyx_cached_runtime_version; #endif } /* CheckBinaryVersion */ 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); } } /* NewCodeObj */ #if CYTHON_COMPILING_IN_LIMITED_API static 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, "iiiiiOOOOOOiOOO", 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, "iiiiiiOOOOOOiOOO", 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, "iiiiiiOOOOOOOiOOOO", 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; } #elif PY_VERSION_HEX >= 0x030B0000 static 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; 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, __pyx_mstate_global->__pyx_empty_bytes); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1 if (likely(result)) result->_co_firsttraceable = 0; #endif return result; } #elif !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 static PyObject* __Pyx_PyCode_New( const __Pyx_PyCode_New_function_description descr, PyObject * const *varnames, PyObject *filename, PyObject *funcname, PyObject *line_table, PyObject *tuple_dedup_map ) { PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL; Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; PyObject *varnames_tuple = PyTuple_New(var_count); if (unlikely(!varnames_tuple)) return NULL; for (Py_ssize_t i=0; i < var_count; i++) { Py_INCREF(varnames[i]); if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; } #if CYTHON_COMPILING_IN_LIMITED_API varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); if (!varnames_tuple_dedup) { if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; varnames_tuple_dedup = varnames_tuple; } #else varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); if (unlikely(!varnames_tuple_dedup)) goto done; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(varnames_tuple_dedup); #endif if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) { Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(line_table_length == -1)) goto done; #endif Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL; code_bytes = PyBytes_FromStringAndSize(NULL, code_len); if (unlikely(!code_bytes)) goto done; char* c_code_bytes = PyBytes_AsString(code_bytes); if (unlikely(!c_code_bytes)) goto done; memset(c_code_bytes, 0, (size_t) code_len); } code_obj = (PyObject*) __Pyx__PyCode_New( (int) descr.argcount, (int) descr.num_posonly_args, (int) descr.num_kwonly_args, (int) descr.nlocals, 0, (int) descr.flags, code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_empty_tuple, varnames_tuple_dedup, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_empty_tuple, filename, funcname, (int) descr.first_line, (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes ); done: Py_XDECREF(code_bytes); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(varnames_tuple_dedup); #endif Py_DECREF(varnames_tuple); return code_obj; } /* DecompressString */ static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) { PyObject *module, *decompress, *compressed_bytes, *decompressed; const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib"; PyObject *methodname = PyUnicode_FromString("decompress"); if (unlikely(!methodname)) return NULL; #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000 if (algo == 3) { PyObject *fromlist = Py_BuildValue("[O]", methodname); if (unlikely(!fromlist)) return NULL; module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0); Py_DECREF(fromlist); } else #endif module = PyImport_ImportModule(module_name); if (unlikely(!module)) goto import_failed; decompress = PyObject_GetAttr(module, methodname); if (unlikely(!decompress)) goto import_failed; { #ifdef __cplusplus char *memview_bytes = const_cast(s); #else #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wcast-qual" #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" #endif char *memview_bytes = (char*) s; #if defined(__clang__) #pragma clang diagnostic pop #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) #pragma GCC diagnostic pop #endif #endif #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ) int memview_flags = 0x100; #else int memview_flags = PyBUF_READ; #endif compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags); } if (unlikely(!compressed_bytes)) { Py_DECREF(decompress); goto bad; } decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL); Py_DECREF(compressed_bytes); Py_DECREF(decompress); Py_DECREF(module); Py_DECREF(methodname); return decompressed; import_failed: PyErr_Format(PyExc_ImportError, "Failed to import '%.20s.decompress' - cannot initialise module strings. " "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.", module_name, algo); bad: Py_XDECREF(module); Py_DECREF(methodname); return NULL; } #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_UTF8 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API { const char* result; Py_ssize_t unicode_length; CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; #else result = PyUnicode_AsUTF8AndSize(o, length); #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII unicode_length = PyUnicode_GetLength(o); if (unlikely(unicode_length < 0)) return NULL; if (unlikely(unicode_length != *length)) { PyUnicode_AsASCIIString(o); return NULL; } #endif return result; } #else #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_UTF8 if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif if (PyByteArray_Check(o)) { #if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); #else *length = PyByteArray_Size(o); if (*length == -1) return NULL; return PyByteArray_AsString(o); #endif } else { 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_LongWrongResultType(PyObject* result) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); 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; } PyErr_Format(PyExc_TypeError, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif PyObject *res = NULL; if (likely(PyLong_Check(x))) return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; if (likely(m && m->nb_int)) { res = m->nb_int(x); } #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Long(x); } #endif if (likely(res)) { if (unlikely(!PyLong_CheckExact(res))) { return __Pyx_PyNumber_LongWrongResultType(res); } } 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 (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 = PyLong_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); } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { CYTHON_UNUSED_VAR(b); return __Pyx_NewRef(Py_None); } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return __Pyx_NewRef(b ? Py_True: Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { return PyLong_FromSize_t(ival); } /* MultiPhaseInitModuleState */ #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE #ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE #if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 #else #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 #endif #endif #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS #error "Module state with PEP489 requires atomics. Currently that's one of\ C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" #endif #if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE #define __Pyx_ModuleStateLookup_Lock() #define __Pyx_ModuleStateLookup_Unlock() #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; #define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) #define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) #elif defined(__cplusplus) && __cplusplus >= 201103L #include static std::mutex __Pyx_ModuleStateLookup_mutex; #define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() #define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) #include static mtx_t __Pyx_ModuleStateLookup_mutex; static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; static void __Pyx_ModuleStateLookup_initialize_mutex(void) { mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); } #define __Pyx_ModuleStateLookup_Lock()\ call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ mtx_lock(&__Pyx_ModuleStateLookup_mutex) #define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) #elif defined(HAVE_PTHREAD_H) #include static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; #define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) #define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) #elif defined(_WIN32) #include // synchapi.h on its own doesn't work static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; #define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) #define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) #else #error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ Requires C standard >= C11, or C++ standard >= C++11,\ or pthreads, or the Windows 32 API, or Python >= 3.13." #endif typedef struct { int64_t id; PyObject *module; } __Pyx_InterpreterIdAndModule; typedef struct { char interpreter_id_as_index; Py_ssize_t count; Py_ssize_t allocated; __Pyx_InterpreterIdAndModule table[1]; } __Pyx_ModuleStateLookupData; #define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; #endif #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; #else static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; #endif static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( __Pyx_InterpreterIdAndModule* table, Py_ssize_t count, int64_t interpreterId) { __Pyx_InterpreterIdAndModule* begin = table; __Pyx_InterpreterIdAndModule* end = begin + count; if (begin->id == interpreterId) { return begin; } while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; if (halfway->id == interpreterId) { return halfway; } if (halfway->id < interpreterId) { begin = halfway; } else { end = halfway; } } for (; begin < end; ++begin) { if (begin->id >= interpreterId) return begin; } return begin; } static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); if (interpreter_id == -1) return NULL; #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); { __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); if (likely(data)) { __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); if (likely(data == new_data)) { goto read_finished; } } __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); __Pyx_ModuleStateLookup_Lock(); __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); __Pyx_ModuleStateLookup_Unlock(); } read_finished:; #else __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; #endif __Pyx_InterpreterIdAndModule* found = NULL; if (unlikely(!data)) goto end; if (data->interpreter_id_as_index) { if (interpreter_id < data->count) { found = data->table+interpreter_id; } } else { found = __Pyx_State_FindModuleStateLookupTableLowerBound( data->table, data->count, interpreter_id); } end: { PyObject *result=NULL; if (found && found->id == interpreter_id) { result = found->module; } #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); #endif return result; } } #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); } #else #define __Pyx_ModuleStateLookup_wait_until_no_readers() #endif static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { Py_ssize_t to_allocate = (*old_data)->allocated; while (to_allocate <= interpreter_id) { if (to_allocate == 0) to_allocate = 1; else to_allocate *= 2; } __Pyx_ModuleStateLookupData *new_data = *old_data; if (to_allocate != (*old_data)->allocated) { new_data = (__Pyx_ModuleStateLookupData *)realloc( *old_data, sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); if (!new_data) { PyErr_NoMemory(); return -1; } for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { new_data->table[i].id = i; new_data->table[i].module = NULL; } new_data->allocated = to_allocate; } new_data->table[interpreter_id].module = module; if (new_data->count < interpreter_id+1) { new_data->count = interpreter_id+1; } *old_data = new_data; return 0; } static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { __Pyx_InterpreterIdAndModule *read = data->table; __Pyx_InterpreterIdAndModule *write = data->table; __Pyx_InterpreterIdAndModule *end = read + data->count; for (; readmodule) { write->id = read->id; write->module = read->module; ++write; } } data->count = write - data->table; for (; writeid = 0; write->module = NULL; } data->interpreter_id_as_index = 0; } static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); if (interpreter_id == -1) return -1; int result = 0; __Pyx_ModuleStateLookup_Lock(); #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); #else __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; #endif __Pyx_ModuleStateLookupData *new_data = old_data; if (!new_data) { new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); if (!new_data) { result = -1; PyErr_NoMemory(); goto end; } new_data->allocated = 1; new_data->interpreter_id_as_index = 1; } __Pyx_ModuleStateLookup_wait_until_no_readers(); if (new_data->interpreter_id_as_index) { if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); goto end; } __Pyx_State_ConvertFromInterpIdAsIndex(new_data); } { Py_ssize_t insert_at = 0; { __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( new_data->table, new_data->count, interpreter_id); assert(lower_bound); insert_at = lower_bound - new_data->table; if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { lower_bound->module = module; goto end; // already in table, nothing more to do } } if (new_data->count+1 >= new_data->allocated) { Py_ssize_t to_allocate = (new_data->count+1)*2; new_data = (__Pyx_ModuleStateLookupData*)realloc( new_data, sizeof(__Pyx_ModuleStateLookupData) + (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); if (!new_data) { result = -1; new_data = old_data; PyErr_NoMemory(); goto end; } new_data->allocated = to_allocate; } ++new_data->count; int64_t last_id = interpreter_id; PyObject *last_module = module; for (Py_ssize_t i=insert_at; icount; ++i) { int64_t current_id = new_data->table[i].id; new_data->table[i].id = last_id; last_id = current_id; PyObject *current_module = new_data->table[i].module; new_data->table[i].module = last_module; last_module = current_module; } } end: #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); #else __Pyx_ModuleStateLookup_data = new_data; #endif __Pyx_ModuleStateLookup_Unlock(); return result; } static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); if (interpreter_id == -1) return -1; __Pyx_ModuleStateLookup_Lock(); #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); #else __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; #endif if (data->interpreter_id_as_index) { if (interpreter_id < data->count) { data->table[interpreter_id].module = NULL; } goto done; } { __Pyx_ModuleStateLookup_wait_until_no_readers(); __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( data->table, data->count, interpreter_id); if (!lower_bound) goto done; if (lower_bound->id != interpreter_id) goto done; __Pyx_InterpreterIdAndModule *end = data->table+data->count; for (;lower_boundid = (lower_bound+1)->id; lower_bound->module = (lower_bound+1)->module; } } --data->count; if (data->count == 0) { free(data); data = NULL; } done: #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); #else __Pyx_ModuleStateLookup_data = data; #endif __Pyx_ModuleStateLookup_Unlock(); return 0; } #endif /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/pgproto.pxd0000644000175100017510000000065615111154236020260 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/pgproto.pyi0000644000175100017510000000063315111154236020261 0ustar00runnerrunnerimport codecs import typing import uuid class CodecContext: def get_text_codec(self) -> codecs.CodecInfo: ... def get_json_decoder(self) -> object: ... def get_json_encoder(self) -> object: ... @typing.final class ReadBuffer: ... @typing.final class WriteBuffer: ... class BufferError(Exception): ... @typing.final class UUID(uuid.UUID): def __init__(self, inp: typing.AnyStr) -> None: ... ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/pgproto.pyx0000644000175100017510000000234115111154236020276 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/tohex.h0000644000175100017510000000272215111154236017345 0ustar00runnerrunner#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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/tohex.pxd0000644000175100017510000000055115111154236017707 0ustar00runnerrunner# 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/types.py0000644000175100017510000003074715111154236017573 0ustar00runnerrunner# 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: import builtins import sys if sys.version_info < (3, 11): from typing_extensions import Self else: from typing import Self __all__ = ( 'BitString', 'Point', 'Path', 'Polygon', 'Box', 'Line', 'LineSegment', 'Circle', ) _BitOrderType = typing.Literal['big', 'little'] class BitString: """Immutable representation of PostgreSQL `bit` and `varbit` types.""" __slots__ = '_bytes', '_bitlength' _bytes: bytes _bitlength: int def __init__(self, bitstring: builtins.bytes | None = 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, bytes_: builtins.bytes | None = None, bitlength: int | None = None) -> Self: 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, x: int, length: int, bitorder: _BitOrderType = 'big', *, signed: bool = False) \ -> Self: """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.SupportsFloat | typing.SupportsIndex | str | builtins.bytes | builtins.bytearray ), y: ( typing.SupportsFloat | typing.SupportsIndex | str | builtins.bytes | builtins.bytearray ) ) -> Self: 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]) -> Self: 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) -> Self: 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]) -> Self: 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: int | slice ) -> 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) -> Self: 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=1764022430.0 asyncpg-0.31.0/asyncpg/pgproto/uuid.pyx0000644000175100017510000002400315111154236017551 0ustar00runnerrunnerimport 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 ] 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. # # The or 0 works around a bug interaction between cpython # 3.10 and earlier and Cython ~3.0.11 in which # int.from_bytes returns a "non-canonical 0" and then # Cython's implementation of & mishandles it. # See cython/cython#6480. self._int = int.from_bytes(self.bytes, 'big') or 0 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) # pg_UUID = UUID ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/pool.py0000644000175100017510000012260015111154235015673 0ustar00runnerrunner# 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 asyncio from collections.abc import Awaitable, Callable import functools import inspect import logging import time from types import TracebackType from typing import Any, Optional, Type 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: str, bases: tuple[Type[Any], ...], dct: dict[str, Any], *, wrap: bool = False, ) -> PoolConnectionProxyMeta: 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: str, iscoroutine: bool ) -> Callable[..., Any]: def call_con_method(self: Any, *args: Any, **kwargs: Any) -> Any: # 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 ) -> None: self._con = con self._holder = holder con._set_proxy(self) def __getattr__(self, attr: str) -> Any: # Proxy all unresolved attributes to the wrapped Connection object. return getattr(self._con, attr) def _detach(self) -> Optional[connection.Connection]: if self._con is None: return con, self._con = self._con, None con._set_proxy(None) return con def __repr__(self) -> str: 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: "Pool", *, max_queries: float, setup: Optional[Callable[[PoolConnectionProxy], Awaitable[None]]], max_inactive_time: float, ) -> None: self._pool = pool self._con: Optional[connection.Connection] = None self._proxy: Optional[PoolConnectionProxy] = None self._max_queries = max_queries self._max_inactive_time = max_inactive_time self._setup = setup self._inactive_callback: Optional[Callable] = None self._in_use: Optional[asyncio.Future] = None self._timeout: Optional[float] = None self._generation: Optional[int] = None def is_connected(self) -> bool: return self._con is not None and not self._con.is_closed() def is_idle(self) -> bool: return not self._in_use async def connect(self) -> None: 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: Optional[float]) -> None: 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) -> None: if self._in_use is None: return else: await self._in_use async def close(self) -> None: if self._con is not None: # Connection.close() will call _release_on_close() to # finish holder cleanup. await self._con.close() def terminate(self) -> None: 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) -> None: 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) -> None: if self._inactive_callback is not None: self._inactive_callback.cancel() self._inactive_callback = None def _deactivate_inactive_connection(self) -> None: 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) -> None: self._maybe_cancel_inactive_callback() self._release() self._con = None def _release(self) -> None: """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: Optional[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: Optional[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: Pool, timeout: Optional[float]) -> None: 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_type: Optional[Type[BaseException]] = None, exc_val: Optional[BaseException] = None, exc_tb: Optional[TracebackType] = None, ) -> None: 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=1764022429.0 asyncpg-0.31.0/asyncpg/prepared_stmt.py0000644000175100017510000002306715111154235017602 0ustar00runnerrunner# 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 import typing 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: typing.Optional[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) ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1764022438.292822 asyncpg-0.31.0/asyncpg/protocol/0000755000175100017510000000000015111154246016212 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/__init__.py0000644000175100017510000000054715111154235020327 0ustar00runnerrunner# 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, NO_TIMEOUT, BUILTIN_TYPE_NAME_MAP from .record import Record ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1764022438.2938218 asyncpg-0.31.0/asyncpg/protocol/codecs/0000755000175100017510000000000015111154246017452 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/codecs/__init__.py0000644000175100017510000000000015111154235021547 0ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/codecs/array.pyx0000644000175100017510000007145615111154235021345 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/codecs/base.pxd0000644000175100017510000001472615111154235021111 0ustar00runnerrunner# 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 class CodecMap: cdef: void** binary_codec_map void** text_codec_map dict extra_codecs cdef inline void *get_binary_codec_ptr(self, uint32_t idx) cdef inline void set_binary_codec_ptr(self, uint32_t idx, void *ptr) cdef inline void *get_text_codec_ptr(self, uint32_t idx) cdef inline void set_text_codec_ptr(self, uint32_t idx, void *ptr) 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/codecs/base.pyx0000644000175100017510000010323415111154235021127 0ustar00runnerrunner# 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 # The class indirection is needed because Cython # does not (as of 3.1.0) store global cdef variables # in module state. @cython.final cdef class CodecMap: def __cinit__(self): self.extra_codecs = {} self.binary_codec_map = cpython.PyMem_Calloc( (MAXSUPPORTEDOID + 1) * 2, sizeof(void *)) self.text_codec_map = cpython.PyMem_Calloc( (MAXSUPPORTEDOID + 1) * 2, sizeof(void *)) cdef inline void *get_binary_codec_ptr(self, uint32_t idx): return self.binary_codec_map[idx] cdef inline void set_binary_codec_ptr(self, uint32_t idx, void *ptr): self.binary_codec_map[idx] = ptr cdef inline void *get_text_codec_ptr(self, uint32_t idx): return self.text_codec_map[idx] cdef inline void set_text_codec_ptr(self, uint32_t idx, void *ptr): self.text_codec_map[idx] = ptr codec_map = CodecMap() @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 = RecordDescriptor( 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 = self.record_desc.make_record(asyncpg.Record, 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) recordcapi.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 = (codec_map).get_binary_codec_ptr(oid * xformat) elif format == PG_FORMAT_TEXT: ptr = (codec_map).get_text_codec_ptr(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 ( (codec_map).get_binary_codec_ptr(oid) != NULL or (codec_map).get_text_codec_ptr(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: (codec_map).set_binary_codec_ptr(oid * xformat, codec) elif format == PG_FORMAT_TEXT: (codec_map).set_text_codec_ptr(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) (codec_map).extra_codecs[name, format] = codec cdef inline Codec get_extra_codec(str name, ServerDataFormat format): return (codec_map).extra_codecs.get((name, format)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/codecs/pgproto.pyx0000644000175100017510000004142715111154235021714 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/codecs/range.pyx0000644000175100017510000001432715111154235021315 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/codecs/record.pyx0000644000175100017510000000447215111154235021477 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/codecs/textutils.pyx0000644000175100017510000000373315111154235022265 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/consts.pxi0000644000175100017510000000057515111154235020252 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/coreproto.pxd0000644000175100017510000001410715111154235020744 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/coreproto.pyx0000644000175100017510000012005515111154235020771 0ustar00runnerrunner# 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" 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 SYNC_MESSAGE = bytes(WriteBuffer.new_message(b'S').end_message()) FLUSH_MESSAGE = bytes(WriteBuffer.new_message(b'H').end_message()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/cpythonx.pxd0000644000175100017510000000114515111154235020602 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/encodings.pyx0000644000175100017510000000314215111154235020723 0ustar00runnerrunner# 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 ''' 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/pgtypes.pxi0000644000175100017510000001540615111154235020433 0ustar00runnerrunner# 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 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/prepared_stmt.pxd0000644000175100017510000000213315111154235021575 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/prepared_stmt.pyx0000644000175100017510000003135415111154235021631 0ustar00runnerrunner# 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 = RecordDescriptor({}, ()) 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 = RecordDescriptor( 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 = self.cols_desc.make_record(self.record_class, 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) recordcapi.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=1764022438.0 asyncpg-0.31.0/asyncpg/protocol/protocol.c0000644000175100017510002274433415111154246020242 0ustar00runnerrunner/* Generated by Cython 3.2.1 */ /* 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" ] }, "module_name": "asyncpg.protocol.protocol" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ /* InitLimitedAPI */ #if defined(Py_LIMITED_API) #if !defined(CYTHON_LIMITED_API) #define CYTHON_LIMITED_API 1 #endif #elif defined(CYTHON_LIMITED_API) #ifdef _MSC_VER #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.") #else #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead. #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else #define __PYX_ABI_VERSION "3_2_1" #define CYTHON_HEX_VERSION 0x030201F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #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 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_CPYTHON_FREETHREADING 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 #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_AVOID_THREAD_UNSAFE_BORROWED_REFS #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_ASSUME_SAFE_SIZE #define CYTHON_ASSUME_SAFE_SIZE 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 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_SYS_MONITORING #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_AM_SEND #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #undef CYTHON_IMMORTAL_CONSTANTS #define CYTHON_IMMORTAL_CONSTANTS 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_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #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_AVOID_THREAD_UNSAFE_BORROWED_REFS #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #ifndef CYTHON_ASSUME_SAFE_SIZE #define CYTHON_ASSUME_SAFE_SIZE 1 #endif #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 #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_SYS_MONITORING #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) #endif #undef CYTHON_USE_AM_SEND #define CYTHON_USE_AM_SEND 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 (PYPY_VERSION_NUM >= 0x07031100) #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #undef CYTHON_IMMORTAL_CONSTANTS #define CYTHON_IMMORTAL_CONSTANTS 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_CPYTHON_FREETHREADING 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_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 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_ASSUME_SAFE_SIZE #define CYTHON_ASSUME_SAFE_SIZE 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 (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #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 #undef CYTHON_USE_SYS_MONITORING #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #ifndef CYTHON_USE_AM_SEND #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) #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 #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #undef CYTHON_IMMORTAL_CONSTANTS #define CYTHON_IMMORTAL_CONSTANTS 0 #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 #ifdef Py_GIL_DISABLED #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 #else #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #endif #if PY_VERSION_HEX < 0x030A0000 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #elif !defined(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 #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || 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 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_ASSUME_SAFE_SIZE #define CYTHON_ASSUME_SAFE_SIZE 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #elif !defined(CYTHON_FAST_GIL) #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #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_SYS_MONITORING #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #ifndef CYTHON_USE_AM_SEND #define CYTHON_USE_AM_SEND 1 #endif #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #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 && !CYTHON_USE_MODULE_STATE) #endif #ifndef 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 (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000 #undef CYTHON_IMMORTAL_CONSTANTS #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work #elif !defined(CYTHON_IMMORTAL_CONSTANTS) #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif #ifndef CYTHON_COMPRESS_STRINGS #define CYTHON_COMPRESS_STRINGS 1 #endif #ifndef CYTHON_FAST_PYCCALL #define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif #ifndef CYTHON_VECTORCALL #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #else #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL) #endif #endif #if CYTHON_USE_PYLONG_INTERNALS #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 && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING # 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) #include typedef uintptr_t __pyx_uintptr_t; #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 #ifndef Py_UNREACHABLE #define Py_UNREACHABLE() assert(0); abort() #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 < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) /* CInitCode */ #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 /* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API #ifndef CO_OPTIMIZED static int CO_OPTIMIZED; #endif #ifndef CO_NEWLOCALS static int CO_NEWLOCALS; #endif #ifndef CO_VARARGS static int CO_VARARGS; #endif #ifndef CO_VARKEYWORDS static int CO_VARKEYWORDS; #endif #ifndef CO_ASYNC_GENERATOR static int CO_ASYNC_GENERATOR; #endif #ifndef CO_GENERATOR static int CO_GENERATOR; #endif #ifndef CO_COROUTINE static int CO_COROUTINE; #endif #else #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #endif static int __Pyx_init_co_variables(void); #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 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 Py_TPFLAGS_IMMUTABLETYPE #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8) #endif #ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7) #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #ifndef 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)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_VERSION_HEX >= 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)(void)) { #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 PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000) #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_PyFrame_SetLineNumber(frame, lineno) #elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno)) #elif CYTHON_COMPILING_IN_GRAAL #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _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() #else #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif #if CYTHON_USE_MODULE_STATE 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; } #define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else #define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) #define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) #define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) #define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #if CYTHON_COMPILING_IN_CPYTHON && 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 !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) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #endif #define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS #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 __Pyx_PyUnicode_READY(op) (0) #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)) #else #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_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 #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) #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_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #elif 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 enum __Pyx_ReferenceSharing { __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check __Pyx_ReferenceSharing_OwnStrongReference, __Pyx_ReferenceSharing_FunctionArgument, __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar }; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000 #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\ (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\ (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\ (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0))) #elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1) #else #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) #endif #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) #else #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) #endif #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) #endif #else #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) #endif #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #else #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { *result = PyObject_GetItem(dict, key); if (*result == NULL) { if (PyErr_ExceptionMatches(PyExc_KeyError)) { PyErr_Clear(); return 0; } return -1; } return 1; } #else static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { *result = PyDict_GetItemWithError(dict, key); if (*result == NULL) { return PyErr_Occurred() ? -1 : 0; } Py_INCREF(*result); return 1; } #endif #if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) #else #define __Pyx_VISIT_CONST(obj) #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_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) #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_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) #endif #if CYTHON_ASSUME_SAFE_SIZE #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) #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else #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) #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t #define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t #if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 #define __Pyx_PySendResult PySendResult #else typedef enum { PYGEN_RETURN = 0, PYGEN_ERROR = -1, PYGEN_NEXT = 1, } __Pyx_PySendResult; #endif #if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); #else #define __Pyx_pyiter_sendfunc sendfunc #endif #if !CYTHON_USE_AM_SEND #define __PYX_HAS_PY_AM_SEND 0 #elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 #define __PYX_HAS_PY_AM_SEND 1 #else #define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation #endif #if __PYX_HAS_PY_AM_SEND < 2 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) #endif #if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) #else #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif #if PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() #else #define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp #endif #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 #ifdef __cplusplus extern "C" #endif PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); #endif #if CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { int value; PyObject *py_value = PyObject_GetAttrString(inspect, name); if (!py_value) return 0; value = (int) PyLong_AsLong(py_value); Py_DECREF(py_value); *write_to = value; return value != -1 || !PyErr_Occurred(); } static int __Pyx_init_co_variables(void) { PyObject *inspect; int result; inspect = PyImport_ImportModule("inspect"); result = #if !defined(CO_OPTIMIZED) __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && #endif #if !defined(CO_NEWLOCALS) __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && #endif #if !defined(CO_VARARGS) __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && #endif #if !defined(CO_VARKEYWORDS) __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && #endif #if !defined(CO_ASYNC_GENERATOR) __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && #endif #if !defined(CO_GENERATOR) __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && #endif #if !defined(CO_COROUTINE) __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && #endif 1; Py_DECREF(inspect); return result ? 0 : -1; } #else static int __Pyx_init_co_variables(void) { return 0; // It's a limited API-only feature } #endif /* MathInitCode */ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #endif #include #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME #define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 #endif #ifndef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME #endif #if CYTHON_CLINE_IN_TRACEBACK #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; } #else #define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } #endif #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 #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) #else #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) #endif #include #if PY_MAJOR_VERSION <= 2 #define PyDict_GetItemWithError _PyDict_GetItemWithError #endif #if PY_VERSION_HEX < 0x030d0000 static CYTHON_INLINE int __Pyx_PyWeakref_GetRef(PyObject *ref, PyObject **pobj) { PyObject *obj = PyWeakref_GetObject(ref); if (obj == NULL) { // SystemError if ref is NULL *pobj = NULL; return -1; } if (obj == Py_None) { *pobj = NULL; return 0; } Py_INCREF(obj); *pobj = obj; return 1; } #else #define __Pyx_PyWeakref_GetRef PyWeakref_GetRef #endif #include "pythread.h" #if (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 #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 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #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 CYTHON_ASSUME_SAFE_MACROS #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_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) #else #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) #endif #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_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) return Py_NewRef(obj); #else Py_INCREF(obj); return obj; #endif } static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) return Py_XNewRef(obj); #else Py_XINCREF(obj); return obj; #endif } static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); 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_Long(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_PyLong_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)) #define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else #define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif #define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #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 __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #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__ */ /* PretendToInitialize */ #ifdef __cplusplus #if __cplusplus > 201103L #include #endif template static void __Pyx_pretend_to_initialize(T* ptr) { #if __cplusplus > 201103L if ((std::is_trivially_default_constructible::value)) #endif *ptr = T(); (void)ptr; } #else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #endif #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char* const __pyx_f[] = { "asyncpg/protocol/protocol.pyx", "asyncpg/protocol/codecs/base.pyx", "asyncpg/protocol/codecs/array.pyx", "asyncpg/protocol/scram.pyx", ".eggs/cython-3.2.1-py3.14-linux-x86_64.egg/Cython/Includes/cpython/contextvars.pxd", "asyncpg/pgproto/frb.pxd", "asyncpg/pgproto/buffer.pxd", "asyncpg/protocol/encodings.pyx", "asyncpg/protocol/settings.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.pyx", "asyncpg/protocol/coreproto.pxd", "asyncpg/protocol/prepared_stmt.pyx", "asyncpg/protocol/prepared_stmt.pxd", "asyncpg/protocol/protocol.pxd", ".eggs/cython-3.2.1-py3.14-linux-x86_64.egg/Cython/Includes/cpython/type.pxd", ".eggs/cython-3.2.1-py3.14-linux-x86_64.egg/Cython/Includes/cpython/bool.pxd", ".eggs/cython-3.2.1-py3.14-linux-x86_64.egg/Cython/Includes/cpython/complex.pxd", "asyncpg/protocol/pgtypes.pxi", }; /* #### Code section: utility_code_proto_before_types ### */ /* Atomics.proto (used by UnpackUnboundCMethod) */ #include #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 #endif #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS #define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __pyx_atomic_int_type int #define __pyx_nonatomic_int_type int #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ (__STDC_VERSION__ >= 201112L) &&\ !defined(__STDC_NO_ATOMICS__)) #include #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ (__cplusplus >= 201103L) ||\ (defined(_MSC_VER) && _MSC_VER >= 1700))) #include #endif #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ (__STDC_VERSION__ >= 201112L) &&\ !defined(__STDC_NO_ATOMICS__) &&\ ATOMIC_INT_LOCK_FREE == 2) #undef __pyx_atomic_int_type #define __pyx_atomic_int_type atomic_int #define __pyx_atomic_ptr_type atomic_uintptr_t #define __pyx_nonatomic_ptr_type uintptr_t #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) #define __pyx_atomic_load(value) atomic_load(value) #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C atomics") #elif defined(__PYX_DEBUG_ATOMICS) #warning "Using standard C atomics" #endif #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ (__cplusplus >= 201103L) ||\ \ (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ ATOMIC_INT_LOCK_FREE == 2) #undef __pyx_atomic_int_type #define __pyx_atomic_int_type std::atomic_int #define __pyx_atomic_ptr_type std::atomic_uintptr_t #define __pyx_nonatomic_ptr_type uintptr_t #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) #define __pyx_atomic_load(value) std::atomic_load(value) #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C++ atomics") #elif defined(__PYX_DEBUG_ATOMICS) #warning "Using standard C++ atomics" #endif #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ (__GNUC_MINOR__ > 1 ||\ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) #define __pyx_atomic_ptr_type void* #define __pyx_nonatomic_ptr_type void* #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); int result = old == *expected; *expected = old; return result; } #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired); int result = old == *expected; *expected = old; return result; } #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif #elif CYTHON_ATOMICS && defined(_MSC_VER) #include #undef __pyx_atomic_int_type #define __pyx_atomic_int_type long #define __pyx_atomic_ptr_type void* #undef __pyx_nonatomic_int_type #define __pyx_nonatomic_int_type long #define __pyx_nonatomic_ptr_type void* #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); int result = old == *expected; *expected = old; return result; } #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected); int result = old == *expected; *expected = old; return result; } #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif #else #undef CYTHON_ATOMICS #define CYTHON_ATOMICS 0 #ifdef __PYX_DEBUG_ATOMICS #warning "Not using atomics" #endif #endif /* CriticalSectionsDefinition.proto (used by CriticalSections) */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyCriticalSection void* #define __Pyx_PyCriticalSection2 void* #define __Pyx_PyCriticalSection_End(cs) #define __Pyx_PyCriticalSection2_End(cs) #else #define __Pyx_PyCriticalSection PyCriticalSection #define __Pyx_PyCriticalSection2 PyCriticalSection2 #define __Pyx_PyCriticalSection_End PyCriticalSection_End #define __Pyx_PyCriticalSection2_End PyCriticalSection2_End #endif /* CriticalSections.proto (used by ParseKeywordsImpl) */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs) #define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs) #else #define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin #define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin #endif #if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_BEGIN_CRITICAL_SECTION(o) { #define __Pyx_END_CRITICAL_SECTION() } #else #define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION #define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif /* IncludeStructmemberH.proto (used by FixUpExtensionType) */ #include /* #### 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_CodecMap; 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":116 * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * 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":134 * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * 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":69 * * * 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":70 * * 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":71 * 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":72 * 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":137 * cdef bytes consume_message(self) * cdef discard_message(self) * cdef int32_t 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":37 * * * 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":47 * * * 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":53 * * * 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":196 * 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":829 * * * 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":848 * * * 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":872 * * * 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":15 * * * 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[1024]; char *_buf; Py_ssize_t _size; Py_ssize_t _length; int _view_count; int _message_mode; }; /* "asyncpg/pgproto/buffer.pxd":75 * * * 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":25 * * * cdef class CodecMap: # <<<<<<<<<<<<<< * cdef: * void** binary_codec_map */ struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CodecMap *__pyx_vtab; void **binary_codec_map; void **text_codec_map; PyObject *extra_codecs; }; /* "asyncpg/protocol/codecs/base.pxd":58 * * * 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":191 * * * 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":139 * self.transport.pause_reading() * * async def prepare(self, stmt_name, query, timeout, # <<<<<<<<<<<<<< * *, * PreparedStatementState state=None, */ 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 * * async def bind_execute( # <<<<<<<<<<<<<< * self, * state: PreparedStatementState, */ 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; int __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":207 * return await waiter * * async def bind_execute_many( # <<<<<<<<<<<<<< * self, * state: PreparedStatementState, */ 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; int __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":228 * # 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":268 * return await waiter * * 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":296 * return await waiter * * async def execute(self, PreparedStatementState state, # <<<<<<<<<<<<<< * str portal_name, int limit, return_extra, * timeout): */ 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":325 * return await waiter * * async def close_portal(self, str portal_name, timeout): # <<<<<<<<<<<<<< * * if self.cancel_waiter is not None: */ 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":347 * return await waiter * * async def query(self, query, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ 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":371 * return await waiter * * async def copy_out(self, copy_stmt, sink, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ 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":424 * return status_msg * * async def copy_in(self, copy_stmt, reader, data, # <<<<<<<<<<<<<< * records, PreparedStatementState record_stmt, timeout): * cdef: */ 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":562 * return status_msg * * async def close_statement(self, PreparedStatementState state, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ 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":602 * self.transport = None * * async def close(self, timeout): # <<<<<<<<<<<<<< * if self.closing: * return */ 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":744 * ) * * async def _wait_for_cancellation(self): # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ 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":15 * * * 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 *(*__pyx_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":75 * * * 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 *); int32_t (*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":17 * # does not (as of 3.1.0) store global cdef variables * # in module state. * @cython.final # <<<<<<<<<<<<<< * cdef class CodecMap: * */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CodecMap { void *(*get_binary_codec_ptr)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t); void (*set_binary_codec_ptr)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *); void *(*get_text_codec_ptr)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t); void (*set_text_codec_ptr)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CodecMap *__pyx_vtabptr_7asyncpg_8protocol_8protocol_CodecMap; static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t); static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *); static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t); static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *); /* "asyncpg/protocol/codecs/base.pyx":43 * * * @cython.final # <<<<<<<<<<<<<< * cdef class Codec: * */ 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":509 * * * 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":11 * * * @cython.final # <<<<<<<<<<<<<< * cdef class ConnectionSettings(pgproto.CodecContext): * */ 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":17 * * * @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":11 * * * @cython.final # <<<<<<<<<<<<<< * cdef class PreparedStatementState: * */ 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":76 * * * 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; #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);\ } #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 (used by PyObjectGetAttrStrNoError) */ #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 (used by PyErrFetchRestore) */ #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 (used by PyObjectGetAttrStrNoError) */ #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 (used by PyObjectGetAttrStrNoError) */ #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 (used by GetBuiltinName) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyDictVersioning.proto (used by GetModuleGlobalName) */ #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_XNewRef(__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_mstate_global->__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 /* PyObjectCall.proto (used by PyObjectFastCall) */ #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 /* PyObjectCallMethO.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto (used by PyObjectFastCallMethod) */ #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 * const*args, size_t nargs, PyObject *kwargs); /* PyObjectFastCallMethod.proto */ #if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL) #else static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf); #endif /* TupleAndListFromArray.proto (used by fastcall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); #endif #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto (used by BytesEquals) */ #include /* BytesEquals.proto (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) #else #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) #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_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_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_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #else #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_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 #endif #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) #else #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); /* py_dict_items.proto (used by OwnedDictNext) */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); /* CallCFunction.proto (used by CallUnboundCMethod0) */ #define __Pyx_CallCFunction(cfunc, self, args)\ ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) #define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) #define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) #define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) /* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */ typedef struct { PyObject *type; PyObject **method_name; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS __pyx_atomic_int_type initialized; #endif PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { #if !CYTHON_ATOMICS return 1; #else __pyx_nonatomic_int_type expected = 0; if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { return 0; } return expected; #endif } static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { #if CYTHON_ATOMICS __pyx_atomic_store(&cfunc->initialized, 2); #endif } #else #define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 #define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) #endif /* CallUnboundCMethod0.proto */ CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #else #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif /* py_dict_values.proto (used by OwnedDictNext) */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); /* OwnedDictNext.proto (used by RejectKeywords) */ #if CYTHON_AVOID_BORROWED_REFS static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue); #else CYTHON_INLINE static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue); #endif /* RejectKeywords.export */ static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywordsImpl.export */ static int __Pyx_ParseKeywordsTuple( PyObject *kwds, PyObject * const *kwvalues, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs ); static int __Pyx_ParseKeywordDictToDict( PyObject *kwds, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name ); static int __Pyx_ParseKeywordDict( PyObject *kwds, PyObject ** const argnames[], PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs ); /* CallUnboundCMethod2.proto */ CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON 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 /* ParseKeywords.proto */ static CYTHON_INLINE int __Pyx_ParseKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs ); /* RaiseException.export */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* DictGetItem.proto */ #if !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 (used by SaveResetException) */ #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 /* PyKeyError_Check.proto */ #define __Pyx_PyExc_KeyError_Check(obj) __Pyx_TypeCheck(obj, PyExc_KeyError) /* 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 /* PyAttributeError_Check.proto */ #define __Pyx_PyExc_AttributeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AttributeError) /* PyTypeError_Check.proto */ #define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError) /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\ (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, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (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, int unsafe_shared); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (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, int unsafe_shared); 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, int unsafe_shared); /* 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 /* PyValueError_Check.proto */ #define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError) /* PyObjectVectorCallKwBuilder.proto */ CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); #if CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03090000 #define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall #else #define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall #endif #define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); #else #define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict #define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) #define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) #define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) #endif /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* PyOverflowError_Check.proto */ #define __Pyx_PyExc_OverflowError_Check(obj) __Pyx_TypeCheck(obj, PyExc_OverflowError) /* 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 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 /* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* py_dict_pop_ignore.proto */ static CYTHON_INLINE int __Pyx_PyDict_Pop_ignore(PyObject *d, PyObject *key, PyObject *default_value); /* JoinPyUnicode.export */ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, 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) /* ArgTypeTestFunc.export */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* 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)) /* PyObjectFormatAndDecref.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); /* BuildPyUnicode.proto (used by COrdinalToPyUnicode) */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength, int prepend_sign, char padding_char); /* COrdinalToPyUnicode.proto (used by CIntToPyUnicode) */ static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value); static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char); /* GCCDiagnostics.proto (used by CIntToPyUnicode) */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* IncludeStdlibH.proto (used by CIntToPyUnicode) */ #include /* CIntToPyUnicode.proto */ #define __Pyx_PyUnicode_From_uint32_t(value, width, padding_char, format_char) (\ ((format_char) == ('c')) ?\ __Pyx_uchar___Pyx_PyUnicode_From_uint32_t(value, width, padding_char) :\ __Pyx____Pyx_PyUnicode_From_uint32_t(value, width, padding_char, format_char)\ ) static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_uint32_t(uint32_t value, Py_ssize_t width, char padding_char); static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_uint32_t(uint32_t value, Py_ssize_t width, char padding_char, char format_char); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* PyObjectCall2Args.proto (used by CallUnboundCMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* CallUnboundCMethod1.proto */ CYTHON_UNUSED 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 /* 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 /* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* RaiseUnboundLocalError.proto */ static void __Pyx_RaiseUnboundLocalError(const char *varname); /* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static CYTHON_INLINE PyObject* __Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyLong_AddCObj(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* CIntToPyUnicode.proto */ #define __Pyx_PyUnicode_From_long(value, width, padding_char, format_char) (\ ((format_char) == ('c')) ?\ __Pyx_uchar___Pyx_PyUnicode_From_long(value, width, padding_char) :\ __Pyx____Pyx_PyUnicode_From_long(value, width, padding_char, format_char)\ ) static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char); static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char); /* PyObjectVectorCallMethodKwBuilder.proto */ #if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 #define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod #else static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames); #endif /* 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 *); /* PyIndexError_Check.proto */ #define __Pyx_PyExc_IndexError_Check(obj) __Pyx_TypeCheck(obj, PyExc_IndexError) /* 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 void __Pyx_RaiseClosureNameError(const char *varname); /* PyUnicodeEncodeError_Check.proto */ #define __Pyx_PyExc_UnicodeEncodeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_UnicodeEncodeError) /* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 #define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) #else #define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n) #endif /* 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) __Pyx_PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* CIntToPyUnicode.proto */ #define __Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(value, width, padding_char, format_char) (\ ((format_char) == ('c')) ?\ __Pyx_uchar___Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(value, width, padding_char) :\ __Pyx____Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(value, width, padding_char, format_char)\ ) static CYTHON_INLINE PyObject* __Pyx_uchar___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); static CYTHON_INLINE PyObject* __Pyx____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); /* HasAttr.proto (used by ImportImpl) */ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) #else static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); #endif /* ImportImpl.export */ static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level); /* Import.proto */ static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level); /* PyModuleNotFoundError_Check.proto */ #define __Pyx_PyExc_ModuleNotFoundError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ModuleNotFoundError) /* decode_c_string_utf16.proto (used by decode_c_bytes) */ 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 (used by decode_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)); /* 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 && CYTHON_ASSUME_SAFE_SIZE 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); } /* PyObjectCallNoArg.proto (used by PyObjectCallMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto (used by PyObjectCallMethod0) */ #if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); #endif /* PyObjectCallMethod0.proto (used by dict_iter) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto (used by UnpackTupleError) */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto (used by UnpackTuple2) */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto (used by dict_iter) */ static CYTHON_INLINE int __Pyx_unpack_tuple2( PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int 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); /* IterNextPlain.proto (used by IterNext) */ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); #endif /* IterNext.proto */ #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); /* PyStopIteration_Check.proto */ #define __Pyx_PyExc_StopIteration_Check(obj) __Pyx_TypeCheck(obj, PyExc_StopIteration) /* PyNotImplementedError_Check.proto */ #define __Pyx_PyExc_NotImplementedError_Check(obj) __Pyx_TypeCheck(obj, PyExc_NotImplementedError) /* CIntToPyUnicode.proto */ #define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\ ((format_char) == ('c')) ?\ __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\ __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\ ) static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char); static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char); /* UnicodeConcatInPlace.proto */ # if CYTHON_COMPILING_IN_CPYTHON #if CYTHON_REFNANNY #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared, __pyx_refnanny) #else #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared) #endif #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_DefinitelyUnique) #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_OwnStrongReference) #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_DefinitelyUnique) #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_SharedReference) static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared #if CYTHON_REFNANNY , void* __pyx_refnanny #endif ); #else #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace __Pyx_PyUnicode_Concat #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace __Pyx_PyUnicode_Concat #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace __Pyx_PyUnicode_Concat #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace __Pyx_PyUnicode_Concat #endif #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlaceSafe(left, right)\ ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right)) #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(left, right)\ ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right)) #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlaceSafe(left, right)\ ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right)) #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlaceSafe(left, right)\ ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right)) /* PyAssertionError_Check.proto */ #define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError) /* 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) static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { return 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) #ifdef PyExceptionInstance_Check #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) #else #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) #endif /* PyUnicode_Substring.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring( PyObject* text, Py_ssize_t start, Py_ssize_t stop); /* PyUnicode_Unicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj); /* 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)); } /* PyBufferError_Check.proto */ #define __Pyx_PyExc_BufferError_Check(obj) __Pyx_TypeCheck(obj, PyExc_BufferError) /* RaiseKeywordRequired.proto */ static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name); /* dict_setdefault.proto (used by FetchCommonType) */ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value); /* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); #endif /* SetItemOnTypeDict.proto (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v); #define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v) /* FixUpExtensionType.proto (used by FetchCommonType) */ static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); /* AddModuleRef.proto (used by FetchSharedCythonModule) */ #if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\ __PYX_LIMITED_VERSION_HEX < 0x030d0000) static PyObject *__Pyx_PyImport_AddModuleRef(const char *name); #else #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #endif /* FetchSharedCythonModule.proto (used by FetchCommonType) */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto (used by CommonTypesMetaclass) */ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); /* CommonTypesMetaclass.proto (used by CoroutineBase) */ static int __pyx_CommonTypesMetaclass_init(PyObject *module); #define __Pyx_CommonTypesMetaclass_USED /* CallTypeTraverse.proto (used by CoroutineBase) */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 #else static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif /* PyObjectCallMethod1.proto (used by CoroutineBase) */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* ReturnWithStopIteration.proto (used by CoroutineBase) */ static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); /* CoroutineBase.proto (used by Coroutine) */ 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; #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *gi_weakreflist; #endif PyObject *classobj; PyObject *yieldfrom; __Pyx_pyiter_sendfunc yieldfrom_am_send; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; #if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count]; uint64_t __pyx_pymonitoring_version; #endif 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 __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval); 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); static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen); static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen); static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen); static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure); #if __PYX_HAS_PY_AM_SEND == 2 static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send); #endif static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg); /* Coroutine.proto (used by CoroutineYieldFrom) */ #define __Pyx_Coroutine_USED #define __Pyx_Coroutine_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CoroutineType) #define __Pyx_Coroutine_Check(obj) __Pyx_Coroutine_CheckExact(obj) #define __Pyx_CoroutineAwait_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CoroutineAwaitType) #define __Pyx_Coroutine_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_mstate_global->__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 __Pyx_PySendResult __Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self); /* Coro_CheckExact.proto (used by GetAwaitIter) */ #if CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_PyCoro_CheckExact(PyObject *o); #else #define __Pyx_PyCoro_CheckExact PyCoro_CheckExact #endif /* GetAwaitIter.proto (used by CoroutineYieldFrom) */ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o); static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o); /* CoroutineYieldFrom.proto */ static CYTHON_INLINE __Pyx_PySendResult __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval); /* pyint_simplify.proto */ static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none); /* 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 (used by CythonFunctionShared) */ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); /* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */ #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto (used by CythonFunction) */ #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_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL __pyx_vectorcallfunc func_vectorcall; #endif #if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_dict; #endif 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 PyObject *defaults; 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_mstate_global->__pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)); #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 PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type); 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_COMPILING_IN_LIMITED_API #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); /* PyTimeoutError_Check.proto */ #define __Pyx_PyExc_TimeoutError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TimeoutError) /* PyObject_Unicode.proto */ #define __Pyx_PyObject_Unicode(obj)\ (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_LIMITED_API || 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 /* PyConnectionResetError_Check.proto */ #define __Pyx_PyExc_ConnectionResetError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ConnectionResetError) /* pybytes_as_double.proto (used by pynumber_float) */ 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 && CYTHON_ASSUME_SAFE_SIZE 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 && CYTHON_ASSUME_SAFE_SIZE 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 (used by pynumber_float) */ #if !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 !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)) /* AllocateExtensionType.proto */ static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final); /* 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); /* CheckTypeForFreelists.proto */ #if CYTHON_USE_FREELISTS #if CYTHON_USE_TYPE_SPECS #define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp))) #define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS Py_TPFLAGS_IS_ABSTRACT #else #define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size))) #define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE) #endif #define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\ (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\ (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS))) #endif /* ValidateBasesTuple.proto (used by PyType_Ready) */ #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 (used by MergeVTables) */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ static int __Pyx_MergeVtables(PyTypeObject *type); /* DelItemOnTypeDict.proto (used by SetupReduce) */ static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k); #define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k) /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_2_1 #define __PYX_HAVE_RT_ImportType_proto_3_2_1 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_2_1(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_2_1(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_2_1 { __Pyx_ImportType_CheckSize_Error_3_2_1 = 0, __Pyx_ImportType_CheckSize_Warn_3_2_1 = 1, __Pyx_ImportType_CheckSize_Ignore_3_2_1 = 2 }; static PyTypeObject *__Pyx_ImportType_3_2_1(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_1 check_size); #endif /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_2_1(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ListPack.proto */ static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && 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 (used by Py3ClassCreate) */ 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 (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #else #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif /* CodeObjectCache.proto (used by AddTraceback) */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject __Pyx_CachedCodeObjectType; #else typedef PyCodeObject __Pyx_CachedCodeObjectType; #endif typedef struct { __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING __pyx_atomic_int_type accessor_count; #endif }; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CheckUnpickleChecksum.proto */ static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members); /* UnicodeAsUCS4.proto */ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int32_t(int32_t value); /* CIntFromPy.proto */ static CYTHON_INLINE int32_t __Pyx_PyLong_As_int32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint64_t(uint64_t value); /* CIntFromPy.proto */ static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyLong_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint32_t(uint32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int64_t __Pyx_PyLong_As_int64_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int64_t(int64_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_ptrdiff_t(ptrdiff_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int16_t(int16_t value); /* ObjectAsUCS4.proto */ static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject*); static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject *x) { return (likely(PyUnicode_Check(x)) ? __Pyx_PyUnicode_AsPy_UCS4(x) : __Pyx__PyObject_AsPy_UCS4(x)); } /* UpdateUnpickledDict.proto */ static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName #else static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); #endif #else // !LIMITED_API typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* GetRuntimeVersion.proto */ #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 static unsigned long __Pyx_cached_runtime_version = 0; static void __Pyx_init_runtime_version(void); #else #define __Pyx_init_runtime_version() #endif static unsigned long __Pyx_get_runtime_version(void); /* Generator.proto */ #define __Pyx_Generator_USED #define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* DecompressString.proto */ static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo); /* MultiPhaseInitModuleState.proto */ #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE static PyObject *__Pyx_State_FindModule(void*); static int __Pyx_State_AddModule(PyObject* module, void*); static int __Pyx_State_RemoveModule(void*); #elif CYTHON_USE_MODULE_STATE #define __Pyx_State_FindModule PyState_FindModule #define __Pyx_State_AddModule PyState_AddModule #define __Pyx_State_RemoveModule PyState_RemoveModule #endif /* #### Code section: module_declarations ### */ /* CythonABIVersion.proto */ #if CYTHON_COMPILING_IN_LIMITED_API #if CYTHON_METH_FASTCALL #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" #else #define __PYX_FASTCALL_ABI_SUFFIX #endif #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX #else #define __PYX_LIMITED_ABI_SUFFIX #endif #if __PYX_HAS_PY_AM_SEND == 1 #define __PYX_AM_SEND_ABI_SUFFIX #elif __PYX_HAS_PY_AM_SEND == 2 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" #else #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" #endif #ifndef __PYX_MONITORING_ABI_SUFFIX #define __PYX_MONITORING_ABI_SUFFIX #endif #if CYTHON_USE_TP_FINALIZE #define __PYX_TP_FINALIZE_ABI_SUFFIX #else #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" #endif #if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) #define __PYX_FREELISTS_ABI_SUFFIX #else #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" #endif #define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ #endif #if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ #endif 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 CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx); /* proto*/ static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx, void *__pyx_v_ptr); /* proto*/ static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx); /* proto*/ static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx, void *__pyx_v_ptr); /* 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 "__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 "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.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.recordcapi" */ /* Module declarations from "asyncpg.pgproto.hton" */ /* Module declarations from "asyncpg.protocol.protocol" */ static PyObject *__pyx_7genexpr__pyx_v_7asyncpg_8protocol_8protocol_k; static PyObject *__pyx_7genexpr__pyx_v_7asyncpg_8protocol_8protocol_v; static Py_UCS4 *__pyx_v_7asyncpg_8protocol_8protocol_APG_NULL; 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_enumerate; static PyObject *__pyx_builtin_reversed; static PyObject *__pyx_builtin_any; static PyObject *__pyx_builtin_zip; /* #### Code section: string_decls ### */ /* #### 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_8CodecMap___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__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, int __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, int __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_CodecMap(PyTypeObject *t, PyObject *a, PyObject *k); /*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*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ /* SmallCodeConfig */ #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 typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; PyTypeObject *__pyx_ptype_7cpython_4type_type; PyTypeObject *__pyx_ptype_7cpython_4bool_bool; PyTypeObject *__pyx_ptype_7cpython_7complex_complex; PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer; PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer; PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext; PyObject *__pyx_type_7asyncpg_8protocol_8protocol_CodecMap; 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; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap; 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; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_k_; PyObject *__pyx_k__4; PyObject *__pyx_k__5; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__7; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__8; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__9; PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[86]; PyObject *__pyx_string_tab[939]; PyObject *__pyx_number_tab[109]; /* #### Code section: module_state_contents ### */ /* IterNextPlain.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; #endif /* CommonTypesMetaclass.module_state_decls */ PyTypeObject *__pyx_CommonTypesMetaclassType; /* Coroutine.module_state_decls */ PyTypeObject *__pyx_CoroutineType; PyTypeObject *__pyx_CoroutineAwaitType; /* Coro_CheckExact.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API PyObject *__Pyx_CachedCoroType; #endif /* CachedMethodType.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API PyObject *__Pyx_CachedMethodType; #endif /* CythonFunctionShared.module_state_decls */ PyTypeObject *__pyx_CyFunctionType; #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute; #endif #if CYTHON_USE_FREELISTS 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]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close[8]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close; #endif #if CYTHON_USE_FREELISTS 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]; int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation; #endif /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; /* Generator.module_state_decls */ PyTypeObject *__pyx_GeneratorType; /* #### Code section: module_state_end ### */ } __pyx_mstatetype; #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_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) #define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) #else static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: constant_name_defines ### */ #define __pyx_kp_u_Bind_expected_a_sequence_got __pyx_string_tab[0] #define __pyx_kp_u_Check_the_query_against_the_pass __pyx_string_tab[1] #define __pyx_kp_u_Codec_oid_elem_oid_core __pyx_string_tab[2] #define __pyx_kp_u_ConnectionSettings_r __pyx_string_tab[3] #define __pyx_kp_u_Consider_declaring_an_explicit_c __pyx_string_tab[4] #define __pyx_kp_u_GSSAPI_SSPI_authentication_is_on __pyx_string_tab[5] #define __pyx_kp_u_None __pyx_string_tab[6] #define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[7] #define __pyx_kp_u_Note_that_parameters_are_suppor __pyx_string_tab[8] #define __pyx_kp_u_OID __pyx_string_tab[9] #define __pyx_kp_u_OID_value_too_large_r __pyx_string_tab[10] #define __pyx_kp_u_PostgreSQL_does_not_implement_an __pyx_string_tab[11] #define __pyx_kp_u_TimoutError_was_not_raised __pyx_string_tab[12] #define __pyx_kp_u__14 __pyx_string_tab[13] #define __pyx_kp_u__15 __pyx_string_tab[14] #define __pyx_kp_u__16 __pyx_string_tab[15] #define __pyx_kp_u__17 __pyx_string_tab[16] #define __pyx_kp_u__18 __pyx_string_tab[17] #define __pyx_kp_u__19 __pyx_string_tab[18] #define __pyx_kp_u__20 __pyx_string_tab[19] #define __pyx_kp_u__21 __pyx_string_tab[20] #define __pyx_kp_u__22 __pyx_string_tab[21] #define __pyx_kp_u__23 __pyx_string_tab[22] #define __pyx_kp_u__24 __pyx_string_tab[23] #define __pyx_kp_u__25 __pyx_string_tab[24] #define __pyx_kp_u__3 __pyx_string_tab[25] #define __pyx_kp_u__6 __pyx_string_tab[26] #define __pyx_kp_u_a_sized_iterable_container_expec __pyx_string_tab[27] #define __pyx_kp_u_add_note __pyx_string_tab[28] #define __pyx_kp_u_already_connected __pyx_string_tab[29] #define __pyx_kp_u_array_length_overflow __pyx_string_tab[30] #define __pyx_kp_u_asyncpg_Protocol_has_no_referenc __pyx_string_tab[31] #define __pyx_kp_u_asyncpg_protocol_codecs_base_pyx __pyx_string_tab[32] #define __pyx_kp_u_asyncpg_protocol_coreproto_pyx __pyx_string_tab[33] #define __pyx_kp_u_asyncpg_protocol_prepared_stmt_p __pyx_string_tab[34] #define __pyx_kp_u_asyncpg_protocol_protocol_pyx __pyx_string_tab[35] #define __pyx_kp_u_asyncpg_protocol_scram_pyx __pyx_string_tab[36] #define __pyx_kp_u_asyncpg_protocol_settings_pyx __pyx_string_tab[37] #define __pyx_kp_u_base_codec_is_mutually_exclusive __pyx_string_tab[38] #define __pyx_kp_u_bit_varying __pyx_string_tab[39] #define __pyx_kp_u_bytes __pyx_string_tab[40] #define __pyx_kp_u_cannot_alias __pyx_string_tab[41] #define __pyx_kp_u_cannot_close_prepared_statement __pyx_string_tab[42] #define __pyx_kp_u_cannot_decode_type_text_encoding __pyx_string_tab[43] #define __pyx_kp_u_cannot_decode_type_text_encoding_2 __pyx_string_tab[44] #define __pyx_kp_u_cannot_perform_operation_another __pyx_string_tab[45] #define __pyx_kp_u_cannot_perform_operation_another_2 __pyx_string_tab[46] #define __pyx_kp_u_cannot_perform_operation_connect __pyx_string_tab[47] #define __pyx_kp_u_cannot_process_message __pyx_string_tab[48] #define __pyx_kp_u_cannot_register_core_codec_for_O __pyx_string_tab[49] #define __pyx_kp_u_cannot_switch_to_idle_state_prot __pyx_string_tab[50] #define __pyx_kp_u_cannot_switch_to_state_another_o __pyx_string_tab[51] #define __pyx_kp_u_cannot_switch_to_state_protocol __pyx_string_tab[52] #define __pyx_kp_u_character_varying __pyx_string_tab[53] #define __pyx_kp_u_codec_for __pyx_string_tab[54] #define __pyx_kp_u_connection_was_closed_in_the_mid __pyx_string_tab[55] #define __pyx_kp_u_could_not_get_iterations __pyx_string_tab[56] #define __pyx_kp_u_could_not_get_nonce __pyx_string_tab[57] #define __pyx_kp_u_could_not_get_salt __pyx_string_tab[58] #define __pyx_kp_u_could_not_get_server_signature __pyx_string_tab[59] #define __pyx_kp_u_could_not_verify_server_signatur __pyx_string_tab[60] #define __pyx_kp_u_decode_row_statement_is_None __pyx_string_tab[61] #define __pyx_kp_u_disable __pyx_string_tab[62] #define __pyx_kp_u_double_precision __pyx_string_tab[63] #define __pyx_kp_u_duplicate_GSSAPI_SSPI_authentica __pyx_string_tab[64] #define __pyx_kp_u_enable __pyx_string_tab[65] #define __pyx_kp_u_expected_0_1_or_2_elements_in_ra __pyx_string_tab[66] #define __pyx_kp_u_expected_a_sequence_got __pyx_string_tab[67] #define __pyx_kp_u_expected_a_sequence_got_type_r __pyx_string_tab[68] #define __pyx_kp_u_gc __pyx_string_tab[69] #define __pyx_kp_u_got_result_for_unknown_protocol __pyx_string_tab[70] #define __pyx_kp_u_gssapi_module_not_found_please_i __pyx_string_tab[71] #define __pyx_kp_u_in_element __pyx_string_tab[72] #define __pyx_kp_u_inconsistent_sub_array_dimension __pyx_string_tab[73] #define __pyx_kp_u_input_of_anonymous_composite_typ __pyx_string_tab[74] #define __pyx_kp_u_invalid_array_element __pyx_string_tab[75] #define __pyx_kp_u_invalid_array_element_at_index __pyx_string_tab[76] #define __pyx_kp_u_invalid_data_format __pyx_string_tab[77] #define __pyx_kp_u_invalid_format_argument_expected __pyx_string_tab[78] #define __pyx_kp_u_invalid_input_for_query_argument __pyx_string_tab[79] #define __pyx_kp_u_invalid_input_in_executemany_arg __pyx_string_tab[80] #define __pyx_kp_u_invalid_nonce __pyx_string_tab[81] #define __pyx_kp_u_invalid_timeout_value_expected_n __pyx_string_tab[82] #define __pyx_kp_u_isenabled __pyx_string_tab[83] #define __pyx_kp_u_list_tuple_or_Range_object_expec __pyx_string_tab[84] #define __pyx_kp_u_malformed_array_literal_r __pyx_string_tab[85] #define __pyx_kp_u_missing_after_array_dimensions __pyx_string_tab[86] #define __pyx_kp_u_missing_after_array_dimensions_2 __pyx_string_tab[87] #define __pyx_kp_u_missing_array_dimension_value __pyx_string_tab[88] #define __pyx_kp_u_missing_codec_information_for_OI __pyx_string_tab[89] #define __pyx_kp_u_named_prepared_statements_cannot __pyx_string_tab[90] #define __pyx_kp_u_no_binary_format_encoder_for_typ __pyx_string_tab[91] #define __pyx_kp_u_no_codec_for_composite_attribute __pyx_string_tab[92] #define __pyx_kp_u_no_decoder_for_OID __pyx_string_tab[93] #define __pyx_kp_u_no_decoder_for_composite_type_el __pyx_string_tab[94] #define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[95] #define __pyx_kp_u_no_encoder_for_OID __pyx_string_tab[96] #define __pyx_kp_u_non_homogeneous_array __pyx_string_tab[97] #define __pyx_kp_u_not_connected __pyx_string_tab[98] #define __pyx_kp_u_number_of_array_dimensions_excee __pyx_string_tab[99] #define __pyx_kp_u_of_executemany_sequence __pyx_string_tab[100] #define __pyx_kp_u_oid_2 __pyx_string_tab[101] #define __pyx_kp_u_on_result__prepare_statement_is __pyx_string_tab[102] #define __pyx_kp_u_on_result_waiter_is_None __pyx_string_tab[103] #define __pyx_kp_u_on_result_waiter_is_done __pyx_string_tab[104] #define __pyx_kp_u_parse_data_msgs_first_message_i __pyx_string_tab[105] #define __pyx_kp_u_parse_data_msgs_result_is_not_a __pyx_string_tab[106] #define __pyx_kp_u_pg_contrib_hstore __pyx_string_tab[107] #define __pyx_kp_u_protocol_is_in_an_unexpected_st __pyx_string_tab[108] #define __pyx_kp_u_query_argument __pyx_string_tab[109] #define __pyx_kp_u_r_is_not_a_valid_element_of_com __pyx_string_tab[110] #define __pyx_kp_u_reader_is_not_an_asynchronous_it __pyx_string_tab[111] #define __pyx_kp_u_scram_sha_256 __pyx_string_tab[112] #define __pyx_kp_u_self__custom_type_codecs_is_not __pyx_string_tab[113] #define __pyx_kp_u_self__execute_iter_is_not_None_o __pyx_string_tab[114] #define __pyx_kp_u_self__execute_iter_is_not_None_o_2 __pyx_string_tab[115] #define __pyx_kp_u_size_of_encoded_multirange_datum __pyx_string_tab[116] #define __pyx_kp_u_specified_array_dimensions_do_no __pyx_string_tab[117] #define __pyx_kp_u_sspilib_module_not_found_please __pyx_string_tab[118] #define __pyx_kp_u_stringsource __pyx_string_tab[119] #define __pyx_kp_u_text_2 __pyx_string_tab[120] #define __pyx_kp_u_text_binary_or_tuple __pyx_string_tab[121] #define __pyx_kp_u_text_or_binary __pyx_string_tab[122] #define __pyx_kp_u_text_or_binary_2 __pyx_string_tab[123] #define __pyx_kp_u_the_number_of_columns_in_the_res __pyx_string_tab[124] #define __pyx_kp_u_the_number_of_query_arguments_ca __pyx_string_tab[125] #define __pyx_kp_u_the_server_expects_x_argument_s __pyx_string_tab[126] #define __pyx_kp_u_there_is_no __pyx_string_tab[127] #define __pyx_kp_u_time_with_timezone __pyx_string_tab[128] #define __pyx_kp_u_time_without_timezone __pyx_string_tab[129] #define __pyx_kp_u_timestamp_with_timezone __pyx_string_tab[130] #define __pyx_kp_u_timestamp_without_timezone __pyx_string_tab[131] #define __pyx_kp_u_to __pyx_string_tab[132] #define __pyx_kp_u_too_many_elements_in_array_value __pyx_string_tab[133] #define __pyx_kp_u_too_many_elements_in_composite_t __pyx_string_tab[134] #define __pyx_kp_u_too_many_elements_in_multirange __pyx_string_tab[135] #define __pyx_kp_u_type_does_not_support_the_tuple __pyx_string_tab[136] #define __pyx_kp_u_type_record_missing_base_type_fo __pyx_string_tab[137] #define __pyx_kp_u_type_record_missing_base_type_fo_2 __pyx_string_tab[138] #define __pyx_kp_u_type_record_missing_base_type_fo_3 __pyx_string_tab[139] #define __pyx_kp_u_type_record_missing_field_types __pyx_string_tab[140] #define __pyx_kp_u_unexpected_NULL_element_in_multi __pyx_string_tab[141] #define __pyx_kp_u_unexpected_array_dimension_size __pyx_string_tab[142] #define __pyx_kp_u_unexpected_array_dimensions_valu __pyx_string_tab[143] #define __pyx_kp_u_unexpected_character_r_at_positi __pyx_string_tab[144] #define __pyx_kp_u_unexpected_codec_type __pyx_string_tab[145] #define __pyx_kp_u_unexpected_data_format __pyx_string_tab[146] #define __pyx_kp_u_unexpected_data_type_of_composit __pyx_string_tab[147] #define __pyx_kp_u_unexpected_end_of_string __pyx_string_tab[148] #define __pyx_kp_u_unexpected_error_while_performin __pyx_string_tab[149] #define __pyx_kp_u_unexpected_exchange_format __pyx_string_tab[150] #define __pyx_kp_u_unexpected_multirange_size_value __pyx_string_tab[151] #define __pyx_kp_u_unexpected_number_of_attributes __pyx_string_tab[152] #define __pyx_kp_u_unexpected_trailing_bytes_in_buf __pyx_string_tab[153] #define __pyx_kp_u_unhandled_standard_data_type __pyx_string_tab[154] #define __pyx_kp_u_unknown_error_in_protocol_implem __pyx_string_tab[155] #define __pyx_kp_u_unsupported_SASL_Authentication __pyx_string_tab[156] #define __pyx_kp_u_unsupported_authentication_metho __pyx_string_tab[157] #define __pyx_kp_u_utf_8 __pyx_string_tab[158] #define __pyx_kp_u_waiter_is_not_done_while_handlin __pyx_string_tab[159] #define __pyx_kp_u_you_need_values_from_server_to_g __pyx_string_tab[160] #define __pyx_n_u_AF_UNIX __pyx_string_tab[161] #define __pyx_n_u_ARRAY_TYPES __pyx_string_tab[162] #define __pyx_n_u_AUTHENTICATION_METHODS __pyx_string_tab[163] #define __pyx_n_u_AUTH_METHOD_NAME __pyx_string_tab[164] #define __pyx_n_u_AsyncIterable __pyx_string_tab[165] #define __pyx_n_u_Attribute __pyx_string_tab[166] #define __pyx_n_u_BUILTIN_TYPE_NAME_MAP __pyx_string_tab[167] #define __pyx_n_u_BUILTIN_TYPE_OID_MAP __pyx_string_tab[168] #define __pyx_n_u_BaseProtocol __pyx_string_tab[169] #define __pyx_n_u_BaseProtocol___reduce_cython __pyx_string_tab[170] #define __pyx_n_u_BaseProtocol___setstate_cython __pyx_string_tab[171] #define __pyx_n_u_BaseProtocol__create_future_fall __pyx_string_tab[172] #define __pyx_n_u_BaseProtocol__get_timeout __pyx_string_tab[173] #define __pyx_n_u_BaseProtocol__is_cancelling __pyx_string_tab[174] #define __pyx_n_u_BaseProtocol__on_timeout __pyx_string_tab[175] #define __pyx_n_u_BaseProtocol__on_waiter_complete __pyx_string_tab[176] #define __pyx_n_u_BaseProtocol__request_cancel __pyx_string_tab[177] #define __pyx_n_u_BaseProtocol__wait_for_cancellat __pyx_string_tab[178] #define __pyx_n_u_BaseProtocol_abort __pyx_string_tab[179] #define __pyx_n_u_BaseProtocol_bind __pyx_string_tab[180] #define __pyx_n_u_BaseProtocol_bind_execute __pyx_string_tab[181] #define __pyx_n_u_BaseProtocol_bind_execute_many __pyx_string_tab[182] #define __pyx_n_u_BaseProtocol_close __pyx_string_tab[183] #define __pyx_n_u_BaseProtocol_close_portal __pyx_string_tab[184] #define __pyx_n_u_BaseProtocol_close_statement __pyx_string_tab[185] #define __pyx_n_u_BaseProtocol_connection_lost __pyx_string_tab[186] #define __pyx_n_u_BaseProtocol_connection_made __pyx_string_tab[187] #define __pyx_n_u_BaseProtocol_copy_in __pyx_string_tab[188] #define __pyx_n_u_BaseProtocol_copy_out __pyx_string_tab[189] #define __pyx_n_u_BaseProtocol_data_received __pyx_string_tab[190] #define __pyx_n_u_BaseProtocol_execute __pyx_string_tab[191] #define __pyx_n_u_BaseProtocol_get_record_class __pyx_string_tab[192] #define __pyx_n_u_BaseProtocol_get_server_pid __pyx_string_tab[193] #define __pyx_n_u_BaseProtocol_get_settings __pyx_string_tab[194] #define __pyx_n_u_BaseProtocol_is_closed __pyx_string_tab[195] #define __pyx_n_u_BaseProtocol_is_connected __pyx_string_tab[196] #define __pyx_n_u_BaseProtocol_pause_writing __pyx_string_tab[197] #define __pyx_n_u_BaseProtocol_prepare __pyx_string_tab[198] #define __pyx_n_u_BaseProtocol_query __pyx_string_tab[199] #define __pyx_n_u_BaseProtocol_resume_writing __pyx_string_tab[200] #define __pyx_n_u_BaseProtocol_set_connection __pyx_string_tab[201] #define __pyx_n_u_CancelledError __pyx_string_tab[202] #define __pyx_n_u_ClientSecurityContext __pyx_string_tab[203] #define __pyx_n_u_Codec __pyx_string_tab[204] #define __pyx_n_u_CodecMap __pyx_string_tab[205] #define __pyx_n_u_CodecMap___reduce_cython __pyx_string_tab[206] #define __pyx_n_u_CodecMap___setstate_cython __pyx_string_tab[207] #define __pyx_n_u_Codec___reduce_cython __pyx_string_tab[208] #define __pyx_n_u_Codec___setstate_cython __pyx_string_tab[209] #define __pyx_n_u_ConnectionDoesNotExistError __pyx_string_tab[210] #define __pyx_n_u_ConnectionSettings __pyx_string_tab[211] #define __pyx_n_u_ConnectionSettings___reduce_cyth __pyx_string_tab[212] #define __pyx_n_u_ConnectionSettings___setstate_cy __pyx_string_tab[213] #define __pyx_n_u_ConnectionSettings_add_python_co __pyx_string_tab[214] #define __pyx_n_u_ConnectionSettings_clear_type_ca __pyx_string_tab[215] #define __pyx_n_u_ConnectionSettings_get_data_code __pyx_string_tab[216] #define __pyx_n_u_ConnectionSettings_get_text_code __pyx_string_tab[217] #define __pyx_n_u_ConnectionSettings_register_data __pyx_string_tab[218] #define __pyx_n_u_ConnectionSettings_remove_python __pyx_string_tab[219] #define __pyx_n_u_ConnectionSettings_set_builtin_t __pyx_string_tab[220] #define __pyx_n_u_CoreProtocol __pyx_string_tab[221] #define __pyx_n_u_CoreProtocol___reduce_cython __pyx_string_tab[222] #define __pyx_n_u_CoreProtocol___setstate_cython __pyx_string_tab[223] #define __pyx_n_u_CoreProtocol_is_in_transaction __pyx_string_tab[224] #define __pyx_n_u_DEFAULT_CLIENT_NONCE_BYTES __pyx_string_tab[225] #define __pyx_n_u_DIGEST __pyx_string_tab[226] #define __pyx_n_u_DataCodecConfig __pyx_string_tab[227] #define __pyx_n_u_DataCodecConfig___reduce_cython __pyx_string_tab[228] #define __pyx_n_u_DataCodecConfig___setstate_cytho __pyx_string_tab[229] #define __pyx_n_u_DataCodecConfig__set_builtin_typ __pyx_string_tab[230] #define __pyx_n_u_DataCodecConfig_add_python_codec __pyx_string_tab[231] #define __pyx_n_u_DataCodecConfig_add_types __pyx_string_tab[232] #define __pyx_n_u_DataCodecConfig_clear_type_cache __pyx_string_tab[233] #define __pyx_n_u_DataCodecConfig_declare_fallback __pyx_string_tab[234] #define __pyx_n_u_DataCodecConfig_remove_python_co __pyx_string_tab[235] #define __pyx_n_u_DataCodecConfig_set_builtin_type __pyx_string_tab[236] #define __pyx_n_u_DataError __pyx_string_tab[237] #define __pyx_n_u_ENCODINGS_MAP __pyx_string_tab[238] #define __pyx_n_u_Event __pyx_string_tab[239] #define __pyx_n_u_FLUSH_MESSAGE __pyx_string_tab[240] #define __pyx_n_u_Future __pyx_string_tab[241] #define __pyx_n_u_IPPROTO_TCP __pyx_string_tab[242] #define __pyx_n_u_InterfaceError __pyx_string_tab[243] #define __pyx_n_u_InternalClientError __pyx_string_tab[244] #define __pyx_n_u_Iterable __pyx_string_tab[245] #define __pyx_n_u_IterableABC __pyx_string_tab[246] #define __pyx_n_u_Kerberos __pyx_string_tab[247] #define __pyx_n_u_Mapping __pyx_string_tab[248] #define __pyx_n_u_MappingABC __pyx_string_tab[249] #define __pyx_n_u_NA __pyx_string_tab[250] #define __pyx_n_u_NFKC __pyx_string_tab[251] #define __pyx_n_u_NO_TIMEOUT __pyx_string_tab[252] #define __pyx_n_u_Name __pyx_string_tab[253] #define __pyx_n_u_NameType __pyx_string_tab[254] #define __pyx_n_u_Negotiate __pyx_string_tab[255] #define __pyx_n_u_OrderedDict __pyx_string_tab[256] #define __pyx_n_u_OutdatedSchemaCacheError __pyx_string_tab[257] #define __pyx_n_u_PostgresError __pyx_string_tab[258] #define __pyx_n_u_PreparedStatementState __pyx_string_tab[259] #define __pyx_n_u_PreparedStatementState___reduce __pyx_string_tab[260] #define __pyx_n_u_PreparedStatementState___setstat __pyx_string_tab[261] #define __pyx_n_u_PreparedStatementState__get_attr __pyx_string_tab[262] #define __pyx_n_u_PreparedStatementState__get_para __pyx_string_tab[263] #define __pyx_n_u_PreparedStatementState__init_cod __pyx_string_tab[264] #define __pyx_n_u_PreparedStatementState__init_typ __pyx_string_tab[265] #define __pyx_n_u_PreparedStatementState_attach __pyx_string_tab[266] #define __pyx_n_u_PreparedStatementState_detach __pyx_string_tab[267] #define __pyx_n_u_PreparedStatementState_mark_clos __pyx_string_tab[268] #define __pyx_n_u_PreparedStatementState_mark_unpr __pyx_string_tab[269] #define __pyx_n_u_Protocol __pyx_string_tab[270] #define __pyx_n_u_ProtocolError __pyx_string_tab[271] #define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[272] #define __pyx_n_u_REQUIREMENTS_CLIENT_FINAL_MESSAG __pyx_string_tab[273] #define __pyx_n_u_REQUIREMENTS_CLIENT_PROOF __pyx_string_tab[274] #define __pyx_n_u_ROLLBACK __pyx_string_tab[275] #define __pyx_n_u_Range __pyx_string_tab[276] #define __pyx_n_u_Record __pyx_string_tab[277] #define __pyx_n_u_RecordDescriptor __pyx_string_tab[278] #define __pyx_n_u_SASLPREP_PROHIBITED __pyx_string_tab[279] #define __pyx_n_u_SCRAMAuthentication __pyx_string_tab[280] #define __pyx_n_u_SCRAMAuthentication___reduce_cyt __pyx_string_tab[281] #define __pyx_n_u_SCRAMAuthentication___setstate_c __pyx_string_tab[282] #define __pyx_n_u_SCRAMAuthentication__bytes_xor_l __pyx_string_tab[283] #define __pyx_n_u_SCRAMAuthentication__normalize_p __pyx_string_tab[284] #define __pyx_n_u_SYNC_MESSAGE __pyx_string_tab[285] #define __pyx_n_u_SecurityContext __pyx_string_tab[286] #define __pyx_n_u_Sequence __pyx_string_tab[287] #define __pyx_n_u_SequenceABC __pyx_string_tab[288] #define __pyx_n_u_Sized __pyx_string_tab[289] #define __pyx_n_u_SizedABC __pyx_string_tab[290] #define __pyx_n_u_StopAsyncIteration __pyx_string_tab[291] #define __pyx_n_u_TCP_NODELAY __pyx_string_tab[292] #define __pyx_n_u_TimeoutError __pyx_string_tab[293] #define __pyx_n_u_Timer __pyx_string_tab[294] #define __pyx_n_u_Timer___enter __pyx_string_tab[295] #define __pyx_n_u_Timer___exit __pyx_string_tab[296] #define __pyx_n_u_Timer___init __pyx_string_tab[297] #define __pyx_n_u_Timer_get_remaining_budget __pyx_string_tab[298] #define __pyx_n_u_Timer_has_budget_greater_than __pyx_string_tab[299] #define __pyx_n_u_Type __pyx_string_tab[300] #define __pyx_n_u_UnsupportedClientFeatureError __pyx_string_tab[301] #define __pyx_n_u_UserCredential __pyx_string_tab[302] #define __pyx_n_u__2 __pyx_string_tab[303] #define __pyx_n_u_a_i __pyx_string_tab[304] #define __pyx_n_u_abc __pyx_string_tab[305] #define __pyx_n_u_abort __pyx_string_tab[306] #define __pyx_n_u_abstime __pyx_string_tab[307] #define __pyx_n_u_aclitem __pyx_string_tab[308] #define __pyx_n_u_add_done_callback __pyx_string_tab[309] #define __pyx_n_u_add_python_codec __pyx_string_tab[310] #define __pyx_n_u_add_types __pyx_string_tab[311] #define __pyx_n_u_addr __pyx_string_tab[312] #define __pyx_n_u_aiter __pyx_string_tab[313] #define __pyx_n_u_aiter_2 __pyx_string_tab[314] #define __pyx_n_u_alias_oid __pyx_string_tab[315] #define __pyx_n_u_alias_to __pyx_string_tab[316] #define __pyx_n_u_alt __pyx_string_tab[317] #define __pyx_n_u_amount __pyx_string_tab[318] #define __pyx_n_u_anext __pyx_string_tab[319] #define __pyx_n_u_any __pyx_string_tab[320] #define __pyx_n_u_anyarray __pyx_string_tab[321] #define __pyx_n_u_anycompatible __pyx_string_tab[322] #define __pyx_n_u_anycompatiblearray __pyx_string_tab[323] #define __pyx_n_u_anycompatiblemultirange __pyx_string_tab[324] #define __pyx_n_u_anycompatiblenonarray __pyx_string_tab[325] #define __pyx_n_u_anycompatiblerange __pyx_string_tab[326] #define __pyx_n_u_anyelement __pyx_string_tab[327] #define __pyx_n_u_anyenum __pyx_string_tab[328] #define __pyx_n_u_anymultirange __pyx_string_tab[329] #define __pyx_n_u_anynonarray __pyx_string_tab[330] #define __pyx_n_u_anyrange __pyx_string_tab[331] #define __pyx_n_u_apg_exc __pyx_string_tab[332] #define __pyx_n_u_apg_exc_base __pyx_string_tab[333] #define __pyx_n_u_apg_types __pyx_string_tab[334] #define __pyx_n_u_arg_bufs __pyx_string_tab[335] #define __pyx_n_u_args __pyx_string_tab[336] #define __pyx_n_u_args_buf __pyx_string_tab[337] #define __pyx_n_u_array __pyx_string_tab[338] #define __pyx_n_u_array_element_oid __pyx_string_tab[339] #define __pyx_n_u_ascii __pyx_string_tab[340] #define __pyx_n_u_asyncio __pyx_string_tab[341] #define __pyx_n_u_asyncio_coroutines __pyx_string_tab[342] #define __pyx_n_u_asyncpg __pyx_string_tab[343] #define __pyx_n_u_asyncpg_exceptions __pyx_string_tab[344] #define __pyx_n_u_asyncpg_protocol_protocol __pyx_string_tab[345] #define __pyx_n_u_asyncpg_protocol_record __pyx_string_tab[346] #define __pyx_n_u_attach __pyx_string_tab[347] #define __pyx_n_u_attrname __pyx_string_tab[348] #define __pyx_n_u_attrnames __pyx_string_tab[349] #define __pyx_n_u_attrtypoids __pyx_string_tab[350] #define __pyx_n_u_auth_msg __pyx_string_tab[351] #define __pyx_n_u_authentication_method __pyx_string_tab[352] #define __pyx_n_u_await __pyx_string_tab[353] #define __pyx_n_u_b __pyx_string_tab[354] #define __pyx_n_u_b64decode __pyx_string_tab[355] #define __pyx_n_u_b64encode __pyx_string_tab[356] #define __pyx_n_u_b_i __pyx_string_tab[357] #define __pyx_n_u_base __pyx_string_tab[358] #define __pyx_n_u_base64 __pyx_string_tab[359] #define __pyx_n_u_base_codec __pyx_string_tab[360] #define __pyx_n_u_base_type __pyx_string_tab[361] #define __pyx_n_u_basetype __pyx_string_tab[362] #define __pyx_n_u_basetype_name __pyx_string_tab[363] #define __pyx_n_u_big __pyx_string_tab[364] #define __pyx_n_u_bigint __pyx_string_tab[365] #define __pyx_n_u_binary __pyx_string_tab[366] #define __pyx_n_u_bind __pyx_string_tab[367] #define __pyx_n_u_bind_execute __pyx_string_tab[368] #define __pyx_n_u_bind_execute_many __pyx_string_tab[369] #define __pyx_n_u_bind_execute_many_locals_genexpr __pyx_string_tab[370] #define __pyx_n_u_bit __pyx_string_tab[371] #define __pyx_n_u_bool __pyx_string_tab[372] #define __pyx_n_u_box __pyx_string_tab[373] #define __pyx_n_u_bpchar __pyx_string_tab[374] #define __pyx_n_u_budget __pyx_string_tab[375] #define __pyx_n_u_budget_2 __pyx_string_tab[376] #define __pyx_n_u_buffer __pyx_string_tab[377] #define __pyx_n_u_builtins __pyx_string_tab[378] #define __pyx_n_u_bytea __pyx_string_tab[379] #define __pyx_n_u_byteorder __pyx_string_tab[380] #define __pyx_n_u_c __pyx_string_tab[381] #define __pyx_n_u_c_decoder __pyx_string_tab[382] #define __pyx_n_u_c_encoder __pyx_string_tab[383] #define __pyx_n_u_call_exception_handler __pyx_string_tab[384] #define __pyx_n_u_call_later __pyx_string_tab[385] #define __pyx_n_u_cancel __pyx_string_tab[386] #define __pyx_n_u_cancel_current_command __pyx_string_tab[387] #define __pyx_n_u_cancelled __pyx_string_tab[388] #define __pyx_n_u_cause __pyx_string_tab[389] #define __pyx_n_u_char __pyx_string_tab[390] #define __pyx_n_u_character __pyx_string_tab[391] #define __pyx_n_u_chunk __pyx_string_tab[392] #define __pyx_n_u_cid __pyx_string_tab[393] #define __pyx_n_u_cidr __pyx_string_tab[394] #define __pyx_n_u_circle __pyx_string_tab[395] #define __pyx_n_u_class_getitem __pyx_string_tab[396] #define __pyx_n_u_cleanup __pyx_string_tab[397] #define __pyx_n_u_clear __pyx_string_tab[398] #define __pyx_n_u_clear_type_cache __pyx_string_tab[399] #define __pyx_n_u_client_channel_binding __pyx_string_tab[400] #define __pyx_n_u_client_encoding __pyx_string_tab[401] #define __pyx_n_u_cline_in_traceback __pyx_string_tab[402] #define __pyx_n_u_close __pyx_string_tab[403] #define __pyx_n_u_close_portal __pyx_string_tab[404] #define __pyx_n_u_close_statement __pyx_string_tab[405] #define __pyx_n_u_codec __pyx_string_tab[406] #define __pyx_n_u_codec_map __pyx_string_tab[407] #define __pyx_n_u_codec_set __pyx_string_tab[408] #define __pyx_n_u_codec_str __pyx_string_tab[409] #define __pyx_n_u_codecs __pyx_string_tab[410] #define __pyx_n_u_collections __pyx_string_tab[411] #define __pyx_n_u_collections_abc __pyx_string_tab[412] #define __pyx_n_u_command_timeout __pyx_string_tab[413] #define __pyx_n_u_comp_elem_codecs __pyx_string_tab[414] #define __pyx_n_u_comp_type_attrs __pyx_string_tab[415] #define __pyx_n_u_compat __pyx_string_tab[416] #define __pyx_n_u_composite __pyx_string_tab[417] #define __pyx_n_u_con __pyx_string_tab[418] #define __pyx_n_u_con_params __pyx_string_tab[419] #define __pyx_n_u_config __pyx_string_tab[420] #define __pyx_n_u_connected_fut __pyx_string_tab[421] #define __pyx_n_u_connection __pyx_string_tab[422] #define __pyx_n_u_connection_lost __pyx_string_tab[423] #define __pyx_n_u_connection_made __pyx_string_tab[424] #define __pyx_n_u_copy_in __pyx_string_tab[425] #define __pyx_n_u_copy_in_locals_lambda __pyx_string_tab[426] #define __pyx_n_u_copy_out __pyx_string_tab[427] #define __pyx_n_u_copy_out_locals_lambda __pyx_string_tab[428] #define __pyx_n_u_copy_stmt __pyx_string_tab[429] #define __pyx_n_u_core_codec __pyx_string_tab[430] #define __pyx_n_u_cp1250 __pyx_string_tab[431] #define __pyx_n_u_cp1251 __pyx_string_tab[432] #define __pyx_n_u_cp1252 __pyx_string_tab[433] #define __pyx_n_u_cp1253 __pyx_string_tab[434] #define __pyx_n_u_cp1254 __pyx_string_tab[435] #define __pyx_n_u_cp1255 __pyx_string_tab[436] #define __pyx_n_u_cp1256 __pyx_string_tab[437] #define __pyx_n_u_cp1257 __pyx_string_tab[438] #define __pyx_n_u_cp1258 __pyx_string_tab[439] #define __pyx_n_u_cp1521 __pyx_string_tab[440] #define __pyx_n_u_cp866 __pyx_string_tab[441] #define __pyx_n_u_cp874 __pyx_string_tab[442] #define __pyx_n_u_cp932 __pyx_string_tab[443] #define __pyx_n_u_cp936 __pyx_string_tab[444] #define __pyx_n_u_cp949 __pyx_string_tab[445] #define __pyx_n_u_cp950 __pyx_string_tab[446] #define __pyx_n_u_create_future __pyx_string_tab[447] #define __pyx_n_u_create_future_fallback __pyx_string_tab[448] #define __pyx_n_u_create_record __pyx_string_tab[449] #define __pyx_n_u_credential __pyx_string_tab[450] #define __pyx_n_u_cstring __pyx_string_tab[451] #define __pyx_n_u_d __pyx_string_tab[452] #define __pyx_n_u_data __pyx_string_tab[453] #define __pyx_n_u_data_gen __pyx_string_tab[454] #define __pyx_n_u_data_received __pyx_string_tab[455] #define __pyx_n_u_data_type __pyx_string_tab[456] #define __pyx_n_u_database __pyx_string_tab[457] #define __pyx_n_u_date __pyx_string_tab[458] #define __pyx_n_u_decimal __pyx_string_tab[459] #define __pyx_n_u_declare_fallback_codec __pyx_string_tab[460] #define __pyx_n_u_decode __pyx_string_tab[461] #define __pyx_n_u_decoder __pyx_string_tab[462] #define __pyx_n_u_desc __pyx_string_tab[463] #define __pyx_n_u_detach __pyx_string_tab[464] #define __pyx_n_u_detail __pyx_string_tab[465] #define __pyx_n_u_dict __pyx_string_tab[466] #define __pyx_n_u_dict_2 __pyx_string_tab[467] #define __pyx_n_u_digest __pyx_string_tab[468] #define __pyx_n_u_doc __pyx_string_tab[469] #define __pyx_n_u_done __pyx_string_tab[470] #define __pyx_n_u_e __pyx_string_tab[471] #define __pyx_n_u_elem __pyx_string_tab[472] #define __pyx_n_u_elem_codec __pyx_string_tab[473] #define __pyx_n_u_elem_delim __pyx_string_tab[474] #define __pyx_n_u_elem_format __pyx_string_tab[475] #define __pyx_n_u_elemdelim __pyx_string_tab[476] #define __pyx_n_u_element_names __pyx_string_tab[477] #define __pyx_n_u_elems __pyx_string_tab[478] #define __pyx_n_u_elemtype __pyx_string_tab[479] #define __pyx_n_u_elemtype_name __pyx_string_tab[480] #define __pyx_n_u_empty __pyx_string_tab[481] #define __pyx_n_u_encode __pyx_string_tab[482] #define __pyx_n_u_encoder __pyx_string_tab[483] #define __pyx_n_u_enter __pyx_string_tab[484] #define __pyx_n_u_enumerate __pyx_string_tab[485] #define __pyx_n_u_et __pyx_string_tab[486] #define __pyx_n_u_euc_cn __pyx_string_tab[487] #define __pyx_n_u_euc_jis_2004 __pyx_string_tab[488] #define __pyx_n_u_euc_jp __pyx_string_tab[489] #define __pyx_n_u_euc_kr __pyx_string_tab[490] #define __pyx_n_u_euccn __pyx_string_tab[491] #define __pyx_n_u_eucjp __pyx_string_tab[492] #define __pyx_n_u_euckr __pyx_string_tab[493] #define __pyx_n_u_event_trigger __pyx_string_tab[494] #define __pyx_n_u_ex __pyx_string_tab[495] #define __pyx_n_u_exc __pyx_string_tab[496] #define __pyx_n_u_exception __pyx_string_tab[497] #define __pyx_n_u_exceptions __pyx_string_tab[498] #define __pyx_n_u_execute __pyx_string_tab[499] #define __pyx_n_u_exit __pyx_string_tab[500] #define __pyx_n_u_f __pyx_string_tab[501] #define __pyx_n_u_family __pyx_string_tab[502] #define __pyx_n_u_fdw_handler __pyx_string_tab[503] #define __pyx_n_u_float4 __pyx_string_tab[504] #define __pyx_n_u_float8 __pyx_string_tab[505] #define __pyx_n_u_fmt __pyx_string_tab[506] #define __pyx_n_u_format __pyx_string_tab[507] #define __pyx_n_u_formats __pyx_string_tab[508] #define __pyx_n_u_func __pyx_string_tab[509] #define __pyx_n_u_fut __pyx_string_tab[510] #define __pyx_n_u_genexpr __pyx_string_tab[511] #define __pyx_n_u_get __pyx_string_tab[512] #define __pyx_n_u_get_attributes __pyx_string_tab[513] #define __pyx_n_u_get_data_codec __pyx_string_tab[514] #define __pyx_n_u_get_extra_info __pyx_string_tab[515] #define __pyx_n_u_get_parameters __pyx_string_tab[516] #define __pyx_n_u_get_record_class __pyx_string_tab[517] #define __pyx_n_u_get_remaining_budget __pyx_string_tab[518] #define __pyx_n_u_get_server_pid __pyx_string_tab[519] #define __pyx_n_u_get_settings __pyx_string_tab[520] #define __pyx_n_u_get_text_codec __pyx_string_tab[521] #define __pyx_n_u_get_timeout __pyx_string_tab[522] #define __pyx_n_u_getattribute __pyx_string_tab[523] #define __pyx_n_u_getstate __pyx_string_tab[524] #define __pyx_n_u_group __pyx_string_tab[525] #define __pyx_n_u_gss __pyx_string_tab[526] #define __pyx_n_u_gssapi __pyx_string_tab[527] #define __pyx_n_u_gsslib __pyx_string_tab[528] #define __pyx_n_u_gtsvector __pyx_string_tab[529] #define __pyx_n_u_has_budget_greater_than __pyx_string_tab[530] #define __pyx_n_u_has_text_elements __pyx_string_tab[531] #define __pyx_n_u_hashlib __pyx_string_tab[532] #define __pyx_n_u_hexdigest __pyx_string_tab[533] #define __pyx_n_u_hint __pyx_string_tab[534] #define __pyx_n_u_hmac __pyx_string_tab[535] #define __pyx_n_u_hostbased_service __pyx_string_tab[536] #define __pyx_n_u_i __pyx_string_tab[537] #define __pyx_n_u_ignore_custom_codec __pyx_string_tab[538] #define __pyx_n_u_in_prohibited_table __pyx_string_tab[539] #define __pyx_n_u_in_table_a1 __pyx_string_tab[540] #define __pyx_n_u_in_table_b1 __pyx_string_tab[541] #define __pyx_n_u_in_table_c12 __pyx_string_tab[542] #define __pyx_n_u_in_table_c21_c22 __pyx_string_tab[543] #define __pyx_n_u_in_table_c3 __pyx_string_tab[544] #define __pyx_n_u_in_table_c4 __pyx_string_tab[545] #define __pyx_n_u_in_table_c5 __pyx_string_tab[546] #define __pyx_n_u_in_table_c6 __pyx_string_tab[547] #define __pyx_n_u_in_table_c7 __pyx_string_tab[548] #define __pyx_n_u_in_table_c8 __pyx_string_tab[549] #define __pyx_n_u_in_table_c9 __pyx_string_tab[550] #define __pyx_n_u_in_table_d1 __pyx_string_tab[551] #define __pyx_n_u_in_table_d2 __pyx_string_tab[552] #define __pyx_n_u_index_am_handler __pyx_string_tab[553] #define __pyx_n_u_inet __pyx_string_tab[554] #define __pyx_n_u_init __pyx_string_tab[555] #define __pyx_n_u_init_codecs __pyx_string_tab[556] #define __pyx_n_u_init_types __pyx_string_tab[557] #define __pyx_n_u_initiate __pyx_string_tab[558] #define __pyx_n_u_int __pyx_string_tab[559] #define __pyx_n_u_int2 __pyx_string_tab[560] #define __pyx_n_u_int4 __pyx_string_tab[561] #define __pyx_n_u_int8 __pyx_string_tab[562] #define __pyx_n_u_integer __pyx_string_tab[563] #define __pyx_n_u_internal __pyx_string_tab[564] #define __pyx_n_u_interval __pyx_string_tab[565] #define __pyx_n_u_is_cancelling __pyx_string_tab[566] #define __pyx_n_u_is_closed __pyx_string_tab[567] #define __pyx_n_u_is_connected __pyx_string_tab[568] #define __pyx_n_u_is_coroutine __pyx_string_tab[569] #define __pyx_n_u_is_in_transaction __pyx_string_tab[570] #define __pyx_n_u_isempty __pyx_string_tab[571] #define __pyx_n_u_item __pyx_string_tab[572] #define __pyx_n_u_items __pyx_string_tab[573] #define __pyx_n_u_iterator __pyx_string_tab[574] #define __pyx_n_u_json __pyx_string_tab[575] #define __pyx_n_u_jsonb __pyx_string_tab[576] #define __pyx_n_u_jsonpath __pyx_string_tab[577] #define __pyx_n_u_kerberosv5 __pyx_string_tab[578] #define __pyx_n_u_kind __pyx_string_tab[579] #define __pyx_n_u_koi8_r __pyx_string_tab[580] #define __pyx_n_u_koi8_u __pyx_string_tab[581] #define __pyx_n_u_koi8r __pyx_string_tab[582] #define __pyx_n_u_koi8u __pyx_string_tab[583] #define __pyx_n_u_krbsrvname __pyx_string_tab[584] #define __pyx_n_u_lambda __pyx_string_tab[585] #define __pyx_n_u_language_handler __pyx_string_tab[586] #define __pyx_n_u_limit __pyx_string_tab[587] #define __pyx_n_u_line __pyx_string_tab[588] #define __pyx_n_u_lookup __pyx_string_tab[589] #define __pyx_n_u_loop __pyx_string_tab[590] #define __pyx_n_u_lower __pyx_string_tab[591] #define __pyx_n_u_lower_inc __pyx_string_tab[592] #define __pyx_n_u_lseg __pyx_string_tab[593] #define __pyx_n_u_macaddr __pyx_string_tab[594] #define __pyx_n_u_macaddr8 __pyx_string_tab[595] #define __pyx_n_u_main __pyx_string_tab[596] #define __pyx_n_u_make_record __pyx_string_tab[597] #define __pyx_n_u_mapping __pyx_string_tab[598] #define __pyx_n_u_mark_closed __pyx_string_tab[599] #define __pyx_n_u_mark_unprepared __pyx_string_tab[600] #define __pyx_n_u_md5 __pyx_string_tab[601] #define __pyx_n_u_message __pyx_string_tab[602] #define __pyx_n_u_metaclass __pyx_string_tab[603] #define __pyx_n_u_missing __pyx_string_tab[604] #define __pyx_n_u_module __pyx_string_tab[605] #define __pyx_n_u_money __pyx_string_tab[606] #define __pyx_n_u_monotonic __pyx_string_tab[607] #define __pyx_n_u_more __pyx_string_tab[608] #define __pyx_n_u_mro_entries __pyx_string_tab[609] #define __pyx_n_u_multirange __pyx_string_tab[610] #define __pyx_n_u_name __pyx_string_tab[611] #define __pyx_n_u_name_2 __pyx_string_tab[612] #define __pyx_n_u_new __pyx_string_tab[613] #define __pyx_n_u_new_2 __pyx_string_tab[614] #define __pyx_n_u_next __pyx_string_tab[615] #define __pyx_n_u_normalize __pyx_string_tab[616] #define __pyx_n_u_ns __pyx_string_tab[617] #define __pyx_n_u_num_cols __pyx_string_tab[618] #define __pyx_n_u_numeric __pyx_string_tab[619] #define __pyx_n_u_object __pyx_string_tab[620] #define __pyx_n_u_oid __pyx_string_tab[621] #define __pyx_n_u_on_error __pyx_string_tab[622] #define __pyx_n_u_on_timeout __pyx_string_tab[623] #define __pyx_n_u_on_waiter_completed __pyx_string_tab[624] #define __pyx_n_u_opaque __pyx_string_tab[625] #define __pyx_n_u_p_oid __pyx_string_tab[626] #define __pyx_n_u_password __pyx_string_tab[627] #define __pyx_n_u_password_iterations __pyx_string_tab[628] #define __pyx_n_u_password_salt __pyx_string_tab[629] #define __pyx_n_u_path __pyx_string_tab[630] #define __pyx_n_u_pause_reading __pyx_string_tab[631] #define __pyx_n_u_pause_writing __pyx_string_tab[632] #define __pyx_n_u_pg_brin_bloom_summary __pyx_string_tab[633] #define __pyx_n_u_pg_brin_minmax_multi_summary __pyx_string_tab[634] #define __pyx_n_u_pg_catalog __pyx_string_tab[635] #define __pyx_n_u_pg_ddl_command __pyx_string_tab[636] #define __pyx_n_u_pg_dependencies __pyx_string_tab[637] #define __pyx_n_u_pg_lsn __pyx_string_tab[638] #define __pyx_n_u_pg_mcv_list __pyx_string_tab[639] #define __pyx_n_u_pg_ndistinct __pyx_string_tab[640] #define __pyx_n_u_pg_node_tree __pyx_string_tab[641] #define __pyx_n_u_pg_snapshot __pyx_string_tab[642] #define __pyx_n_u_point __pyx_string_tab[643] #define __pyx_n_u_polygon __pyx_string_tab[644] #define __pyx_n_u_pop __pyx_string_tab[645] #define __pyx_n_u_portal_name __pyx_string_tab[646] #define __pyx_n_u_position __pyx_string_tab[647] #define __pyx_n_u_postgres __pyx_string_tab[648] #define __pyx_n_u_prepare __pyx_string_tab[649] #define __pyx_n_u_prepare_2 __pyx_string_tab[650] #define __pyx_n_u_process_log_message __pyx_string_tab[651] #define __pyx_n_u_process_notification __pyx_string_tab[652] #define __pyx_n_u_protocol __pyx_string_tab[653] #define __pyx_n_u_pyx_checksum __pyx_string_tab[654] #define __pyx_n_u_pyx_result __pyx_string_tab[655] #define __pyx_n_u_pyx_state __pyx_string_tab[656] #define __pyx_n_u_pyx_type __pyx_string_tab[657] #define __pyx_n_u_pyx_unpickle_BaseProtocol __pyx_string_tab[658] #define __pyx_n_u_pyx_unpickle_CoreProtocol __pyx_string_tab[659] #define __pyx_n_u_pyx_unpickle_DataCodecConfig __pyx_string_tab[660] #define __pyx_n_u_pyx_vtable __pyx_string_tab[661] #define __pyx_n_u_qualname __pyx_string_tab[662] #define __pyx_n_u_query __pyx_string_tab[663] #define __pyx_n_u_range __pyx_string_tab[664] #define __pyx_n_u_range_subtype __pyx_string_tab[665] #define __pyx_n_u_range_subtype_name __pyx_string_tab[666] #define __pyx_n_u_range_subtype_oid __pyx_string_tab[667] #define __pyx_n_u_rdesc __pyx_string_tab[668] #define __pyx_n_u_re __pyx_string_tab[669] #define __pyx_n_u_reader __pyx_string_tab[670] #define __pyx_n_u_real __pyx_string_tab[671] #define __pyx_n_u_rec __pyx_string_tab[672] #define __pyx_n_u_record __pyx_string_tab[673] #define __pyx_n_u_record_class __pyx_string_tab[674] #define __pyx_n_u_record_stmt __pyx_string_tab[675] #define __pyx_n_u_records __pyx_string_tab[676] #define __pyx_n_u_reduce __pyx_string_tab[677] #define __pyx_n_u_reduce_cython __pyx_string_tab[678] #define __pyx_n_u_reduce_ex __pyx_string_tab[679] #define __pyx_n_u_ref __pyx_string_tab[680] #define __pyx_n_u_refcursor __pyx_string_tab[681] #define __pyx_n_u_regclass __pyx_string_tab[682] #define __pyx_n_u_regcollation __pyx_string_tab[683] #define __pyx_n_u_regconfig __pyx_string_tab[684] #define __pyx_n_u_regdictionary __pyx_string_tab[685] #define __pyx_n_u_register_data_types __pyx_string_tab[686] #define __pyx_n_u_regnamespace __pyx_string_tab[687] #define __pyx_n_u_regoper __pyx_string_tab[688] #define __pyx_n_u_regoperator __pyx_string_tab[689] #define __pyx_n_u_regproc __pyx_string_tab[690] #define __pyx_n_u_regprocedure __pyx_string_tab[691] #define __pyx_n_u_regrole __pyx_string_tab[692] #define __pyx_n_u_regtype __pyx_string_tab[693] #define __pyx_n_u_release __pyx_string_tab[694] #define __pyx_n_u_reltime __pyx_string_tab[695] #define __pyx_n_u_remove_python_codec __pyx_string_tab[696] #define __pyx_n_u_request_cancel __pyx_string_tab[697] #define __pyx_n_u_result __pyx_string_tab[698] #define __pyx_n_u_resume_reading __pyx_string_tab[699] #define __pyx_n_u_resume_writing __pyx_string_tab[700] #define __pyx_n_u_return_extra __pyx_string_tab[701] #define __pyx_n_u_return_rows __pyx_string_tab[702] #define __pyx_n_u_reversed __pyx_string_tab[703] #define __pyx_n_u_row __pyx_string_tab[704] #define __pyx_n_u_s_2 __pyx_string_tab[705] #define __pyx_n_u_scalar __pyx_string_tab[706] #define __pyx_n_u_schema __pyx_string_tab[707] #define __pyx_n_u_search __pyx_string_tab[708] #define __pyx_n_u_secrets __pyx_string_tab[709] #define __pyx_n_u_self __pyx_string_tab[710] #define __pyx_n_u_send __pyx_string_tab[711] #define __pyx_n_u_server_first_message __pyx_string_tab[712] #define __pyx_n_u_server_nonce __pyx_string_tab[713] #define __pyx_n_u_server_settings __pyx_string_tab[714] #define __pyx_n_u_set __pyx_string_tab[715] #define __pyx_n_u_set_builtin_type_codec __pyx_string_tab[716] #define __pyx_n_u_set_builtin_type_codec_2 __pyx_string_tab[717] #define __pyx_n_u_set_connection __pyx_string_tab[718] #define __pyx_n_u_set_exception __pyx_string_tab[719] #define __pyx_n_u_set_name __pyx_string_tab[720] #define __pyx_n_u_set_result __pyx_string_tab[721] #define __pyx_n_u_setdefault __pyx_string_tab[722] #define __pyx_n_u_setsockopt __pyx_string_tab[723] #define __pyx_n_u_setstate __pyx_string_tab[724] #define __pyx_n_u_setstate_cython __pyx_string_tab[725] #define __pyx_n_u_settings __pyx_string_tab[726] #define __pyx_n_u_sha256 __pyx_string_tab[727] #define __pyx_n_u_shift_jis __pyx_string_tab[728] #define __pyx_n_u_shift_jis_2004 __pyx_string_tab[729] #define __pyx_n_u_sink __pyx_string_tab[730] #define __pyx_n_u_sjis __pyx_string_tab[731] #define __pyx_n_u_sleep __pyx_string_tab[732] #define __pyx_n_u_smallint __pyx_string_tab[733] #define __pyx_n_u_smgr __pyx_string_tab[734] #define __pyx_n_u_sock __pyx_string_tab[735] #define __pyx_n_u_socket __pyx_string_tab[736] #define __pyx_n_u_sql_ascii __pyx_string_tab[737] #define __pyx_n_u_sspi __pyx_string_tab[738] #define __pyx_n_u_sspilib __pyx_string_tab[739] #define __pyx_n_u_started __pyx_string_tab[740] #define __pyx_n_u_startswith __pyx_string_tab[741] #define __pyx_n_u_state __pyx_string_tab[742] #define __pyx_n_u_status_msg __pyx_string_tab[743] #define __pyx_n_u_step __pyx_string_tab[744] #define __pyx_n_u_stmt_name __pyx_string_tab[745] #define __pyx_n_u_str __pyx_string_tab[746] #define __pyx_n_u_stringprep __pyx_string_tab[747] #define __pyx_n_u_table_am_handler __pyx_string_tab[748] #define __pyx_n_u_target_codec __pyx_string_tab[749] #define __pyx_n_u_target_name __pyx_string_tab[750] #define __pyx_n_u_tb __pyx_string_tab[751] #define __pyx_n_u_tcvn __pyx_string_tab[752] #define __pyx_n_u_tcvn5712 __pyx_string_tab[753] #define __pyx_n_u_test __pyx_string_tab[754] #define __pyx_n_u_text __pyx_string_tab[755] #define __pyx_n_u_throw __pyx_string_tab[756] #define __pyx_n_u_ti __pyx_string_tab[757] #define __pyx_n_u_tid __pyx_string_tab[758] #define __pyx_n_u_time __pyx_string_tab[759] #define __pyx_n_u_timeout __pyx_string_tab[760] #define __pyx_n_u_timer __pyx_string_tab[761] #define __pyx_n_u_timestamp __pyx_string_tab[762] #define __pyx_n_u_timestamptz __pyx_string_tab[763] #define __pyx_n_u_timetz __pyx_string_tab[764] #define __pyx_n_u_tinterval __pyx_string_tab[765] #define __pyx_n_u_to_bytes __pyx_string_tab[766] #define __pyx_n_u_token_bytes __pyx_string_tab[767] #define __pyx_n_u_transport __pyx_string_tab[768] #define __pyx_n_u_trigger __pyx_string_tab[769] #define __pyx_n_u_tsm_handler __pyx_string_tab[770] #define __pyx_n_u_tsquery __pyx_string_tab[771] #define __pyx_n_u_tsvector __pyx_string_tab[772] #define __pyx_n_u_tuple __pyx_string_tab[773] #define __pyx_n_u_txid_snapshot __pyx_string_tab[774] #define __pyx_n_u_typeinfos __pyx_string_tab[775] #define __pyx_n_u_typekind __pyx_string_tab[776] #define __pyx_n_u_typename __pyx_string_tab[777] #define __pyx_n_u_typeoid __pyx_string_tab[778] #define __pyx_n_u_types __pyx_string_tab[779] #define __pyx_n_u_typeschema __pyx_string_tab[780] #define __pyx_n_u_typoid __pyx_string_tab[781] #define __pyx_n_u_unicode __pyx_string_tab[782] #define __pyx_n_u_unicodedata __pyx_string_tab[783] #define __pyx_n_u_unknown __pyx_string_tab[784] #define __pyx_n_u_update __pyx_string_tab[785] #define __pyx_n_u_upper __pyx_string_tab[786] #define __pyx_n_u_upper_inc __pyx_string_tab[787] #define __pyx_n_u_usage __pyx_string_tab[788] #define __pyx_n_u_use_setstate __pyx_string_tab[789] #define __pyx_n_u_user __pyx_string_tab[790] #define __pyx_n_u_utf_8_2 __pyx_string_tab[791] #define __pyx_n_u_uuid __pyx_string_tab[792] #define __pyx_n_u_value __pyx_string_tab[793] #define __pyx_n_u_values __pyx_string_tab[794] #define __pyx_n_u_varbit __pyx_string_tab[795] #define __pyx_n_u_varchar __pyx_string_tab[796] #define __pyx_n_u_void __pyx_string_tab[797] #define __pyx_n_u_vscii __pyx_string_tab[798] #define __pyx_n_u_w __pyx_string_tab[799] #define __pyx_n_u_wait __pyx_string_tab[800] #define __pyx_n_u_wait_for __pyx_string_tab[801] #define __pyx_n_u_wait_for_cancellation __pyx_string_tab[802] #define __pyx_n_u_waiter __pyx_string_tab[803] #define __pyx_n_u_was __pyx_string_tab[804] #define __pyx_n_u_wbuf __pyx_string_tab[805] #define __pyx_n_u_weakref __pyx_string_tab[806] #define __pyx_n_u_were __pyx_string_tab[807] #define __pyx_n_u_win __pyx_string_tab[808] #define __pyx_n_u_win1250 __pyx_string_tab[809] #define __pyx_n_u_win1251 __pyx_string_tab[810] #define __pyx_n_u_win1252 __pyx_string_tab[811] #define __pyx_n_u_win1253 __pyx_string_tab[812] #define __pyx_n_u_win1254 __pyx_string_tab[813] #define __pyx_n_u_win1255 __pyx_string_tab[814] #define __pyx_n_u_win1256 __pyx_string_tab[815] #define __pyx_n_u_win1257 __pyx_string_tab[816] #define __pyx_n_u_win1258 __pyx_string_tab[817] #define __pyx_n_u_win866 __pyx_string_tab[818] #define __pyx_n_u_win874 __pyx_string_tab[819] #define __pyx_n_u_win932 __pyx_string_tab[820] #define __pyx_n_u_win936 __pyx_string_tab[821] #define __pyx_n_u_win949 __pyx_string_tab[822] #define __pyx_n_u_win950 __pyx_string_tab[823] #define __pyx_n_u_windows1250 __pyx_string_tab[824] #define __pyx_n_u_windows1251 __pyx_string_tab[825] #define __pyx_n_u_windows1252 __pyx_string_tab[826] #define __pyx_n_u_windows1253 __pyx_string_tab[827] #define __pyx_n_u_windows1254 __pyx_string_tab[828] #define __pyx_n_u_windows1255 __pyx_string_tab[829] #define __pyx_n_u_windows1256 __pyx_string_tab[830] #define __pyx_n_u_windows1257 __pyx_string_tab[831] #define __pyx_n_u_windows1258 __pyx_string_tab[832] #define __pyx_n_u_windows866 __pyx_string_tab[833] #define __pyx_n_u_windows874 __pyx_string_tab[834] #define __pyx_n_u_windows932 __pyx_string_tab[835] #define __pyx_n_u_windows936 __pyx_string_tab[836] #define __pyx_n_u_windows949 __pyx_string_tab[837] #define __pyx_n_u_windows950 __pyx_string_tab[838] #define __pyx_n_u_with_msg __pyx_string_tab[839] #define __pyx_n_u_write __pyx_string_tab[840] #define __pyx_n_u_writelines __pyx_string_tab[841] #define __pyx_n_u_writing_allowed __pyx_string_tab[842] #define __pyx_n_u_x __pyx_string_tab[843] #define __pyx_n_u_xformat __pyx_string_tab[844] #define __pyx_n_u_xid __pyx_string_tab[845] #define __pyx_n_u_xid8 __pyx_string_tab[846] #define __pyx_n_u_xml __pyx_string_tab[847] #define __pyx_n_u_y __pyx_string_tab[848] #define __pyx_n_u_zip __pyx_string_tab[849] #define __pyx_kp_b_Client_Key __pyx_string_tab[850] #define __pyx_kp_b_PGCOPY __pyx_string_tab[851] #define __pyx_kp_b_PyObject_struct___pyx_obj_7async __pyx_string_tab[852] #define __pyx_kp_b_SCRAM_SHA_256 __pyx_string_tab[853] #define __pyx_kp_b_Server_Key __pyx_string_tab[854] #define __pyx_kp_b__10 __pyx_string_tab[855] #define __pyx_kp_b__11 __pyx_string_tab[856] #define __pyx_kp_b__12 __pyx_string_tab[857] #define __pyx_kp_b__13 __pyx_string_tab[858] #define __pyx_kp_b__15 __pyx_string_tab[859] #define __pyx_kp_b_c_2 __pyx_string_tab[860] #define __pyx_kp_b_c_3 __pyx_string_tab[861] #define __pyx_kp_b_i_d __pyx_string_tab[862] #define __pyx_kp_b_iso88591_1 __pyx_string_tab[863] #define __pyx_kp_b_iso88591_1Ja __pyx_string_tab[864] #define __pyx_kp_b_iso88591_34 __pyx_string_tab[865] #define __pyx_kp_b_iso88591_6 __pyx_string_tab[866] #define __pyx_kp_b_iso88591_A __pyx_string_tab[867] #define __pyx_kp_b_iso88591_A01_AYj_A_q_Q __pyx_string_tab[868] #define __pyx_kp_b_iso88591_A12_Q_7_Q_q_Qj_Qa_T_A_Ja_z_A_t_Q __pyx_string_tab[869] #define __pyx_kp_b_iso88591_A_2 __pyx_string_tab[870] #define __pyx_kp_b_iso88591_A_4q_0_L __pyx_string_tab[871] #define __pyx_kp_b_iso88591_A_4q_Kq_aq_Kq_JfA_M __pyx_string_tab[872] #define __pyx_kp_b_iso88591_A_4q_wa_4wd_T_q_3j __pyx_string_tab[873] #define __pyx_kp_b_iso88591_A_4s_q_Qa_fHA_2_D_5_q __pyx_string_tab[874] #define __pyx_kp_b_iso88591_A_4t1_1_E_Q_1AQ_1A_D_vS_j_4A_4wa __pyx_string_tab[875] #define __pyx_kp_b_iso88591_A_4xwd_S_S_O7_q_Cq_A_G_a __pyx_string_tab[876] #define __pyx_kp_b_iso88591_A_4y_1_1_4y __pyx_string_tab[877] #define __pyx_kp_b_iso88591_A_4y_q_D __pyx_string_tab[878] #define __pyx_kp_b_iso88591_A_4y_q_D_Rt1 __pyx_string_tab[879] #define __pyx_kp_b_iso88591_A_7_Q_a_Cq_a_Cq_a_O1_B_M_0_A1_Q __pyx_string_tab[880] #define __pyx_kp_b_iso88591_A_7_Q_a_a_Cq_a_a_Cq_a_a_O1_B_31 __pyx_string_tab[881] #define __pyx_kp_b_iso88591_A_87_4q_A_q_j_q_q_t_Qa __pyx_string_tab[882] #define __pyx_kp_b_iso88591_A_D __pyx_string_tab[883] #define __pyx_kp_b_iso88591_A_F __pyx_string_tab[884] #define __pyx_kp_b_iso88591_A_F_AQ_t_Qe_2Qa_Rq_1_1_r_q_1_1_q __pyx_string_tab[885] #define __pyx_kp_b_iso88591_A_G1_a_D_6_Q __pyx_string_tab[886] #define __pyx_kp_b_iso88591_A_G4q_D_vS_j_4A_5_U_gU_uAQ __pyx_string_tab[887] #define __pyx_kp_b_iso88591_A_G_Qa __pyx_string_tab[888] #define __pyx_kp_b_iso88591_A_IQ __pyx_string_tab[889] #define __pyx_kp_b_iso88591_A_Ja __pyx_string_tab[890] #define __pyx_kp_b_iso88591_A_JgT __pyx_string_tab[891] #define __pyx_kp_b_iso88591_A_Kq_L __pyx_string_tab[892] #define __pyx_kp_b_iso88591_A_M __pyx_string_tab[893] #define __pyx_kp_b_iso88591_A_M_1A __pyx_string_tab[894] #define __pyx_kp_b_iso88591_A_M_Qiz __pyx_string_tab[895] #define __pyx_kp_b_iso88591_A_M_y_q_E_Q_7_81_hc_q_1F_A_V1_a __pyx_string_tab[896] #define __pyx_kp_b_iso88591_A_N_Kq __pyx_string_tab[897] #define __pyx_kp_b_iso88591_A_Q_4q_Q_I_AZq_6_E_D_4q_4q_Q_I_A __pyx_string_tab[898] #define __pyx_kp_b_iso88591_A_T_q_nA_d_4wa_q_A_A_1_a_4wc_q_K __pyx_string_tab[899] #define __pyx_kp_b_iso88591_A_q __pyx_string_tab[900] #define __pyx_kp_b_iso88591_A_q_A_A_q_Q_A_1_1_7_Q_q_q_G1_xs __pyx_string_tab[901] #define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[902] #define __pyx_kp_b_iso88591_A_t4y_D_Cq __pyx_string_tab[903] #define __pyx_kp_b_iso88591_A_t_5 __pyx_string_tab[904] #define __pyx_kp_b_iso88591_A_t_5Q __pyx_string_tab[905] #define __pyx_kp_b_iso88591_A_we1_G1 __pyx_string_tab[906] #define __pyx_kp_b_iso88591_A_wgQe4q __pyx_string_tab[907] #define __pyx_kp_b_iso88591_Q __pyx_string_tab[908] #define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[909] #define __pyx_kp_b_iso88591_QfA __pyx_string_tab[910] #define __pyx_kp_b_iso88591_T_5T9PPTTiimm_B_B_L_L_P_P_b_b_s __pyx_string_tab[911] #define __pyx_kp_b_iso88591_T_5T9PPTTiimmww_L_L_P_P_Z_Z_l_l __pyx_string_tab[912] #define __pyx_kp_b_iso88591_T_t1_G1F_a_vWE_Q_q_q_0_AWKwa_0 __pyx_string_tab[913] #define __pyx_kp_b_iso88591_Zq __pyx_string_tab[914] #define __pyx_kp_b_iso88591__26 __pyx_string_tab[915] #define __pyx_kp_b_iso88591__27 __pyx_string_tab[916] #define __pyx_kp_b_iso88591__28 __pyx_string_tab[917] #define __pyx_kp_b_iso88591__29 __pyx_string_tab[918] #define __pyx_kp_b_iso88591__30 __pyx_string_tab[919] #define __pyx_kp_b_iso88591_a __pyx_string_tab[920] #define __pyx_kp_b_iso88591_q_0_kQR_1_7_1_2DNRS_1 __pyx_string_tab[921] #define __pyx_kp_b_iso88591_q_0_kQR_xq_7_a_nA_1 __pyx_string_tab[922] #define __pyx_kp_b_iso88591_xs_q_A_q_U_A_l_83aq_U_3aq_uAQ_Q __pyx_string_tab[923] #define __pyx_kp_b_n __pyx_string_tab[924] #define __pyx_kp_b_n_2 __pyx_string_tab[925] #define __pyx_kp_b_p __pyx_string_tab[926] #define __pyx_kp_b_r_2 __pyx_string_tab[927] #define __pyx_kp_b_r_3 __pyx_string_tab[928] #define __pyx_kp_b_s __pyx_string_tab[929] #define __pyx_kp_b_v __pyx_string_tab[930] #define __pyx_n_b_NULL __pyx_string_tab[931] #define __pyx_n_b_c __pyx_string_tab[932] #define __pyx_n_b_client_encoding __pyx_string_tab[933] #define __pyx_n_b_d __pyx_string_tab[934] #define __pyx_n_b_e __pyx_string_tab[935] #define __pyx_n_b_m __pyx_string_tab[936] #define __pyx_n_b_md5 __pyx_string_tab[937] #define __pyx_n_b_r __pyx_string_tab[938] #define __pyx_int_0 __pyx_number_tab[0] #define __pyx_int_1 __pyx_number_tab[1] #define __pyx_int_4 __pyx_number_tab[2] #define __pyx_int_6 __pyx_number_tab[3] #define __pyx_int_16 __pyx_number_tab[4] #define __pyx_int_17 __pyx_number_tab[5] #define __pyx_int_18 __pyx_number_tab[6] #define __pyx_int_19 __pyx_number_tab[7] #define __pyx_int_20 __pyx_number_tab[8] #define __pyx_int_21 __pyx_number_tab[9] #define __pyx_int_23 __pyx_number_tab[10] #define __pyx_int_24 __pyx_number_tab[11] #define __pyx_int_25 __pyx_number_tab[12] #define __pyx_int_26 __pyx_number_tab[13] #define __pyx_int_27 __pyx_number_tab[14] #define __pyx_int_28 __pyx_number_tab[15] #define __pyx_int_29 __pyx_number_tab[16] #define __pyx_int_32 __pyx_number_tab[17] #define __pyx_int_114 __pyx_number_tab[18] #define __pyx_int_142 __pyx_number_tab[19] #define __pyx_int_194 __pyx_number_tab[20] #define __pyx_int_210 __pyx_number_tab[21] #define __pyx_int_269 __pyx_number_tab[22] #define __pyx_int_325 __pyx_number_tab[23] #define __pyx_int_600 __pyx_number_tab[24] #define __pyx_int_601 __pyx_number_tab[25] #define __pyx_int_602 __pyx_number_tab[26] #define __pyx_int_603 __pyx_number_tab[27] #define __pyx_int_604 __pyx_number_tab[28] #define __pyx_int_628 __pyx_number_tab[29] #define __pyx_int_650 __pyx_number_tab[30] #define __pyx_int_700 __pyx_number_tab[31] #define __pyx_int_701 __pyx_number_tab[32] #define __pyx_int_702 __pyx_number_tab[33] #define __pyx_int_703 __pyx_number_tab[34] #define __pyx_int_704 __pyx_number_tab[35] #define __pyx_int_705 __pyx_number_tab[36] #define __pyx_int_718 __pyx_number_tab[37] #define __pyx_int_774 __pyx_number_tab[38] #define __pyx_int_790 __pyx_number_tab[39] #define __pyx_int_829 __pyx_number_tab[40] #define __pyx_int_869 __pyx_number_tab[41] #define __pyx_int_1009 __pyx_number_tab[42] #define __pyx_int_1028 __pyx_number_tab[43] #define __pyx_int_1033 __pyx_number_tab[44] #define __pyx_int_1042 __pyx_number_tab[45] #define __pyx_int_1043 __pyx_number_tab[46] #define __pyx_int_1082 __pyx_number_tab[47] #define __pyx_int_1083 __pyx_number_tab[48] #define __pyx_int_1114 __pyx_number_tab[49] #define __pyx_int_1184 __pyx_number_tab[50] #define __pyx_int_1186 __pyx_number_tab[51] #define __pyx_int_1266 __pyx_number_tab[52] #define __pyx_int_1560 __pyx_number_tab[53] #define __pyx_int_1562 __pyx_number_tab[54] #define __pyx_int_1700 __pyx_number_tab[55] #define __pyx_int_1790 __pyx_number_tab[56] #define __pyx_int_2202 __pyx_number_tab[57] #define __pyx_int_2203 __pyx_number_tab[58] #define __pyx_int_2204 __pyx_number_tab[59] #define __pyx_int_2205 __pyx_number_tab[60] #define __pyx_int_2206 __pyx_number_tab[61] #define __pyx_int_2249 __pyx_number_tab[62] #define __pyx_int_2275 __pyx_number_tab[63] #define __pyx_int_2276 __pyx_number_tab[64] #define __pyx_int_2277 __pyx_number_tab[65] #define __pyx_int_2278 __pyx_number_tab[66] #define __pyx_int_2279 __pyx_number_tab[67] #define __pyx_int_2280 __pyx_number_tab[68] #define __pyx_int_2281 __pyx_number_tab[69] #define __pyx_int_2282 __pyx_number_tab[70] #define __pyx_int_2283 __pyx_number_tab[71] #define __pyx_int_2776 __pyx_number_tab[72] #define __pyx_int_2950 __pyx_number_tab[73] #define __pyx_int_2970 __pyx_number_tab[74] #define __pyx_int_3115 __pyx_number_tab[75] #define __pyx_int_3220 __pyx_number_tab[76] #define __pyx_int_3310 __pyx_number_tab[77] #define __pyx_int_3361 __pyx_number_tab[78] #define __pyx_int_3402 __pyx_number_tab[79] #define __pyx_int_3500 __pyx_number_tab[80] #define __pyx_int_3614 __pyx_number_tab[81] #define __pyx_int_3615 __pyx_number_tab[82] #define __pyx_int_3642 __pyx_number_tab[83] #define __pyx_int_3734 __pyx_number_tab[84] #define __pyx_int_3769 __pyx_number_tab[85] #define __pyx_int_3802 __pyx_number_tab[86] #define __pyx_int_3831 __pyx_number_tab[87] #define __pyx_int_3838 __pyx_number_tab[88] #define __pyx_int_4072 __pyx_number_tab[89] #define __pyx_int_4089 __pyx_number_tab[90] #define __pyx_int_4096 __pyx_number_tab[91] #define __pyx_int_4191 __pyx_number_tab[92] #define __pyx_int_4537 __pyx_number_tab[93] #define __pyx_int_4538 __pyx_number_tab[94] #define __pyx_int_4600 __pyx_number_tab[95] #define __pyx_int_4601 __pyx_number_tab[96] #define __pyx_int_5017 __pyx_number_tab[97] #define __pyx_int_5038 __pyx_number_tab[98] #define __pyx_int_5069 __pyx_number_tab[99] #define __pyx_int_5077 __pyx_number_tab[100] #define __pyx_int_5078 __pyx_number_tab[101] #define __pyx_int_5079 __pyx_number_tab[102] #define __pyx_int_5080 __pyx_number_tab[103] #define __pyx_int_32768 __pyx_number_tab[104] #define __pyx_int_524288 __pyx_number_tab[105] #define __pyx_int_134522893 __pyx_number_tab[106] #define __pyx_int_175807176 __pyx_number_tab[107] #define __pyx_int_228230485 __pyx_number_tab[108] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(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); #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #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_CodecMap); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_CodecMap); 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_k__4); Py_CLEAR(clear_module_state->__pyx_k__5); for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } for (int i=0; i<86; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } for (int i=0; i<939; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } for (int i=0; i<109; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_clear_contents ### */ /* CommonTypesMetaclass.module_state_clear */ Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType); /* Coroutine.module_state_clear */ Py_CLEAR(clear_module_state->__pyx_CoroutineType); Py_CLEAR(clear_module_state->__pyx_CoroutineAwaitType); /* CythonFunctionShared.module_state_clear */ Py_CLEAR(clear_module_state->__pyx_CyFunctionType); /* Generator.module_state_clear */ Py_CLEAR(clear_module_state->__pyx_GeneratorType); /* #### Code section: module_state_clear_end ### */ return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(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); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); 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_CodecMap); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_CodecMap); 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_k__4); Py_VISIT(traverse_module_state->__pyx_k__5); for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } for (int i=0; i<86; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } for (int i=0; i<939; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } for (int i=0; i<109; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_traverse_contents ### */ /* CommonTypesMetaclass.module_state_traverse */ Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType); /* Coroutine.module_state_traverse */ Py_VISIT(traverse_module_state->__pyx_CoroutineType); Py_VISIT(traverse_module_state->__pyx_CoroutineAwaitType); /* CythonFunctionShared.module_state_traverse */ Py_VISIT(traverse_module_state->__pyx_CyFunctionType); /* Generator.module_state_traverse */ Py_VISIT(traverse_module_state->__pyx_GeneratorType); /* #### Code section: module_state_traverse_end ### */ return 0; } #endif /* #### Code section: module_code ### */ /* "cpython/complex.pxd":20 * * # unavailable in limited API * @property # <<<<<<<<<<<<<< * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double real(self) noexcept: */ #if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { double __pyx_r; /* "cpython/complex.pxd":23 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double real(self) noexcept: * return self.cval.real # <<<<<<<<<<<<<< * * # unavailable in limited API */ __pyx_r = __pyx_v_self->cval.real; goto __pyx_L0; /* "cpython/complex.pxd":20 * * # unavailable in limited API * @property # <<<<<<<<<<<<<< * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double real(self) noexcept: */ /* function exit code */ __pyx_L0:; return __pyx_r; } #endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "cpython/complex.pxd":26 * * # unavailable in limited API * @property # <<<<<<<<<<<<<< * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double imag(self) noexcept: */ #if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { double __pyx_r; /* "cpython/complex.pxd":29 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * 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":26 * * # unavailable in limited API * @property # <<<<<<<<<<<<<< * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double imag(self) noexcept: */ /* function exit code */ __pyx_L0:; return __pyx_r; } #endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "cpython/contextvars.pxd":115 * * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< * cdef inline object get_value(var, default_value=None): * """Return a new reference to the value of the context variable, */ #if !CYTHON_COMPILING_IN_LIMITED_API 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) { /* "cpython/contextvars.pxd":116 * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * 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, */ 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", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } /* "cpython/contextvars.pxd":121 * 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":122 * """ * 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(4, 122, __pyx_L1_error) /* "cpython/contextvars.pxd":123 * 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":125 * 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":123 * 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":128 * 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":129 * # 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":130 * 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":115 * * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< * cdef inline object get_value(var, default_value=None): * """Return a new reference to the 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; } #endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "cpython/contextvars.pxd":133 * * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< * cdef inline object get_value_no_default(var, default_value=None): * """Return a new reference to the value of the context variable, */ #if !CYTHON_COMPILING_IN_LIMITED_API 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) { /* "cpython/contextvars.pxd":134 * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * 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. */ 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", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } /* "cpython/contextvars.pxd":140 * 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":141 * """ * 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(4, 141, __pyx_L1_error) /* "cpython/contextvars.pxd":143 * 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":144 * # 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":145 * 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":133 * * * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< * cdef inline object get_value_no_default(var, default_value=None): * """Return a new reference to the value of the context variable, */ /* 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; } #endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "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", 0); /* "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(5, 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 == ((void *)NULL))) __PYX_ERR(5, 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":35 * 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", 0); /* "asyncpg/pgproto/buffer.pxd":36 * * cdef inline len(self): * return self._length # <<<<<<<<<<<<<< * * cdef inline write_len_prefixed_utf8(self, str s): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":35 * 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":38 * 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", 0); /* "asyncpg/pgproto/buffer.pxd":39 * * 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(6, 39, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 39, __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(6, 39, __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":38 * 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":107 * 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", 0); /* "asyncpg/pgproto/buffer.pxd":108 * * cdef inline len(self): * return self._length # <<<<<<<<<<<<<< * * cdef inline char get_message_type(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":107 * 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":110 * 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":111 * * 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":110 * 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":113 * 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":114 * * 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":113 * 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; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_python_encoding", 0); /* "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); __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ENCODINGS_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_v_pg_encoding; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_7 = __pyx_v_pg_encoding; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __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; if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 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_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return -1; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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; PyObject *__pyx_t_4 = NULL; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); /* "asyncpg/protocol/settings.pyx":15 * * def __cinit__(self): * self._encoding = 'utf-8' # <<<<<<<<<<<<<< * self._is_utf8 = True * self._settings = {} */ __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_utf_8); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_utf_8); __Pyx_GOTREF(__pyx_v_self->_encoding); __Pyx_DECREF(__pyx_v_self->_encoding); __pyx_v_self->_encoding = __pyx_mstate_global->__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(8, 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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_codecs); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 19, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); } __Pyx_GIVEREF((PyObject *)__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_XDECREF(__pyx_t_4); __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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_setting", 0); /* "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(8, 22, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_self->_settings, __pyx_v_name, __pyx_v_val) < 0))) __PYX_ERR(8, 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_mstate_global->__pyx_n_u_client_encoding, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 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(8, 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_codecs); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_py_enc}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(8, 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_mstate_global->__pyx_kp_u_utf_8, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 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_XDECREF(__pyx_t_5); __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", 0); /* "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(8, 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", 0); /* "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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_text_codec", __pyx_kwds); 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", 0); __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(8, 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register_data_types", 0); /* "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 = ((PyObject *)__pyx_v_self->_data_codecs); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_types}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_types, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_types,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 35, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 35, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "register_data_types", 0) < (0)) __PYX_ERR(8, 35, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("register_data_types", 1, 1, 1, i); __PYX_ERR(8, 35, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 35, __pyx_L3_error) } __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(8, 35, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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", 0); __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(8, 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; size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_python_codec", 0); /* "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_mstate_global->__pyx_n_u_binary, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 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_mstate_global->__pyx_n_u_text, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 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_mstate_global->__pyx_n_u_tuple, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/settings.pyx":56 * else: * raise exceptions.InterfaceError( * 'invalid `format` argument, expected {}, got {!r}'.format( # <<<<<<<<<<<<<< * "'text', 'binary' or 'tuple'", format * )) */ __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_invalid_format_argument_expected; __Pyx_INCREF(__pyx_t_6); /* "asyncpg/protocol/settings.pyx":57 * raise exceptions.InterfaceError( * 'invalid `format` argument, expected {}, got {!r}'.format( * "'text', 'binary' or 'tuple'", format # <<<<<<<<<<<<<< * )) * */ __pyx_t_7 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_text_binary_or_tuple, __pyx_v_format}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 55, __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, 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_5 = ((PyObject *)__pyx_v_self->_data_codecs); __Pyx_INCREF(__pyx_t_5); /* "asyncpg/protocol/settings.pyx":63 * typekind, typeinfos, * encoder, decoder, * _format, xformat) # <<<<<<<<<<<<<< * * cpdef inline remove_python_codec(self, typeoid, typename, typeschema): */ __pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v__format); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = 0; { PyObject *__pyx_callargs[10] = {__pyx_t_5, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_typeinfos, __pyx_v_encoder, __pyx_v_decoder, __pyx_t_4, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_python_codec, __pyx_callargs+__pyx_t_7, (10-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,&__pyx_mstate_global->__pyx_n_u_typeinfos,&__pyx_mstate_global->__pyx_n_u_typekind,&__pyx_mstate_global->__pyx_n_u_encoder,&__pyx_mstate_global->__pyx_n_u_decoder,&__pyx_mstate_global->__pyx_n_u_format,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 38, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 8: values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(8, 38, __pyx_L3_error) CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(8, 38, __pyx_L3_error) CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(8, 38, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(8, 38, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(8, 38, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 38, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 38, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 38, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_python_codec", 0) < (0)) __PYX_ERR(8, 38, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 8; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, i); __PYX_ERR(8, 38, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 8)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 38, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 38, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 38, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(8, 38, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(8, 38, __pyx_L3_error) values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(8, 38, __pyx_L3_error) values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(8, 38, __pyx_L3_error) values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(8, 38, __pyx_L3_error) } __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(8, 38, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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", 0); __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(8, 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_python_codec", 0); /* "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 = ((PyObject *)__pyx_v_self->_data_codecs); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove_python_codec, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 65, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 65, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 65, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 65, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "remove_python_codec", 0) < (0)) __PYX_ERR(8, 65, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, i); __PYX_ERR(8, 65, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 65, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 65, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 65, __pyx_L3_error) } __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(8, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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", 0); __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(8, 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear_type_cache", 0); /* "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 = ((PyObject *)__pyx_v_self->_data_codecs); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear_type_cache, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clear_type_cache", __pyx_kwds); 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", 0); __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(8, 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; size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_builtin_type_codec", 0); /* "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_mstate_global->__pyx_n_u_binary, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 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_mstate_global->__pyx_n_u_text, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/settings.pyx":84 * else: * raise exceptions.InterfaceError( * 'invalid `format` argument, expected {}, got {!r}'.format( # <<<<<<<<<<<<<< * "'text' or 'binary'", format * )) */ __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_invalid_format_argument_expected; __Pyx_INCREF(__pyx_t_6); /* "asyncpg/protocol/settings.pyx":85 * raise exceptions.InterfaceError( * 'invalid `format` argument, expected {}, got {!r}'.format( * "'text' or 'binary'", format # <<<<<<<<<<<<<< * )) * */ __pyx_t_7 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_text_or_binary, __pyx_v_format}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 83, __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, 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_5 = ((PyObject *)__pyx_v_self->_data_codecs); __Pyx_INCREF(__pyx_t_5); /* "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_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v__format); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = 0; { 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_4}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_builtin_type_codec, __pyx_callargs+__pyx_t_7, (7-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(8, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,&__pyx_mstate_global->__pyx_n_u_typekind,&__pyx_mstate_global->__pyx_n_u_alias_to,&__pyx_mstate_global->__pyx_n_u_format,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 71, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(8, 71, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(8, 71, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(8, 71, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 71, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 71, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 71, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_builtin_type_codec", 0) < (0)) __PYX_ERR(8, 71, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 6; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 6, 6, i); __PYX_ERR(8, 71, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 71, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 71, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 71, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(8, 71, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(8, 71, __pyx_L3_error) values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(8, 71, __pyx_L3_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", 1, 6, 6, __pyx_nargs); __PYX_ERR(8, 71, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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", 0); __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(8, 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_mstate_global->__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", 0); 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(8, 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_oid,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_ignore_custom_codec,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(8, 91, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 91, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 91, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 91, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_data_codec", 0) < (0)) __PYX_ERR(8, 91, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_data_codec", 0, 1, 3, i); __PYX_ERR(8, 91, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 91, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 91, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 91, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_oid = __Pyx_PyLong_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(8, 91, __pyx_L3_error) if (values[1]) { __pyx_v_format = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 92, __pyx_L3_error) } else { __pyx_v_format = __pyx_mstate_global->__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(8, 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(8, 91, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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", 0); __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(8, 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; size_t __pyx_t_3; int __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; 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("__getattr__", 0); /* "asyncpg/protocol/settings.pyx":97 * * def __getattr__(self, name): * if not name.startswith('_'): # <<<<<<<<<<<<<< * try: * return self._settings[name] */ __pyx_t_2 = __pyx_v_name; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u__2}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { /* "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_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/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(8, 99, __pyx_L4_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_settings, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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; /* "asyncpg/protocol/settings.pyx":100 * try: * return self._settings[name] * except KeyError: # <<<<<<<<<<<<<< * raise AttributeError(name) from None * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_KeyError)))); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(8, 100, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_10); /* "asyncpg/protocol/settings.pyx":101 * return self._settings[name] * except KeyError: * raise AttributeError(name) from None # <<<<<<<<<<<<<< * * return object.__getattribute__(self, name) */ __pyx_t_12 = NULL; __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_name}; __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_AttributeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 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(8, 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_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_L8_try_return:; __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_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_builtin_object; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_name}; __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getattribute, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_r = __pyx_t_10; __pyx_t_10 = 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_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "asyncpg/protocol/settings.pyx":106 * * def __repr__(self): * return ''.format(self._settings) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_mstate_global->__pyx_kp_u_ConnectionSettings_r; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->_settings}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(9, 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 3, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 3, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 3, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error) } __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(9, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(9, 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":20 * cdef class CodecMap: * * def __cinit__(self): # <<<<<<<<<<<<<< * self.extra_codecs = {} * self.binary_codec_map = cpython.PyMem_Calloc( */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return -1; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;} __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__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("__cinit__", 0); /* "asyncpg/protocol/codecs/base.pyx":21 * * def __cinit__(self): * self.extra_codecs = {} # <<<<<<<<<<<<<< * self.binary_codec_map = cpython.PyMem_Calloc( * (MAXSUPPORTEDOID + 1) * 2, sizeof(void *)) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->extra_codecs); __Pyx_DECREF(__pyx_v_self->extra_codecs); __pyx_v_self->extra_codecs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":22 * def __cinit__(self): * self.extra_codecs = {} * self.binary_codec_map = cpython.PyMem_Calloc( # <<<<<<<<<<<<<< * (MAXSUPPORTEDOID + 1) * 2, sizeof(void *)) * self.text_codec_map = cpython.PyMem_Calloc( */ __pyx_v_self->binary_codec_map = ((void **)PyMem_Calloc(0x27b2, (sizeof(void *)))); /* "asyncpg/protocol/codecs/base.pyx":24 * self.binary_codec_map = cpython.PyMem_Calloc( * (MAXSUPPORTEDOID + 1) * 2, sizeof(void *)) * self.text_codec_map = cpython.PyMem_Calloc( # <<<<<<<<<<<<<< * (MAXSUPPORTEDOID + 1) * 2, sizeof(void *)) * */ __pyx_v_self->text_codec_map = ((void **)PyMem_Calloc(0x27b2, (sizeof(void *)))); /* "asyncpg/protocol/codecs/base.pyx":20 * cdef class CodecMap: * * def __cinit__(self): # <<<<<<<<<<<<<< * self.extra_codecs = {} * self.binary_codec_map = cpython.PyMem_Calloc( */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CodecMap.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":27 * (MAXSUPPORTEDOID + 1) * 2, sizeof(void *)) * * cdef inline void *get_binary_codec_ptr(self, uint32_t idx): # <<<<<<<<<<<<<< * return self.binary_codec_map[idx] * */ static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx) { void *__pyx_r; /* "asyncpg/protocol/codecs/base.pyx":28 * * cdef inline void *get_binary_codec_ptr(self, uint32_t idx): * return self.binary_codec_map[idx] # <<<<<<<<<<<<<< * * cdef inline void set_binary_codec_ptr(self, uint32_t idx, void *ptr): */ __pyx_r = ((void *)(__pyx_v_self->binary_codec_map[__pyx_v_idx])); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":27 * (MAXSUPPORTEDOID + 1) * 2, sizeof(void *)) * * cdef inline void *get_binary_codec_ptr(self, uint32_t idx): # <<<<<<<<<<<<<< * return self.binary_codec_map[idx] * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":30 * return self.binary_codec_map[idx] * * cdef inline void set_binary_codec_ptr(self, uint32_t idx, void *ptr): # <<<<<<<<<<<<<< * self.binary_codec_map[idx] = ptr * */ static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx, void *__pyx_v_ptr) { /* "asyncpg/protocol/codecs/base.pyx":31 * * cdef inline void set_binary_codec_ptr(self, uint32_t idx, void *ptr): * self.binary_codec_map[idx] = ptr # <<<<<<<<<<<<<< * * cdef inline void *get_text_codec_ptr(self, uint32_t idx): */ (__pyx_v_self->binary_codec_map[__pyx_v_idx]) = __pyx_v_ptr; /* "asyncpg/protocol/codecs/base.pyx":30 * return self.binary_codec_map[idx] * * cdef inline void set_binary_codec_ptr(self, uint32_t idx, void *ptr): # <<<<<<<<<<<<<< * self.binary_codec_map[idx] = ptr * */ /* function exit code */ } /* "asyncpg/protocol/codecs/base.pyx":33 * self.binary_codec_map[idx] = ptr * * cdef inline void *get_text_codec_ptr(self, uint32_t idx): # <<<<<<<<<<<<<< * return self.text_codec_map[idx] * */ static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx) { void *__pyx_r; /* "asyncpg/protocol/codecs/base.pyx":34 * * cdef inline void *get_text_codec_ptr(self, uint32_t idx): * return self.text_codec_map[idx] # <<<<<<<<<<<<<< * * cdef inline void set_text_codec_ptr(self, uint32_t idx, void *ptr): */ __pyx_r = ((void *)(__pyx_v_self->text_codec_map[__pyx_v_idx])); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":33 * self.binary_codec_map[idx] = ptr * * cdef inline void *get_text_codec_ptr(self, uint32_t idx): # <<<<<<<<<<<<<< * return self.text_codec_map[idx] * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":36 * return self.text_codec_map[idx] * * cdef inline void set_text_codec_ptr(self, uint32_t idx, void *ptr): # <<<<<<<<<<<<<< * self.text_codec_map[idx] = ptr * */ static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx, void *__pyx_v_ptr) { /* "asyncpg/protocol/codecs/base.pyx":37 * * cdef inline void set_text_codec_ptr(self, uint32_t idx, void *ptr): * self.text_codec_map[idx] = ptr # <<<<<<<<<<<<<< * * */ (__pyx_v_self->text_codec_map[__pyx_v_idx]) = __pyx_v_ptr; /* "asyncpg/protocol/codecs/base.pyx":36 * return self.text_codec_map[idx] * * cdef inline void set_text_codec_ptr(self, uint32_t idx, void *ptr): # <<<<<<<<<<<<<< * self.text_codec_map[idx] = ptr * */ /* function exit code */ } /* "(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_8CodecMap_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_8CodecMap_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;} __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap_2__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(9, 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.CodecMap.__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_8CodecMap_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_8CodecMap_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 3, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 3, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 3, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error) } __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(9, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("asyncpg.protocol.protocol.CodecMap.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap_4__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(9, 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.CodecMap.__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":46 * 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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_oid,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 46, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 46, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 46, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, i); __PYX_ERR(1, 46, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 46, __pyx_L3_error) } __pyx_v_oid = __Pyx_PyLong_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 46, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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":47 * * 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":48 * 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":46 * 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":50 * 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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; 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", 0); /* "asyncpg/protocol/codecs/base.pyx":70 * ): * * 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":71 * * 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":72 * 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":73 * 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":74 * 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":75 * 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":76 * 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":77 * 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":78 * 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":79 * 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":80 * 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":81 * 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":82 * 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":83 * 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":84 * 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":85 * 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":87 * 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":88 * * 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":89 * 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_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_base_codec_is_mutually_exclusive}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 89, __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(1, 89, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":88 * * 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":87 * 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":93 * ) * * if element_names is not None: # <<<<<<<<<<<<<< * self.record_desc = RecordDescriptor( * element_names, tuple(element_names)) */ __pyx_t_1 = (__pyx_v_element_names != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":94 * * if element_names is not None: * self.record_desc = RecordDescriptor( # <<<<<<<<<<<<<< * element_names, tuple(element_names)) * else: */ __pyx_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RecordDescriptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/base.pyx":95 * if element_names is not None: * self.record_desc = RecordDescriptor( * element_names, tuple(element_names)) # <<<<<<<<<<<<<< * else: * self.record_desc = None */ __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_element_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_element_names, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } /* "asyncpg/protocol/codecs/base.pyx":94 * * if element_names is not None: * self.record_desc = RecordDescriptor( # <<<<<<<<<<<<<< * element_names, tuple(element_names)) * else: */ __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->record_desc); __Pyx_DECREF(__pyx_v_self->record_desc); __pyx_v_self->record_desc = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":93 * ) * * if element_names is not None: # <<<<<<<<<<<<<< * self.record_desc = RecordDescriptor( * element_names, tuple(element_names)) */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":97 * 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":99 * 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":100 * * 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":101 * 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":99 * 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":103 * 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":104 * 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":105 * 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":103 * 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":107 * 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":108 * 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":102 * 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":110 * 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":111 * 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":113 * 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_8 = __pyx_mstate_global->__pyx_kp_u_cannot_decode_type_text_encoding; __Pyx_INCREF(__pyx_t_8); __pyx_t_7 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_schema, __pyx_v_name}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __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(1, 111, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":110 * 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":114 * '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":115 * '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":109 * 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":117 * 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":118 * 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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":120 * 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_8 = __pyx_mstate_global->__pyx_kp_u_cannot_decode_type_text_encoding; __Pyx_INCREF(__pyx_t_8); __pyx_t_7 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_schema, __pyx_v_name}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 118, __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(1, 118, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":117 * 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":121 * '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":122 * '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":116 * 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":124 * 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":125 * 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":127 * 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_8 = __pyx_mstate_global->__pyx_kp_u_cannot_decode_type_text_encoding_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_7 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_schema, __pyx_v_name}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 125, __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(1, 125, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":124 * 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":128 * '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":129 * '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":123 * 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":131 * 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":132 * 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":130 * 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":134 * self.decoder = &self.decode_in_python * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'unexpected codec type: {}'.format(type)) * */ __pyx_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":135 * else: * raise exceptions.InternalClientError( * 'unexpected codec type: {}'.format(type)) # <<<<<<<<<<<<<< * * cdef Codec copy(self): */ __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_unexpected_codec_type; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(__pyx_v_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 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(1, 134, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":50 * 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_6); __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":137 * '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; size_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; 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("copy", 0); /* "asyncpg/protocol/codecs/base.pyx":140 * cdef Codec codec * * codec = Codec(self.oid) # <<<<<<<<<<<<<< * codec.init(self.name, self.schema, self.kind, * self.type, self.format, self.xformat, */ __pyx_t_2 = NULL; __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_self->oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 140, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__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":141 * * 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_1 = __pyx_v_self->name; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_v_self->schema; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_v_self->kind; __Pyx_INCREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":143 * 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_5 = ((PyObject *)__pyx_v_self->base_codec); __Pyx_INCREF(__pyx_t_5); /* "asyncpg/protocol/codecs/base.pyx":144 * 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_6 = __pyx_v_self->py_encoder; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = __pyx_v_self->py_decoder; __Pyx_INCREF(__pyx_t_7); /* "asyncpg/protocol/codecs/base.pyx":145 * 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_8 = ((PyObject *)__pyx_v_self->element_codec); __Pyx_INCREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":146 * self.py_encoder, self.py_decoder, * self.element_codec, * self.element_type_oids, self.element_names, # <<<<<<<<<<<<<< * self.element_codecs, self.element_delimiter) * */ __pyx_t_9 = __pyx_v_self->element_type_oids; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = __pyx_v_self->element_names; __Pyx_INCREF(__pyx_t_10); /* "asyncpg/protocol/codecs/base.pyx":147 * self.element_codec, * self.element_type_oids, self.element_names, * self.element_codecs, self.element_delimiter) # <<<<<<<<<<<<<< * * return codec */ __pyx_t_11 = __pyx_v_self->element_codecs; __Pyx_INCREF(__pyx_t_11); /* "asyncpg/protocol/codecs/base.pyx":141 * * 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_12 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_2), __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_5), __pyx_t_6, __pyx_t_7, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_8), ((PyObject*)__pyx_t_9), __pyx_t_10, ((PyObject*)__pyx_t_11), __pyx_v_self->element_delimiter); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "asyncpg/protocol/codecs/base.pyx":149 * 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":137 * '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_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_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":151 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":153 * 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(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":151 * 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":155 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":157 * 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(1, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":155 * 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":161 * (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", 0); /* "asyncpg/protocol/codecs/base.pyx":163 * 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":166 * 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(1, 163, __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":161 * (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":168 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":170 * 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(1, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":168 * 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":174 * (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", 0); /* "asyncpg/protocol/codecs/base.pyx":176 * 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(1, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":174 * (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":180 * (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; PyObject *__pyx_t_17 = NULL; size_t __pyx_t_18; int32_t __pyx_t_19; 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":185 * 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":190 * 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_mstate_global->__pyx_n_u_MappingABC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 190, __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(1, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/codecs/base.pyx":192 * 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(1, 192, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_composite_size = __pyx_t_3; /* "asyncpg/protocol/codecs/base.pyx":193 * # 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(1, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rec = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":195 * 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":196 * * 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":197 * 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":199 * 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(1, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 199, __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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 199, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 199, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); #endif ++__pyx_t_3; } if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 199, __pyx_L1_error) } else { __pyx_t_8 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 199, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":200 * * 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":201 * 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(1, 201, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 201, __pyx_L8_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_i = __pyx_t_6; /* "asyncpg/protocol/codecs/base.pyx":200 * * 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":202 * try: * i = self.element_names[field] * except KeyError: # <<<<<<<<<<<<<< * raise ValueError( * '{!r} is not a valid element of composite ' */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_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(1, 202, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /* "asyncpg/protocol/codecs/base.pyx":203 * 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 = NULL; /* "asyncpg/protocol/codecs/base.pyx":205 * raise ValueError( * '{!r} is not a valid element of composite ' * 'type {}'.format(field, self.name)) from None # <<<<<<<<<<<<<< * * item = obj[field] */ __pyx_t_17 = __pyx_mstate_global->__pyx_kp_u_r_is_not_a_valid_element_of_com; __Pyx_INCREF(__pyx_t_17); __pyx_t_18 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_17, __pyx_v_field, __pyx_v_self->name}; __pyx_t_16 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_18, (3-__pyx_t_18) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 205, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_16); } __pyx_t_18 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_16}; __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 203, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_14); } __Pyx_Raise(__pyx_t_14, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __PYX_ERR(1, 203, __pyx_L10_except_error) } goto __pyx_L10_except_error; /* "asyncpg/protocol/codecs/base.pyx":200 * * 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":207 * '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(1, 207, __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":208 * * item = obj[field] * cpython.Py_INCREF(item) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(rec, i, item) * */ Py_INCREF(__pyx_v_item); /* "asyncpg/protocol/codecs/base.pyx":209 * 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":199 * 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":211 * 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":190 * 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":213 * 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(1, 213, __pyx_L1_error) __pyx_v_count = __pyx_t_3; /* "asyncpg/protocol/codecs/base.pyx":214 * * 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":215 * count = len(obj) * if count > _MAXINT32: * raise ValueError('too many elements in composite type record') # <<<<<<<<<<<<<< * * elem_data = WriteBuffer.new() */ __pyx_t_13 = NULL; __pyx_t_18 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_composite_t}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __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(1, 215, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":214 * * count = len(obj) * if count > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in composite type record') * */ } /* "asyncpg/protocol/codecs/base.pyx":217 * 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->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 217, __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":218 * * 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":219 * 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(1, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 219, __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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 219, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_13 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 219, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_13 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); #else __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); #endif ++__pyx_t_3; } if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 219, __pyx_L1_error) } else { __pyx_t_13 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_13)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 219, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/codecs/base.pyx":220 * 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(1, 220, __pyx_L1_error) } __pyx_t_13 = __Pyx_GetItemInt_Tuple(__pyx_v_self->element_type_oids, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_19 = __Pyx_PyLong_As_int32_t(__pyx_t_13); if (unlikely((__pyx_t_19 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 220, __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_19)); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/codecs/base.pyx":221 * 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":222 * 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(1, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/codecs/base.pyx":221 * 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":224 * 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(1, 224, __pyx_L1_error) } __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_elem_codecs, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 224, __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(1, 224, __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":225 * 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":219 * 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":227 * 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(1, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":180 * (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_XDECREF(__pyx_t_17); __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":229 * 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; size_t __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", 0); /* "asyncpg/protocol/codecs/base.pyx":231 * 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_t_2 = NULL; __Pyx_INCREF(__pyx_v_self->py_encoder); __pyx_t_3 = __pyx_v_self->py_encoder; __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":232 * 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":233 * 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":234 * 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(1, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":233 * 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":236 * 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(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":235 * 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":238 * pgproto.text_encode(settings, buf, data) * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":239 * 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_6 = __pyx_mstate_global->__pyx_kp_u_unexpected_data_format; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_self->format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __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(1, 238, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":232 * 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":241 * '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":242 * 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(1, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":241 * '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":244 * 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(1, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":240 * 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":246 * self.c_encoder(settings, buf, data) * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'unexpected exchange format: {}'.format(self.xformat)) * */ __pyx_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":247 * else: * raise exceptions.InternalClientError( * 'unexpected exchange format: {}'.format(self.xformat)) # <<<<<<<<<<<<<< * * cdef encode(self, ConnectionSettings settings, WriteBuffer buf, */ __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_unexpected_exchange_format; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_self->xformat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 246, __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(1, 246, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":229 * 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":249 * '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", 0); /* "asyncpg/protocol/codecs/base.pyx":251 * 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(1, 251, __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":249 * '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":253 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":254 * * 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(1, 254, __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":253 * 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":256 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":257 * * 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":258 * 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(1, 257, __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":256 * 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":260 * (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", 0); /* "asyncpg/protocol/codecs/base.pyx":262 * 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":264 * 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(1, 262, __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":260 * (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":266 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":267 * * 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":268 * 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(1, 267, __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":266 * 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":270 * (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", 0); /* "asyncpg/protocol/codecs/base.pyx":271 * * 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":272 * 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(1, 271, __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":270 * (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":274 * (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; PyObject *__pyx_t_10 = NULL; size_t __pyx_t_11; Py_ssize_t __pyx_t_12; Py_ssize_t __pyx_t_13; Py_ssize_t __pyx_t_14; uint32_t __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; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_21; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode_composite", 0); /* "asyncpg/protocol/codecs/base.pyx":286 * 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 == ((void *)NULL))) __PYX_ERR(1, 286, __pyx_L1_error) __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_1))); /* "asyncpg/protocol/codecs/base.pyx":287 * * 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(1, 287, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 287, __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":288 * 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_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_OutdatedSchemaCacheError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":291 * 'unexpected number of attributes of composite type: ' * '{}, expected {}' * .format( # <<<<<<<<<<<<<< * elem_count, * len(self.element_type_oids), */ __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_unexpected_number_of_attributes; __Pyx_INCREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":292 * '{}, expected {}' * .format( * elem_count, # <<<<<<<<<<<<<< * len(self.element_type_oids), * ), */ __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_elem_count); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/codecs/base.pyx":293 * .format( * elem_count, * len(self.element_type_oids), # <<<<<<<<<<<<<< * ), * schema=self.schema, */ __pyx_t_10 = __pyx_v_self->element_type_oids; __Pyx_INCREF(__pyx_t_10); if (unlikely(__pyx_t_10 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 293, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_9, __pyx_t_10}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } /* "asyncpg/protocol/codecs/base.pyx":296 * ), * schema=self.schema, * data_type=self.name, # <<<<<<<<<<<<<< * ) * result = self.record_desc.make_record(asyncpg.Record, elem_count) */ __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_5, __pyx_t_6}; __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, __pyx_v_self->schema, __pyx_t_10, __pyx_callargs+2, 0) < (0)) __PYX_ERR(1, 288, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_data_type, __pyx_v_self->name, __pyx_t_10, __pyx_callargs+2, 1) < (0)) __PYX_ERR(1, 288, __pyx_L1_error) __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __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(1, 288, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":287 * * 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":298 * data_type=self.name, * ) * result = self.record_desc.make_record(asyncpg.Record, elem_count) # <<<<<<<<<<<<<< * for i in range(elem_count): * elem_typ = self.element_type_oids[i] */ __pyx_t_7 = __pyx_v_self->record_desc; __Pyx_INCREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_asyncpg); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_Record); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_elem_count); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_10}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_record, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":299 * ) * result = self.record_desc.make_record(asyncpg.Record, 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_12 = __pyx_v_elem_count; __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/protocol/codecs/base.pyx":300 * result = self.record_desc.make_record(asyncpg.Record, 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(1, 300, __pyx_L1_error) } __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->element_type_oids, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = __Pyx_PyLong_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_elem_typ = __pyx_t_15; /* "asyncpg/protocol/codecs/base.pyx":301 * 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 == ((void *)NULL))) __PYX_ERR(1, 301, __pyx_L1_error) __pyx_v_received_elem_typ = ((uint32_t)unpack_int32(__pyx_t_1)); /* "asyncpg/protocol/codecs/base.pyx":303 * 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":304 * * if received_elem_typ != elem_typ: * raise exceptions.OutdatedSchemaCacheError( # <<<<<<<<<<<<<< * 'unexpected data type of composite type attribute {}: ' * '{!r}, expected {!r}' */ __pyx_t_10 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_OutdatedSchemaCacheError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":307 * 'unexpected data type of composite type attribute {}: ' * '{!r}, expected {!r}' * .format( # <<<<<<<<<<<<<< * i, * BUILTIN_TYPE_OID_MAP.get( */ __pyx_t_5 = __pyx_mstate_global->__pyx_kp_u_unexpected_data_type_of_composit; __Pyx_INCREF(__pyx_t_5); /* "asyncpg/protocol/codecs/base.pyx":308 * '{!r}, expected {!r}' * .format( * i, # <<<<<<<<<<<<<< * BUILTIN_TYPE_OID_MAP.get( * received_elem_typ, received_elem_typ), */ __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/codecs/base.pyx":309 * .format( * i, * BUILTIN_TYPE_OID_MAP.get( # <<<<<<<<<<<<<< * received_elem_typ, received_elem_typ), * BUILTIN_TYPE_OID_MAP.get( */ __pyx_t_16 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/codecs/base.pyx":310 * i, * BUILTIN_TYPE_OID_MAP.get( * received_elem_typ, received_elem_typ), # <<<<<<<<<<<<<< * BUILTIN_TYPE_OID_MAP.get( * elem_typ, elem_typ) */ __pyx_t_17 = __Pyx_PyLong_From_uint32_t(__pyx_v_received_elem_typ); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_19 = __Pyx_PyLong_From_uint32_t(__pyx_v_received_elem_typ); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_18))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_18); assert(__pyx_t_16); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_18, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_t_17, __pyx_t_19}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } /* "asyncpg/protocol/codecs/base.pyx":311 * BUILTIN_TYPE_OID_MAP.get( * received_elem_typ, received_elem_typ), * BUILTIN_TYPE_OID_MAP.get( # <<<<<<<<<<<<<< * elem_typ, elem_typ) * ), */ __pyx_t_19 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/codecs/base.pyx":312 * received_elem_typ, received_elem_typ), * BUILTIN_TYPE_OID_MAP.get( * elem_typ, elem_typ) # <<<<<<<<<<<<<< * ), * schema=self.schema, */ __pyx_t_17 = __Pyx_PyLong_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_20 = __Pyx_PyLong_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_16))) { __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_16); assert(__pyx_t_19); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_19); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_16, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_19, __pyx_t_17, __pyx_t_20}; __pyx_t_18 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); } __pyx_t_11 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_t_9, __pyx_t_8, __pyx_t_18}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_11, (4-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } /* "asyncpg/protocol/codecs/base.pyx":316 * schema=self.schema, * data_type=self.name, * position=i, # <<<<<<<<<<<<<< * ) * */ __pyx_t_18 = PyLong_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_10, __pyx_t_6}; __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, __pyx_v_self->schema, __pyx_t_8, __pyx_callargs+2, 0) < (0)) __PYX_ERR(1, 304, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_data_type, __pyx_v_self->name, __pyx_t_8, __pyx_callargs+2, 1) < (0)) __PYX_ERR(1, 304, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_position, __pyx_t_18, __pyx_t_8, __pyx_callargs+2, 2) < (0)) __PYX_ERR(1, 304, __pyx_L1_error) __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __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(1, 304, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":303 * 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":319 * ) * * 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 == ((void *)NULL))) __PYX_ERR(1, 319, __pyx_L1_error) __pyx_v_elem_len = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/base.pyx":320 * * 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":321 * 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":320 * * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":323 * 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(1, 323, __pyx_L1_error) } __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->element_codecs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 323, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":325 * 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_21 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_21 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 325, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":324 * else: * elem_codec = self.element_codecs[i] * 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_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L7:; /* "asyncpg/protocol/codecs/base.pyx":327 * settings, frb_slice_from(&elem_buf, buf, elem_len)) * * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * recordcapi.ApgRecord_SET_ITEM(result, i, elem) * */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/codecs/base.pyx":328 * * cpython.Py_INCREF(elem) * recordcapi.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":330 * recordcapi.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":274 * (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_10); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __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":332 * 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; size_t __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", 0); /* "asyncpg/protocol/codecs/base.pyx":334 * 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":335 * 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":336 * 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(1, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":335 * 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":338 * 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(1, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":337 * 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":340 * data = pgproto.text_decode(settings, buf) * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: */ __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":341 * 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_mstate_global->__pyx_kp_u_unexpected_data_format; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_self->format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 340, __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(1, 340, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":334 * 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":343 * '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":344 * 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(1, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":343 * '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":346 * 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(1, 346, __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":342 * 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":348 * data = self.c_decoder(settings, buf) * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'unexpected exchange format: {}'.format(self.xformat)) * */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":349 * else: * raise exceptions.InternalClientError( * 'unexpected exchange format: {}'.format(self.xformat)) # <<<<<<<<<<<<<< * * return self.py_decoder(data) */ __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_unexpected_exchange_format; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_self->xformat); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 348, __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(1, 348, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":351 * 'unexpected exchange format: {}'.format(self.xformat)) * * return self.py_decoder(data) # <<<<<<<<<<<<<< * * cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_self->py_decoder); __pyx_t_3 = __pyx_v_self->py_decoder; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 351, __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":332 * 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":353 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":354 * * 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(1, 354, __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":353 * 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":356 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":359 * 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":360 * * 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":359 * 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":364 * 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":363 * * 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":364 * 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":365 * 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":364 * 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":362 * return True * * elif ( # <<<<<<<<<<<<<< * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE */ if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":367 * 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(1, 367, __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":362 * return True * * elif ( # <<<<<<<<<<<<<< * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE */ } /* "asyncpg/protocol/codecs/base.pyx":369 * 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":370 * * 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(1, 370, __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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 370, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 370, __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":371 * 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(1, 371, __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(1, 371, __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":372 * 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":371 * 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":370 * * 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":373 * 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":369 * 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":376 * * 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":356 * 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":378 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":381 * 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":382 * * 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":381 * 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":386 * 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":385 * * 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":386 * 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":387 * 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":386 * 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":384 * return True * * elif ( # <<<<<<<<<<<<<< * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE */ if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":389 * 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(1, 389, __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":384 * return True * * elif ( # <<<<<<<<<<<<<< * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE */ } /* "asyncpg/protocol/codecs/base.pyx":391 * 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":392 * * 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(1, 392, __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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 392, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 392, __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":393 * 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(1, 393, __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(1, 393, __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":394 * 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":393 * 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":392 * * 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":395 * 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":391 * 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":398 * * 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":378 * 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":400 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":401 * * 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(1, 401, __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":400 * 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":403 * 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; size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "asyncpg/protocol/codecs/base.pyx":404 * * 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_mstate_global->__pyx_kp_u_Codec_oid_elem_oid_core; __Pyx_INCREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":405 * 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_PyLong_From_uint32_t(__pyx_v_self->oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/base.pyx":406 * 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_mstate_global->__pyx_n_u_NA); __pyx_t_4 = __pyx_mstate_global->__pyx_n_u_NA; } else { __pyx_t_6 = __Pyx_PyLong_From_uint32_t(__pyx_v_self->element_codec->oid); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; } /* "asyncpg/protocol/codecs/base.pyx":407 * 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(1, 407, __pyx_L1_error) __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 404, __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":403 * 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_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":409 * has_core_codec(self.oid)) * * @staticmethod # <<<<<<<<<<<<<< * cdef Codec new_array_codec(uint32_t oid, * str name, */ 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; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_array_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":416 * 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_2 = NULL; __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__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":417 * 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__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_1)) __PYX_ERR(1, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":420 * 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":409 * has_core_codec(self.oid)) * * @staticmethod # <<<<<<<<<<<<<< * cdef Codec new_array_codec(uint32_t oid, * str name, */ /* 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.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":422 * return codec * * @staticmethod # <<<<<<<<<<<<<< * cdef Codec new_range_codec(uint32_t oid, * str name, */ 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; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_range_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":428 * 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_2 = NULL; __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 428, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__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":429 * 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__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_1)) __PYX_ERR(1, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":432 * 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":422 * return codec * * @staticmethod # <<<<<<<<<<<<<< * cdef Codec new_range_codec(uint32_t oid, * str name, */ /* 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.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":434 * return codec * * @staticmethod # <<<<<<<<<<<<<< * cdef Codec new_multirange_codec(uint32_t oid, * str name, */ 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; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_multirange_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":440 * 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_2 = NULL; __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 440, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__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":441 * 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__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_1)) __PYX_ERR(1, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":444 * 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":434 * return codec * * @staticmethod # <<<<<<<<<<<<<< * cdef Codec new_multirange_codec(uint32_t oid, * str name, */ /* 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.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":446 * return codec * * @staticmethod # <<<<<<<<<<<<<< * cdef Codec new_composite_codec(uint32_t oid, * str name, */ 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; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_composite_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":455 * 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_2 = NULL; __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 455, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__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":456 * 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__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_1)) __PYX_ERR(1, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":459 * 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":446 * return codec * * @staticmethod # <<<<<<<<<<<<<< * cdef Codec new_composite_codec(uint32_t oid, * str name, */ /* 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.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":461 * return codec * * @staticmethod # <<<<<<<<<<<<<< * cdef Codec new_python_codec(uint32_t oid, * str name, */ 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; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_python_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":474 * 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_2 = NULL; __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 474, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__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":475 * 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_1 = __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_1)) __PYX_ERR(1, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":478 * 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":461 * return codec * * @staticmethod # <<<<<<<<<<<<<< * cdef Codec new_python_codec(uint32_t oid, * str name, */ /* 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.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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(9, 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 3, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 3, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 3, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error) } __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(9, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(9, 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":482 * * # 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", 0); /* "asyncpg/protocol/codecs/base.pyx":484 * 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(1, 484, __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":482 * * # 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":488 * * # 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", 0); /* "asyncpg/protocol/codecs/base.pyx":490 * 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(1, 490, __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":488 * * # 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":493 * * * 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; 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; size_t __pyx_t_12; uint32_t __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pylong_as_oid", 0); /* "asyncpg/protocol/codecs/base.pyx":495 * 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":496 * cdef: * int64_t oid = 0 * bint overflow = False # <<<<<<<<<<<<<< * * try: */ __pyx_v_overflow = 0; /* "asyncpg/protocol/codecs/base.pyx":498 * 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":499 * * 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(1, 499, __pyx_L3_error) __pyx_v_oid = __pyx_t_4; /* "asyncpg/protocol/codecs/base.pyx":498 * 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":500 * try: * oid = cpython.PyLong_AsLongLong(val) * except OverflowError: # <<<<<<<<<<<<<< * overflow = True * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_OverflowError)))); if (__pyx_t_5) { __Pyx_ErrRestore(0,0,0); /* "asyncpg/protocol/codecs/base.pyx":501 * oid = cpython.PyLong_AsLongLong(val) * except OverflowError: * overflow = True # <<<<<<<<<<<<<< * * if overflow or (oid < 0 or oid > UINT32_MAX): */ __pyx_v_overflow = 1; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/protocol/codecs/base.pyx":498 * 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":503 * 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_6 = __pyx_v_overflow; goto __pyx_L12_bool_binop_done; } __pyx_t_7 = (__pyx_v_oid < 0); if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L12_bool_binop_done; } __pyx_t_7 = (__pyx_v_oid > UINT32_MAX); __pyx_t_6 = __pyx_t_7; __pyx_L12_bool_binop_done:; if (unlikely(__pyx_t_6)) { /* "asyncpg/protocol/codecs/base.pyx":504 * * if overflow or (oid < 0 or oid > UINT32_MAX): * raise OverflowError('OID value too large: {!r}'.format(val)) # <<<<<<<<<<<<<< * * return val */ __pyx_t_9 = NULL; __pyx_t_11 = __pyx_mstate_global->__pyx_kp_u_OID_value_too_large_r; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_val}; __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_12 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(1, 504, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":503 * 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":506 * raise OverflowError('OID value too large: {!r}'.format(val)) * * return val # <<<<<<<<<<<<<< * * */ __pyx_t_13 = __Pyx_PyLong_As_uint32_t(__pyx_v_val); if (unlikely((__pyx_t_13 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 506, __pyx_L1_error) __pyx_r = ((uint32_t)__pyx_t_13); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":493 * * * cdef uint32_t pylong_as_oid(val) except? 0xFFFFFFFFl: # <<<<<<<<<<<<<< * cdef: * int64_t oid = 0 */ /* function exit code */ __pyx_L1_error:; __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.pylong_as_oid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0xFFFFFFFFL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":510 * * 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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return -1; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); 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__", 0); /* "asyncpg/protocol/codecs/base.pyx":513 * # 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(1, 513, __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":515 * 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(1, 515, __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":510 * * 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":517 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_types,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 517, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 517, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_types", 0) < (0)) __PYX_ERR(1, 517, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_types", 1, 1, 1, i); __PYX_ERR(1, 517, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 517, __pyx_L3_error) } __pyx_v_types = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_types", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 517, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; size_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; Py_UCS4 __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; Py_ssize_t __pyx_t_14; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; PyObject *(*__pyx_t_17)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_types", 0); /* "asyncpg/protocol/codecs/base.pyx":526 * 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(1, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 526, __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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 526, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 526, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif ++__pyx_t_2; } if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 526, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 526, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_ti, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":527 * * 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_mstate_global->__pyx_n_u_oid); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 527, __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":529 * oid = ti['oid'] * * if self.get_codec(oid, PG_FORMAT_ANY) is not None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 529, __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(1, 529, __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":530 * * if self.get_codec(oid, PG_FORMAT_ANY) is not None: * continue # <<<<<<<<<<<<<< * * name = ti['name'] */ goto __pyx_L3_continue; /* "asyncpg/protocol/codecs/base.pyx":529 * oid = ti['oid'] * * if self.get_codec(oid, PG_FORMAT_ANY) is not None: # <<<<<<<<<<<<<< * continue * */ } /* "asyncpg/protocol/codecs/base.pyx":532 * continue * * name = ti['name'] # <<<<<<<<<<<<<< * schema = ti['ns'] * array_element_oid = ti['elemtype'] */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 532, __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":533 * * 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_mstate_global->__pyx_n_u_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 533, __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":534 * 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_mstate_global->__pyx_n_u_elemtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 534, __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":535 * 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_mstate_global->__pyx_n_u_range_subtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 535, __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":536 * 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_mstate_global->__pyx_n_u_attrtypoids); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 536, __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(1, 536, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":537 * 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_mstate_global->__pyx_n_u_attrtypoids); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 537, __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":536 * 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":539 * 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":540 * else: * comp_type_attrs = None * base_type = ti['basetype'] # <<<<<<<<<<<<<< * * if array_element_oid: */ __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_basetype); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 540, __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":542 * 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(1, 542, __pyx_L1_error) if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":546 * * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): # <<<<<<<<<<<<<< * name = name[1:] * name = '{}[]'.format(name) */ __pyx_t_4 = __pyx_v_name; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u__2}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":547 * # 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_mstate_global->__pyx_slice[0], 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 547, __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":546 * * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): # <<<<<<<<<<<<<< * name = name[1:] * name = '{}[]'.format(name) */ } /* "asyncpg/protocol/codecs/base.pyx":548 * if name.startswith('_'): * name = name[1:] * name = '{}[]'.format(name) # <<<<<<<<<<<<<< * * elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY) */ __pyx_t_4 = __pyx_mstate_global->__pyx_kp_u__3; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_name}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 548, __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":550 * 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_PyLong_As_uint32_t(__pyx_v_array_element_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 550, __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(1, 550, __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":551 * * 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":552 * 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 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_4); /* "asyncpg/protocol/codecs/base.pyx":553 * 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_9 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_elemtype_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_array_element_oid, __pyx_t_9, __pyx_v_schema}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } /* "asyncpg/protocol/codecs/base.pyx":552 * 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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 552, __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":551 * * 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":555 * 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_mstate_global->__pyx_n_u_elemdelim); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_elem_delim = ((Py_UCS4)__pyx_t_10); /* "asyncpg/protocol/codecs/base.pyx":559 * 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_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 559, __pyx_L1_error) __pyx_t_9 = __pyx_v_name; __Pyx_INCREF(__pyx_t_9); if (!(likely(PyUnicode_CheckExact(__pyx_t_9)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(1, 559, __pyx_L1_error) __pyx_t_7 = __pyx_v_schema; __Pyx_INCREF(__pyx_t_7); if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_7))) __PYX_ERR(1, 559, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":558 * * 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_t_9), ((PyObject*)__pyx_t_7), __pyx_v_elem_codec, __pyx_v_elem_delim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":557 * 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(1, 557, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_oid) != (0)) __PYX_ERR(1, 557, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(1, 557, __pyx_L1_error); __pyx_t_7 = 0; if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_9, __pyx_t_4) < 0))) __PYX_ERR(1, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":542 * 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":561 * 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_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_b_c, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":564 * # Composite type * * if not comp_type_attrs: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing field types for composite {oid}') */ if (__pyx_v_comp_type_attrs == Py_None) __pyx_t_6 = 0; else { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_v_comp_type_attrs); if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(1, 564, __pyx_L1_error) __pyx_t_6 = (__pyx_temp != 0); } __pyx_t_11 = (!__pyx_t_6); if (unlikely(__pyx_t_11)) { /* "asyncpg/protocol/codecs/base.pyx":565 * * if not comp_type_attrs: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * f'type record missing field types for composite {oid}') * */ __pyx_t_9 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":566 * if not comp_type_attrs: * raise exceptions.InternalClientError( * f'type record missing field types for composite {oid}') # <<<<<<<<<<<<<< * * comp_elem_codecs = [] */ __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_type_record_missing_field_types, __pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); assert(__pyx_t_9); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_13}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 565, __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(1, 565, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":564 * # Composite type * * if not comp_type_attrs: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing field types for composite {oid}') */ } /* "asyncpg/protocol/codecs/base.pyx":568 * 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(1, 568, __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":569 * * comp_elem_codecs = [] * has_text_elements = False # <<<<<<<<<<<<<< * * for typoid in comp_type_attrs: */ __pyx_v_has_text_elements = 0; /* "asyncpg/protocol/codecs/base.pyx":571 * 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(1, 571, __pyx_L1_error) } __pyx_t_4 = __pyx_v_comp_type_attrs; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 571, __pyx_L1_error) #endif if (__pyx_t_14 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_12 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14)); #else __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_14); #endif ++__pyx_t_14; if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_XDECREF_SET(__pyx_v_typoid, __pyx_t_12); __pyx_t_12 = 0; /* "asyncpg/protocol/codecs/base.pyx":572 * * 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_PyLong_As_uint32_t(__pyx_v_typoid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 572, __pyx_L1_error) __pyx_t_12 = ((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_12)) __PYX_ERR(1, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_12)); __pyx_t_12 = 0; /* "asyncpg/protocol/codecs/base.pyx":573 * 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_11 = (((PyObject *)__pyx_v_elem_codec) == Py_None); if (unlikely(__pyx_t_11)) { /* "asyncpg/protocol/codecs/base.pyx":574 * 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_t_13 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/codecs/base.pyx":575 * 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_9 = __Pyx_PyObject_FormatSimple(__pyx_v_typoid, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_15 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_no_codec_for_composite_attribute, __pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_13); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_15}; __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } __Pyx_Raise(__pyx_t_12, 0, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(1, 574, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":573 * 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":576 * 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_11 = (__pyx_v_elem_codec->format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (__pyx_t_11) { /* "asyncpg/protocol/codecs/base.pyx":577 * 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":576 * 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":578 * if elem_codec.format is PG_FORMAT_TEXT: * has_text_elements = True * comp_elem_codecs.append(elem_codec) # <<<<<<<<<<<<<< * * element_names = collections.OrderedDict() */ __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_comp_elem_codecs, ((PyObject *)__pyx_v_elem_codec)); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(1, 578, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":571 * 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":580 * comp_elem_codecs.append(elem_codec) * * element_names = collections.OrderedDict() # <<<<<<<<<<<<<< * for i, attrname in enumerate(ti['attrnames']): * element_names[attrname] = i */ __pyx_t_12 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_15); assert(__pyx_t_12); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_15, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_element_names, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":581 * * element_names = collections.OrderedDict() * for i, attrname in enumerate(ti['attrnames']): # <<<<<<<<<<<<<< * element_names[attrname] = i * */ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_t_4 = __pyx_mstate_global->__pyx_int_0; __pyx_t_15 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_attrnames); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (likely(PyList_CheckExact(__pyx_t_15)) || PyTuple_CheckExact(__pyx_t_15)) { __pyx_t_12 = __pyx_t_15; __Pyx_INCREF(__pyx_t_12); __pyx_t_14 = 0; __pyx_t_17 = NULL; } else { __pyx_t_14 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 581, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; for (;;) { if (likely(!__pyx_t_17)) { if (likely(PyList_CheckExact(__pyx_t_12))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 581, __pyx_L1_error) #endif if (__pyx_t_14 >= __pyx_temp) break; } __pyx_t_15 = __Pyx_PyList_GetItemRefFast(__pyx_t_12, __pyx_t_14, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_14; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 581, __pyx_L1_error) #endif if (__pyx_t_14 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_15 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_14)); #else __pyx_t_15 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_14); #endif ++__pyx_t_14; } if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 581, __pyx_L1_error) } else { __pyx_t_15 = __pyx_t_17(__pyx_t_12); if (unlikely(!__pyx_t_15)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 581, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_15); __Pyx_XDECREF_SET(__pyx_v_attrname, __pyx_t_15); __pyx_t_15 = 0; __Pyx_INCREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_15 = __Pyx_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_15; __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/base.pyx":582 * 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(1, 582, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":581 * * element_names = collections.OrderedDict() * for i, attrname in enumerate(ti['attrnames']): # <<<<<<<<<<<<<< * element_names[attrname] = i * */ } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":586 * # 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":587 * # 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":586 * # 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":589 * 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":593 * 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_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 593, __pyx_L1_error) __pyx_t_4 = __pyx_v_name; __Pyx_INCREF(__pyx_t_4); if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(1, 593, __pyx_L1_error) __pyx_t_12 = __pyx_v_schema; __Pyx_INCREF(__pyx_t_12); if (!(likely(PyUnicode_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_12))) __PYX_ERR(1, 593, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":592 * * 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_15 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(__pyx_t_5, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_12), __pyx_v_elem_format, __pyx_v_comp_elem_codecs, __pyx_v_comp_type_attrs, __pyx_v_element_names)); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "asyncpg/protocol/codecs/base.pyx":591 * 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(1, 591, __pyx_L1_error) } __pyx_t_12 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 591, __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) != (0)) __PYX_ERR(1, 591, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12) != (0)) __PYX_ERR(1, 591, __pyx_L1_error); __pyx_t_12 = 0; if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_4, __pyx_t_15) < 0))) __PYX_ERR(1, 591, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/base.pyx":561 * oid, name, schema, elem_codec, elem_delim) * * elif ti['kind'] == b'c': # <<<<<<<<<<<<<< * # Composite type * */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":596 * comp_type_attrs, element_names) * * elif ti['kind'] == b'd': # <<<<<<<<<<<<<< * # Domain type * */ __pyx_t_15 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_11 = (__Pyx_PyBytes_Equals(__pyx_t_15, __pyx_mstate_global->__pyx_n_b_d, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 596, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_11) { /* "asyncpg/protocol/codecs/base.pyx":599 * # Domain type * * if not base_type: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for domain {oid}') */ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_base_type); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 599, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_11); if (unlikely(__pyx_t_6)) { /* "asyncpg/protocol/codecs/base.pyx":600 * * if not base_type: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * f'type record missing base type for domain {oid}') * */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "asyncpg/protocol/codecs/base.pyx":601 * 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_12 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_type_record_missing_base_type_fo, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_13}; __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); } __Pyx_Raise(__pyx_t_15, 0, 0, 0); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __PYX_ERR(1, 600, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":599 * # Domain type * * if not base_type: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for domain {oid}') */ } /* "asyncpg/protocol/codecs/base.pyx":603 * 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_PyLong_As_uint32_t(__pyx_v_base_type); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 603, __pyx_L1_error) __pyx_t_15 = ((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_15)) __PYX_ERR(1, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __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":604 * * 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":605 * 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 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_7); /* "asyncpg/protocol/codecs/base.pyx":606 * 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_13 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_basetype_name); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_8 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_base_type, __pyx_t_13, __pyx_v_schema}; __pyx_t_15 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); } /* "asyncpg/protocol/codecs/base.pyx":605 * 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_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 605, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_15)); __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/base.pyx":604 * * 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":608 * 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(1, 608, __pyx_L1_error) } __pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_oid) != (0)) __PYX_ERR(1, 608, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_15); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_15) != (0)) __PYX_ERR(1, 608, __pyx_L1_error); __pyx_t_15 = 0; if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_13, ((PyObject *)__pyx_v_elem_codec)) < 0))) __PYX_ERR(1, 608, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/codecs/base.pyx":596 * comp_type_attrs, element_names) * * elif ti['kind'] == b'd': # <<<<<<<<<<<<<< * # Domain type * */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":610 * self._derived_type_codecs[oid, elem_codec.format] = elem_codec * * elif ti['kind'] == b'r': # <<<<<<<<<<<<<< * # Range type * */ __pyx_t_13 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_13, __pyx_mstate_global->__pyx_n_b_r, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":613 * # 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(1, 613, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_6); if (unlikely(__pyx_t_11)) { /* "asyncpg/protocol/codecs/base.pyx":614 * * if not range_subtype_oid: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * f'type record missing base type for range {oid}') * */ __pyx_t_15 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":615 * 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_7 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_type_record_missing_base_type_fo_2, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_15); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_12}; __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_Raise(__pyx_t_13, 0, 0, 0); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __PYX_ERR(1, 614, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":613 * # Range type * * if not range_subtype_oid: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for range {oid}') */ } /* "asyncpg/protocol/codecs/base.pyx":617 * 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_PyLong_As_uint32_t(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 617, __pyx_L1_error) __pyx_t_13 = ((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_13)) __PYX_ERR(1, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_13)); __pyx_t_13 = 0; /* "asyncpg/protocol/codecs/base.pyx":618 * * 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_11 = (((PyObject *)__pyx_v_elem_codec) == Py_None); if (__pyx_t_11) { /* "asyncpg/protocol/codecs/base.pyx":619 * 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_4 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_4); /* "asyncpg/protocol/codecs/base.pyx":620 * 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_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_range_subtype_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_range_subtype_oid, __pyx_t_12, __pyx_v_schema}; __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } /* "asyncpg/protocol/codecs/base.pyx":619 * 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_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 619, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_13)); __pyx_t_13 = 0; /* "asyncpg/protocol/codecs/base.pyx":618 * * 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":623 * * 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_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 623, __pyx_L1_error) __pyx_t_13 = __pyx_v_name; __Pyx_INCREF(__pyx_t_13); if (!(likely(PyUnicode_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_13))) __PYX_ERR(1, 623, __pyx_L1_error) __pyx_t_12 = __pyx_v_schema; __Pyx_INCREF(__pyx_t_12); if (!(likely(PyUnicode_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_12))) __PYX_ERR(1, 623, __pyx_L1_error) __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(__pyx_t_5, ((PyObject*)__pyx_t_13), ((PyObject*)__pyx_t_12), __pyx_v_elem_codec)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "asyncpg/protocol/codecs/base.pyx":622 * 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(1, 622, __pyx_L1_error) } __pyx_t_12 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_oid) != (0)) __PYX_ERR(1, 622, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12) != (0)) __PYX_ERR(1, 622, __pyx_L1_error); __pyx_t_12 = 0; if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_13, __pyx_t_4) < 0))) __PYX_ERR(1, 622, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":610 * 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":625 * Codec.new_range_codec(oid, name, schema, elem_codec) * * elif ti['kind'] == b'm': # <<<<<<<<<<<<<< * # Multirange type * */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_b_m, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_11) { /* "asyncpg/protocol/codecs/base.pyx":628 * # Multirange type * * if not range_subtype_oid: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for multirange {oid}') */ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 628, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_11); if (unlikely(__pyx_t_6)) { /* "asyncpg/protocol/codecs/base.pyx":629 * * if not range_subtype_oid: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * f'type record missing base type for multirange {oid}') * */ __pyx_t_13 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "asyncpg/protocol/codecs/base.pyx":630 * 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_12 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_type_record_missing_base_type_fo_3, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15); assert(__pyx_t_13); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_15, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_7}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 629, __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(1, 629, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":628 * # Multirange type * * if not range_subtype_oid: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for multirange {oid}') */ } /* "asyncpg/protocol/codecs/base.pyx":632 * 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_PyLong_As_uint32_t(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 632, __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(1, 632, __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":633 * * 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":634 * 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_15 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_15); /* "asyncpg/protocol/codecs/base.pyx":635 * 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_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_range_subtype_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_15, __pyx_v_range_subtype_oid, __pyx_t_7, __pyx_v_schema}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } /* "asyncpg/protocol/codecs/base.pyx":634 * 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_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 634, __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":633 * * 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":638 * * 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_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error) __pyx_t_4 = __pyx_v_name; __Pyx_INCREF(__pyx_t_4); if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(1, 638, __pyx_L1_error) __pyx_t_7 = __pyx_v_schema; __Pyx_INCREF(__pyx_t_7); if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_7))) __PYX_ERR(1, 638, __pyx_L1_error) __pyx_t_15 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec(__pyx_t_5, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_7), __pyx_v_elem_codec)); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":637 * 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(1, 637, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 637, __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) != (0)) __PYX_ERR(1, 637, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7) != (0)) __PYX_ERR(1, 637, __pyx_L1_error); __pyx_t_7 = 0; if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_4, __pyx_t_15) < 0))) __PYX_ERR(1, 637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/base.pyx":625 * Codec.new_range_codec(oid, name, schema, elem_codec) * * elif ti['kind'] == b'm': # <<<<<<<<<<<<<< * # Multirange type * */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":640 * 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_15 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_15, __pyx_mstate_global->__pyx_n_b_e, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 640, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":642 * 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 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_4); /* "asyncpg/protocol/codecs/base.pyx":643 * # 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_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[7] = {__pyx_t_4, __pyx_v_oid, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__pyx_n_u_scalar, __pyx_mstate_global->__pyx_int_25, __pyx_t_7}; __pyx_t_15 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_builtin_type_codec_2, __pyx_callargs+__pyx_t_8, (7-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/base.pyx":640 * 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":645 * TEXTOID, PG_FORMAT_ANY) * else: * self.declare_fallback_codec(oid, name, schema) # <<<<<<<<<<<<<< * * def add_python_codec(self, typeoid, typename, typeschema, typekind, */ /*else*/ { __pyx_t_7 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_oid, __pyx_v_name, __pyx_v_schema}; __pyx_t_15 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __pyx_L7:; /* "asyncpg/protocol/codecs/base.pyx":526 * 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":517 * 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_9); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_15); __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":647 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,&__pyx_mstate_global->__pyx_n_u_typekind,&__pyx_mstate_global->__pyx_n_u_typeinfos,&__pyx_mstate_global->__pyx_n_u_encoder,&__pyx_mstate_global->__pyx_n_u_decoder,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_xformat,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 647, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 9: values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(1, 647, __pyx_L3_error) CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(1, 647, __pyx_L3_error) CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 647, __pyx_L3_error) CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 647, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 647, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 647, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 647, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 647, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 647, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_python_codec", 0) < (0)) __PYX_ERR(1, 647, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 9; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, i); __PYX_ERR(1, 647, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 9)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 647, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 647, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 647, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 647, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 647, __pyx_L3_error) values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 647, __pyx_L3_error) values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 647, __pyx_L3_error) values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(1, 647, __pyx_L3_error) values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(1, 647, __pyx_L3_error) } __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(1, 647, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; size_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; 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", 0); /* "asyncpg/protocol/codecs/base.pyx":650 * 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":651 * 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":652 * 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":653 * 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":654 * 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(1, 654, __pyx_L1_error) __pyx_v_oid = __pyx_t_1; /* "asyncpg/protocol/codecs/base.pyx":655 * 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":658 * * # Clear all previous overrides (this also clears type cache). * self.remove_python_codec(typeoid, typename, typeschema) # <<<<<<<<<<<<<< * * if typeinfos: */ __pyx_t_3 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove_python_codec, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; 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/protocol/codecs/base.pyx":660 * self.remove_python_codec(typeoid, typename, typeschema) * * if typeinfos: # <<<<<<<<<<<<<< * self.add_types(typeinfos) * */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_typeinfos); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 660, __pyx_L1_error) if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":661 * * if typeinfos: * self.add_types(typeinfos) # <<<<<<<<<<<<<< * * if format == PG_FORMAT_ANY: */ __pyx_t_3 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_typeinfos}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_types, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":660 * self.remove_python_codec(typeoid, typename, typeschema) * * if typeinfos: # <<<<<<<<<<<<<< * self.add_types(typeinfos) * */ } /* "asyncpg/protocol/codecs/base.pyx":663 * self.add_types(typeinfos) * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY) * else: */ __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __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(1, 663, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 663, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":664 * * if format == PG_FORMAT_ANY: * formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY) # <<<<<<<<<<<<<< * else: * formats = (format,) */ __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 664, __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) != (0)) __PYX_ERR(1, 664, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 664, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_v_formats = __pyx_t_6; __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":663 * 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":666 * formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY) * else: * formats = (format,) # <<<<<<<<<<<<<< * * for fmt in formats: */ /*else*/ { __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_format) != (0)) __PYX_ERR(1, 666, __pyx_L1_error); __pyx_v_formats = __pyx_t_6; __pyx_t_6 = 0; } __pyx_L4:; /* "asyncpg/protocol/codecs/base.pyx":668 * 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_6 = __pyx_v_formats; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_formats); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 668, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 668, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 668, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7)); #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); #endif ++__pyx_t_7; } if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 668, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 668, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_fmt, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":669 * * for fmt in formats: * if xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * if typekind == "scalar": * core_codec = get_core_codec(oid, fmt, xformat) */ __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 669, __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(1, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":670 * 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_5 = (__Pyx_PyUnicode_Equals(__pyx_v_typekind, __pyx_mstate_global->__pyx_n_u_scalar, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 670, __pyx_L1_error) if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":671 * 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_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 671, __pyx_L1_error) __pyx_t_10 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 671, __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(1, 671, __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":672 * 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_5 = (((PyObject *)__pyx_v_core_codec) == Py_None); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":673 * 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":672 * 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":674 * 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":675 * 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":670 * 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":676 * 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_5 = (__Pyx_PyUnicode_Equals(__pyx_v_typekind, __pyx_mstate_global->__pyx_n_u_composite, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 676, __pyx_L1_error) if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":677 * 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_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 677, __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(1, 677, __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":678 * elif typekind == "composite": * base_codec = self.get_codec(oid, fmt) * if base_codec is None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_5 = (((PyObject *)__pyx_v_base_codec) == Py_None); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":679 * 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":678 * elif typekind == "composite": * base_codec = self.get_codec(oid, fmt) * if base_codec is None: # <<<<<<<<<<<<<< * continue * */ } /* "asyncpg/protocol/codecs/base.pyx":676 * 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":669 * * 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":682 * * 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 = __pyx_v_typename; __Pyx_INCREF(__pyx_t_3); if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(1, 682, __pyx_L1_error) __pyx_t_2 = __pyx_v_typeschema; __Pyx_INCREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(1, 682, __pyx_L1_error) __pyx_t_14 = __pyx_v_typekind; __Pyx_INCREF(__pyx_t_14); if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_14))) __PYX_ERR(1, 682, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":684 * 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_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 684, __pyx_L1_error) __pyx_t_10 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 684, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":682 * * 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_15 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(__pyx_v_oid, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_14), __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_15)) __PYX_ERR(1, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "asyncpg/protocol/codecs/base.pyx":681 * 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(1, 681, __pyx_L1_error) } __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_typeoid) != (0)) __PYX_ERR(1, 681, __pyx_L1_error); __Pyx_INCREF(__pyx_v_fmt); __Pyx_GIVEREF(__pyx_v_fmt); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_fmt) != (0)) __PYX_ERR(1, 681, __pyx_L1_error); if (unlikely((PyDict_SetItem(__pyx_v_self->_custom_type_codecs, __pyx_t_14, __pyx_t_15) < 0))) __PYX_ERR(1, 681, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/base.pyx":685 * 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":668 * formats = (format,) * * for fmt in formats: # <<<<<<<<<<<<<< * if xformat == PG_XFORMAT_TUPLE: * if typekind == "scalar": */ __pyx_L5_continue:; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":687 * codec_set = True * * if not codec_set: # <<<<<<<<<<<<<< * raise exceptions.InterfaceError( * "{} type does not support the 'tuple' exchange format".format( */ __pyx_t_5 = (!__pyx_v_codec_set); if (unlikely(__pyx_t_5)) { /* "asyncpg/protocol/codecs/base.pyx":688 * * if not codec_set: * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * "{} type does not support the 'tuple' exchange format".format( * typename)) */ __pyx_t_15 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "asyncpg/protocol/codecs/base.pyx":689 * if not codec_set: * raise exceptions.InterfaceError( * "{} type does not support the 'tuple' exchange format".format( # <<<<<<<<<<<<<< * typename)) * */ __pyx_t_3 = __pyx_mstate_global->__pyx_kp_u_type_does_not_support_the_tuple; __Pyx_INCREF(__pyx_t_3); /* "asyncpg/protocol/codecs/base.pyx":690 * raise exceptions.InterfaceError( * "{} type does not support the 'tuple' exchange format".format( * typename)) # <<<<<<<<<<<<<< * * def remove_python_codec(self, typeoid, typename, typeschema): */ __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_typename}; __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); } __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_15); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_14}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 688, __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(1, 688, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":687 * codec_set = True * * if not codec_set: # <<<<<<<<<<<<<< * raise exceptions.InterfaceError( * "{} type does not support the 'tuple' exchange format".format( */ } /* "asyncpg/protocol/codecs/base.pyx":647 * 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_6); __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":692 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 692, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 692, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 692, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 692, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "remove_python_codec", 0) < (0)) __PYX_ERR(1, 692, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, i); __PYX_ERR(1, 692, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 692, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 692, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 692, __pyx_L3_error) } __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, 692, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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) { enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_fmt; 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; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_t_5; int __pyx_t_6; size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_python_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":693 * * 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_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __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) != (0)) __PYX_ERR(1, 693, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 693, __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 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4)); #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); #endif ++__pyx_t_4; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_fmt = __pyx_t_5; /* "asyncpg/protocol/codecs/base.pyx":694 * 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(1, 694, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_typeoid) != (0)) __PYX_ERR(1, 694, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 694, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyDict_Pop_ignore(__pyx_v_self->_custom_type_codecs, __pyx_t_1, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":693 * * 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":695 * 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 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear_type_cache, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":692 * 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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":697 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,&__pyx_mstate_global->__pyx_n_u_typekind,&__pyx_mstate_global->__pyx_n_u_alias_to,&__pyx_mstate_global->__pyx_n_u_format,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 697, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 697, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 697, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 697, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 697, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 697, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 697, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_set_builtin_type_codec", 0) < (0)) __PYX_ERR(1, 697, __pyx_L3_error) if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__4); for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, i); __PYX_ERR(1, 697, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 697, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 697, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 697, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 697, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 697, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 697, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__4); } __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(1, 697, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13[8]; PyObject *__pyx_t_14 = 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":702 * 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(1, 702, __pyx_L1_error) __pyx_v_oid = __pyx_t_1; /* "asyncpg/protocol/codecs/base.pyx":703 * 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":704 * 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":706 * bint codec_set = False * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) * else: */ __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 706, __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(1, 706, __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(1, 706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":707 * * if format == PG_FORMAT_ANY: * formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * else: * formats = (format,) */ __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 707, __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) != (0)) __PYX_ERR(1, 707, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 707, __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":706 * 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":709 * 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(1, 709, __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) != (0)) __PYX_ERR(1, 709, __pyx_L1_error); __pyx_v_formats = __pyx_t_5; __pyx_t_5 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":711 * formats = (format,) * * if isinstance(alias_to, int): # <<<<<<<<<<<<<< * alias_oid = pylong_as_oid(alias_to) * else: */ __pyx_t_4 = PyLong_Check(__pyx_v_alias_to); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":712 * * 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(1, 712, __pyx_L1_error) __pyx_v_alias_oid = __pyx_t_1; /* "asyncpg/protocol/codecs/base.pyx":711 * formats = (format,) * * if isinstance(alias_to, int): # <<<<<<<<<<<<<< * alias_oid = pylong_as_oid(alias_to) * else: */ goto __pyx_L4; } /* "asyncpg/protocol/codecs/base.pyx":714 * alias_oid = pylong_as_oid(alias_to) * else: * alias_oid = BUILTIN_TYPE_NAME_MAP.get(alias_to, 0) # <<<<<<<<<<<<<< * * for format in formats: */ /*else*/ { __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_alias_to, __pyx_mstate_global->__pyx_int_0}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_1 = __Pyx_PyLong_As_uint32_t(__pyx_t_5); if (unlikely((__pyx_t_1 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 714, __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":716 * 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_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_formats); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 716, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 716, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 716, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8)); #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8); #endif ++__pyx_t_8; } if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 716, __pyx_L1_error) } else { __pyx_t_6 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 716, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":717 * * 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":718 * 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_10 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 718, __pyx_L1_error) __pyx_t_6 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_alias_oid, __pyx_t_10, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_target_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_6)); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":717 * * 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":720 * target_codec = self.get_codec(alias_oid, format) * else: * target_codec = get_extra_codec(alias_to, format) # <<<<<<<<<<<<<< * * if target_codec is None: */ /*else*/ { __pyx_t_6 = __pyx_v_alias_to; __Pyx_INCREF(__pyx_t_6); if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(1, 720, __pyx_L1_error) __pyx_t_10 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 720, __pyx_L1_error) __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_extra_codec(((PyObject*)__pyx_t_6), __pyx_t_10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_target_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __pyx_t_2 = 0; } __pyx_L7:; /* "asyncpg/protocol/codecs/base.pyx":722 * 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":723 * * if target_codec is None: * continue # <<<<<<<<<<<<<< * * codec = target_codec.copy() */ goto __pyx_L5_continue; /* "asyncpg/protocol/codecs/base.pyx":722 * target_codec = get_extra_codec(alias_to, format) * * if target_codec is None: # <<<<<<<<<<<<<< * continue * */ } /* "asyncpg/protocol/codecs/base.pyx":725 * continue * * codec = target_codec.copy() # <<<<<<<<<<<<<< * codec.oid = typeoid * codec.name = typename */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(__pyx_v_target_codec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 725, __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":726 * * codec = target_codec.copy() * codec.oid = typeoid # <<<<<<<<<<<<<< * codec.name = typename * codec.schema = typeschema */ __pyx_t_1 = __Pyx_PyLong_As_uint32_t(__pyx_v_typeoid); if (unlikely((__pyx_t_1 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 726, __pyx_L1_error) __pyx_v_codec->oid = __pyx_t_1; /* "asyncpg/protocol/codecs/base.pyx":727 * codec = target_codec.copy() * codec.oid = typeoid * codec.name = typename # <<<<<<<<<<<<<< * codec.schema = typeschema * codec.kind = typekind */ __pyx_t_2 = __pyx_v_typename; __Pyx_INCREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(1, 727, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_codec->name); __Pyx_DECREF(__pyx_v_codec->name); __pyx_v_codec->name = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":728 * codec.oid = typeoid * codec.name = typename * codec.schema = typeschema # <<<<<<<<<<<<<< * codec.kind = typekind * */ __pyx_t_2 = __pyx_v_typeschema; __Pyx_INCREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(1, 728, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_codec->schema); __Pyx_DECREF(__pyx_v_codec->schema); __pyx_v_codec->schema = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":729 * codec.name = typename * codec.schema = typeschema * codec.kind = typekind # <<<<<<<<<<<<<< * * self._custom_type_codecs[typeoid, format] = codec */ __pyx_t_2 = __pyx_v_typekind; __Pyx_INCREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(1, 729, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_codec->kind); __Pyx_DECREF(__pyx_v_codec->kind); __pyx_v_codec->kind = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":731 * 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(1, 731, __pyx_L1_error) } __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 731, __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) != (0)) __PYX_ERR(1, 731, __pyx_L1_error); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_format) != (0)) __PYX_ERR(1, 731, __pyx_L1_error); if (unlikely((PyDict_SetItem(__pyx_v_self->_custom_type_codecs, __pyx_t_2, ((PyObject *)__pyx_v_codec)) < 0))) __PYX_ERR(1, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":732 * * self._custom_type_codecs[typeoid, format] = codec * codec_set = True # <<<<<<<<<<<<<< * * if not codec_set: */ __pyx_v_codec_set = 1; /* "asyncpg/protocol/codecs/base.pyx":716 * 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":734 * 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":735 * * if not codec_set: * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * codec_str = 'binary' * elif format == PG_FORMAT_TEXT: */ __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_RichCompare(__pyx_v_format, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":736 * if not codec_set: * if format == PG_FORMAT_BINARY: * codec_str = 'binary' # <<<<<<<<<<<<<< * elif format == PG_FORMAT_TEXT: * codec_str = 'text' */ __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_binary); __pyx_v_codec_str = __pyx_mstate_global->__pyx_n_u_binary; /* "asyncpg/protocol/codecs/base.pyx":735 * * 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":737 * if format == PG_FORMAT_BINARY: * codec_str = 'binary' * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * codec_str = 'text' * else: */ __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":738 * codec_str = 'binary' * elif format == PG_FORMAT_TEXT: * codec_str = 'text' # <<<<<<<<<<<<<< * else: * codec_str = 'text or binary' */ __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_text); __pyx_v_codec_str = __pyx_mstate_global->__pyx_n_u_text; /* "asyncpg/protocol/codecs/base.pyx":737 * 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":740 * codec_str = 'text' * else: * codec_str = 'text or binary' # <<<<<<<<<<<<<< * * raise exceptions.InterfaceError( */ /*else*/ { __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_text_or_binary_2); __pyx_v_codec_str = __pyx_mstate_global->__pyx_kp_u_text_or_binary_2; } __pyx_L11:; /* "asyncpg/protocol/codecs/base.pyx":742 * 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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":743 * * raise exceptions.InterfaceError( * f'cannot alias {typename} to {alias_to}: ' # <<<<<<<<<<<<<< * f'there is no {codec_str} codec for {alias_to}') * */ __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_typename, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_alias_to, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); /* "asyncpg/protocol/codecs/base.pyx":744 * 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_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_alias_to, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_cannot_alias; __pyx_t_13[1] = __pyx_t_6; __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_to; __pyx_t_13[3] = __pyx_t_11; __pyx_t_13[4] = __pyx_mstate_global->__pyx_kp_u_there_is_no; __pyx_t_13[5] = __pyx_v_codec_str; __pyx_t_13[6] = __pyx_mstate_global->__pyx_kp_u_codec_for; __pyx_t_13[7] = __pyx_t_12; /* "asyncpg/protocol/codecs/base.pyx":743 * * raise exceptions.InterfaceError( * f'cannot alias {typename} to {alias_to}: ' # <<<<<<<<<<<<<< * f'there is no {codec_str} codec for {alias_to}') * */ __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_13, 8, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_codec_str) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_codec_str) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12)); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_14}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 742, __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(1, 742, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":734 * codec_set = True * * if not codec_set: # <<<<<<<<<<<<<< * if format == PG_FORMAT_BINARY: * codec_str = 'binary' */ } /* "asyncpg/protocol/codecs/base.pyx":697 * 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_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_14); __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":746 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,&__pyx_mstate_global->__pyx_n_u_typekind,&__pyx_mstate_global->__pyx_n_u_alias_to,&__pyx_mstate_global->__pyx_n_u_format,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 746, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 746, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 746, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 746, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 746, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 746, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 746, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_builtin_type_codec", 0) < (0)) __PYX_ERR(1, 746, __pyx_L3_error) if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__5); for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, i); __PYX_ERR(1, 746, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 746, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 746, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 746, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 746, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 746, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 746, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__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", 0, 5, 6, __pyx_nargs); __PYX_ERR(1, 746, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_builtin_type_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":748 * 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 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":749 * 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 = 0; { PyObject *__pyx_callargs[7] = {__pyx_t_2, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_builtin_type_codec_2, __pyx_callargs+__pyx_t_3, (7-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":750 * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, * alias_to, format) * self.clear_type_cache() # <<<<<<<<<<<<<< * * def clear_type_cache(self): */ __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear_type_cache, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":746 * 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_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":752 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clear_type_cache", __pyx_kwds); 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", 0); /* "asyncpg/protocol/codecs/base.pyx":753 * * 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(1, 753, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_self->_derived_type_codecs); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 753, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":752 * 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":755 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_oid,&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_schema,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 755, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 755, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 755, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 755, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "declare_fallback_codec", 0) < (0)) __PYX_ERR(1, 755, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("declare_fallback_codec", 1, 3, 3, i); __PYX_ERR(1, 755, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 755, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 755, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 755, __pyx_L3_error) } __pyx_v_oid = __Pyx_PyLong_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 755, __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(1, 755, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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(1, 755, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), (&PyUnicode_Type), 1, "schema", 1))) __PYX_ERR(1, 755, __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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7[5]; PyObject *__pyx_t_8 = NULL; size_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("declare_fallback_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":758 * 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":764 * # asyncpg is lacking support. * # * raise exceptions.UnsupportedClientFeatureError( # <<<<<<<<<<<<<< * f'unhandled standard data type {name!r} (OID {oid})') * else: */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":765 * # * 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_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyUnicode_From_uint32_t(__pyx_v_oid, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_unhandled_standard_data_type; __pyx_t_7[1] = __pyx_t_4; __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_OID; __pyx_t_7[3] = __pyx_t_6; __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u__6; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 764, __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(1, 764, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":758 * 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":773 * # using Connection.set_type_codec(). * # * self._set_builtin_type_codec(oid, name, schema, 'scalar', # <<<<<<<<<<<<<< * TEXTOID, PG_FORMAT_TEXT) * */ /*else*/ { __pyx_t_5 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":774 * # * 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_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = 0; { PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_t_8, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__pyx_n_u_scalar, __pyx_mstate_global->__pyx_int_25, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_builtin_type_codec_2, __pyx_callargs+__pyx_t_9, (7-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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(1, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":776 * 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(1, 776, __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":778 * 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":755 * 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_5); __Pyx_XDECREF(__pyx_t_6); __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":780 * 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":781 * * 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", 0); 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":784 * 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":785 * * 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(1, 785, __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":787 * 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":788 * 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(1, 788, __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":787 * 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":790 * 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":784 * cdef Codec codec * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * codec = self.get_codec( * oid, PG_FORMAT_BINARY, ignore_custom_codec) */ } /* "asyncpg/protocol/codecs/base.pyx":792 * 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":793 * 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(1, 793, __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":794 * 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":795 * 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":799 * # 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":795 * 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":801 * 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":794 * 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":792 * 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":803 * 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(1, 803, __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":804 * * 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":805 * 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":804 * * codec = get_core_codec(oid, format) * if codec is not None: # <<<<<<<<<<<<<< * return codec * else: */ } /* "asyncpg/protocol/codecs/base.pyx":807 * 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":808 * 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(1, 808, __pyx_L9_error) } __pyx_t_2 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 808, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 808, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 808, __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) != (0)) __PYX_ERR(1, 808, __pyx_L9_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(1, 808, __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(1, 808, __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 808, __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":807 * 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":809 * try: * return self._derived_type_codecs[oid, format] * except KeyError: # <<<<<<<<<<<<<< * return None * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_KeyError)))); if (__pyx_t_9) { __Pyx_ErrRestore(0,0,0); /* "asyncpg/protocol/codecs/base.pyx":810 * 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); goto __pyx_L12_except_return; } goto __pyx_L11_except_error; /* "asyncpg/protocol/codecs/base.pyx":807 * 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":780 * 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":812 * 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", 0); /* "asyncpg/protocol/codecs/base.pyx":819 * 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":820 * * 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(1, 820, __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":821 * 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":822 * 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(1, 822, __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":821 * 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":819 * 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":824 * 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(1, 824, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 824, __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) != (0)) __PYX_ERR(1, 824, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 824, __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(1, 824, __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 824, __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":826 * 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":812 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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; 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("__reduce_cython__", 0); /* "(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 and _dict: */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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 and _dict: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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 and _dict: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_3 = (__pyx_v__dict != Py_None); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(9, 7, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None and _dict: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 8, __pyx_L1_error); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "(tree fragment)":9 * if _dict is not None and _dict: * 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 and _dict: # <<<<<<<<<<<<<< * 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_2 = __Pyx_PyObject_IsTrue(__pyx_mstate_global->__pyx_tuple[0]); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 11, __pyx_L1_error) __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_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_DataCodecConfig); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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)))) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_228230485); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_228230485); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_228230485) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 13, __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) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __pyx_t_4 = 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_mstate_global->__pyx_n_u_pyx_unpickle_DataCodecConfig); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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)))) != (0)) __PYX_ERR(9, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_228230485); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_228230485); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_228230485) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 15, __pyx_L1_error); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(9, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(9, 15, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 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_4); __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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 16, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 16, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 16, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error) } __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(9, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(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) # <<<<<<<<<<<<<< */ __pyx_t_1 = __pyx_v___pyx_state; __Pyx_INCREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(9, 17, __pyx_L1_error) if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'"); __PYX_ERR(9, 17, __pyx_L1_error) } __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 17, __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; /* "(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_XDECREF(__pyx_t_2); __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":829 * * * 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_mstate_global->__pyx_k__7; void *__pyx_v_ptr; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; void *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_core_codec", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_xformat = __pyx_optional_args->xformat; } } /* "asyncpg/protocol/codecs/base.pyx":833 * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): * cdef: * void *ptr = NULL # <<<<<<<<<<<<<< * * if oid > MAXSUPPORTEDOID: */ __pyx_v_ptr = NULL; /* "asyncpg/protocol/codecs/base.pyx":835 * 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":836 * * if oid > MAXSUPPORTEDOID: * return None # <<<<<<<<<<<<<< * if format == PG_FORMAT_BINARY: * ptr = (codec_map).get_binary_codec_ptr(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":835 * void *ptr = NULL * * if oid > MAXSUPPORTEDOID: # <<<<<<<<<<<<<< * return None * if format == PG_FORMAT_BINARY: */ } /* "asyncpg/protocol/codecs/base.pyx":837 * if oid > MAXSUPPORTEDOID: * return None * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * ptr = (codec_map).get_binary_codec_ptr(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":838 * return None * if format == PG_FORMAT_BINARY: * ptr = (codec_map).get_binary_codec_ptr(oid * xformat) # <<<<<<<<<<<<<< * elif format == PG_FORMAT_TEXT: * ptr = (codec_map).get_text_codec_ptr(oid * xformat) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_2), (__pyx_v_oid * __pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ptr = __pyx_t_3; /* "asyncpg/protocol/codecs/base.pyx":837 * if oid > MAXSUPPORTEDOID: * return None * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * ptr = (codec_map).get_binary_codec_ptr(oid * xformat) * elif format == PG_FORMAT_TEXT: */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT: /* "asyncpg/protocol/codecs/base.pyx":840 * ptr = (codec_map).get_binary_codec_ptr(oid * xformat) * elif format == PG_FORMAT_TEXT: * ptr = (codec_map).get_text_codec_ptr(oid * xformat) # <<<<<<<<<<<<<< * * if ptr is NULL: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_2), (__pyx_v_oid * __pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ptr = __pyx_t_3; /* "asyncpg/protocol/codecs/base.pyx":839 * if format == PG_FORMAT_BINARY: * ptr = (codec_map).get_binary_codec_ptr(oid * xformat) * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * ptr = (codec_map).get_text_codec_ptr(oid * xformat) * */ break; default: break; } /* "asyncpg/protocol/codecs/base.pyx":842 * ptr = (codec_map).get_text_codec_ptr(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":843 * * 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":842 * ptr = (codec_map).get_text_codec_ptr(oid * xformat) * * if ptr is NULL: # <<<<<<<<<<<<<< * return None * else: */ } /* "asyncpg/protocol/codecs/base.pyx":845 * 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":829 * * * cdef inline Codec get_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_core_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/base.pyx":848 * * * 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_mstate_global->__pyx_k__8; 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", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_xformat = __pyx_optional_args->xformat; } } /* "asyncpg/protocol/codecs/base.pyx":855 * 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":856 * * 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(1, 856, __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":857 * 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":858 * 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(1, 858, __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":857 * 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":855 * 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":860 * 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(1, 860, __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":862 * 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":848 * * * 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":865 * * * cdef inline int has_core_codec(uint32_t oid): # <<<<<<<<<<<<<< * return ( * (codec_map).get_binary_codec_ptr(oid) != NULL */ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol_has_core_codec(uint32_t __pyx_v_oid) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; void *__pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_core_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":867 * cdef inline int has_core_codec(uint32_t oid): * return ( * (codec_map).get_binary_codec_ptr(oid) != NULL # <<<<<<<<<<<<<< * or (codec_map).get_text_codec_ptr(oid) != NULL * ) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_2), __pyx_v_oid); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != NULL); if (!__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } /* "asyncpg/protocol/codecs/base.pyx":868 * return ( * (codec_map).get_binary_codec_ptr(oid) != NULL * or (codec_map).get_text_codec_ptr(oid) != NULL # <<<<<<<<<<<<<< * ) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_2), __pyx_v_oid); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != NULL); __pyx_t_1 = __pyx_t_4; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":865 * * * cdef inline int has_core_codec(uint32_t oid): # <<<<<<<<<<<<<< * return ( * (codec_map).get_binary_codec_ptr(oid) != NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.has_core_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":872 * * * 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_mstate_global->__pyx_k__9; 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; size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register_core_codec", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_xformat = __pyx_optional_args->xformat; } } /* "asyncpg/protocol/codecs/base.pyx":878 * 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":879 * * if oid > MAXSUPPORTEDOID: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'cannot register core codec for OID {}: it is greater ' * 'than MAXSUPPORTEDOID ({})'.format(oid, MAXSUPPORTEDOID)) */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":881 * raise exceptions.InternalClientError( * 'cannot register core codec for OID {}: it is greater ' * 'than MAXSUPPORTEDOID ({})'.format(oid, MAXSUPPORTEDOID)) # <<<<<<<<<<<<<< * * cdef: */ __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_cannot_register_core_codec_for_O; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_7, __pyx_mstate_global->__pyx_int_5080}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 879, __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(1, 879, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":878 * 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":888 * str kind * * name = BUILTIN_TYPE_OID_MAP[oid] # <<<<<<<<<<<<<< * kind = 'array' if oid in ARRAY_TYPES else 'scalar' * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_oid, uint32_t, 0, __Pyx_PyLong_From_uint32_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(1, 888, __pyx_L1_error) __pyx_v_name = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":889 * * name = BUILTIN_TYPE_OID_MAP[oid] * kind = 'array' if oid in ARRAY_TYPES else 'scalar' # <<<<<<<<<<<<<< * * codec = Codec(oid) */ __pyx_t_2 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ARRAY_TYPES); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 889, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_array); __pyx_t_5 = __pyx_mstate_global->__pyx_n_u_array; } else { __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_scalar); __pyx_t_5 = __pyx_mstate_global->__pyx_n_u_scalar; } __pyx_v_kind = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":891 * 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 = NULL; __pyx_t_2 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 891, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_5); } __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":892 * * 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_5 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_mstate_global->__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_5)) __PYX_ERR(1, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":894 * 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":896 * cpython.Py_INCREF(codec) # immortalize * * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * (codec_map).set_binary_codec_ptr(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":897 * * if format == PG_FORMAT_BINARY: * (codec_map).set_binary_codec_ptr(oid * xformat, codec) # <<<<<<<<<<<<<< * elif format == PG_FORMAT_TEXT: * (codec_map).set_text_codec_ptr(oid * xformat, codec) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_binary_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_5), (__pyx_v_oid * __pyx_v_xformat), ((void *)__pyx_v_codec)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 897, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":896 * cpython.Py_INCREF(codec) # immortalize * * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * (codec_map).set_binary_codec_ptr(oid * xformat, codec) * elif format == PG_FORMAT_TEXT: */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT: /* "asyncpg/protocol/codecs/base.pyx":899 * (codec_map).set_binary_codec_ptr(oid * xformat, codec) * elif format == PG_FORMAT_TEXT: * (codec_map).set_text_codec_ptr(oid * xformat, codec) # <<<<<<<<<<<<<< * else: * raise exceptions.InternalClientError( */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_text_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_5), (__pyx_v_oid * __pyx_v_xformat), ((void *)__pyx_v_codec)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":898 * if format == PG_FORMAT_BINARY: * (codec_map).set_binary_codec_ptr(oid * xformat, codec) * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * (codec_map).set_text_codec_ptr(oid * xformat, codec) * else: */ break; default: /* "asyncpg/protocol/codecs/base.pyx":901 * (codec_map).set_text_codec_ptr(oid * xformat, codec) * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'invalid data format: {}'.format(format)) * */ __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":902 * else: * raise exceptions.InternalClientError( * 'invalid data format: {}'.format(format)) # <<<<<<<<<<<<<< * * */ __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_invalid_data_format; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(1, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 901, __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(1, 901, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":872 * * * 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":905 * * * 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; size_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register_extra_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":913 * str kind * * kind = 'scalar' # <<<<<<<<<<<<<< * * codec = Codec(INVALIDOID) */ __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_scalar); __pyx_v_kind = __pyx_mstate_global->__pyx_n_u_scalar; /* "asyncpg/protocol/codecs/base.pyx":915 * 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_2 = NULL; __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 915, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__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":916 * * codec = Codec(INVALIDOID) * codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, # <<<<<<<<<<<<<< * encode, decode, None, None, None, None, None, None, None, 0) * (codec_map).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(1, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":918 * codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, * encode, decode, None, None, None, None, None, None, None, 0) * (codec_map).extra_codecs[name, format] = codec # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_1)->extra_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 918, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name) != (0)) __PYX_ERR(1, 918, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 918, __pyx_L1_error); __pyx_t_2 = 0; if (unlikely((PyDict_SetItem(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_1)->extra_codecs, __pyx_t_4, ((PyObject *)__pyx_v_codec)) < 0))) __PYX_ERR(1, 918, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":905 * * * 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_XDECREF(__pyx_t_4); __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":921 * * * cdef inline Codec get_extra_codec(str name, ServerDataFormat format): # <<<<<<<<<<<<<< * return (codec_map).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; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_extra_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":922 * * cdef inline Codec get_extra_codec(str name, ServerDataFormat format): * return (codec_map).extra_codecs.get((name, format)) # <<<<<<<<<<<<<< */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_1)->extra_codecs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(1, 922, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_name) != (0)) __PYX_ERR(1, 922, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 922, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_1)->extra_codecs, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 922, __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; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 922, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":921 * * * cdef inline Codec get_extra_codec(str name, ServerDataFormat format): # <<<<<<<<<<<<<< * return (codec_map).extra_codecs.get((name, format)) */ /* 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.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(10, 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(10, 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(10, 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(10, 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", 0); /* "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(11, 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(11, 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", 0); /* "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(11, 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(11, 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", 0); /* "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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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", 0); /* "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(11, 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(11, 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", 0); /* "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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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", 0); /* "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_mstate_global->__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(11, 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", 0); /* "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(11, 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(11, 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(11, 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", 0); /* "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(11, 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(11, 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(11, 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(11, 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", 0); /* "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(11, 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(11, 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(11, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_26); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_26); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_26) != (0)) __PYX_ERR(11, 226, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_28); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_28); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_28) != (0)) __PYX_ERR(11, 226, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_29); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_29); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_29) != (0)) __PYX_ERR(11, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 230, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_PyLong_As_uint32_t(__pyx_v_oid_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 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(11, 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(11, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5069); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5069); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_5069) != (0)) __PYX_ERR(11, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 241, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_PyLong_As_uint32_t(__pyx_v_oid_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 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(11, 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(11, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_24); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_24); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_24) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2202); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2202); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_2202) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2203); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2203); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_2203) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2204); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2204); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_2204) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2205); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2205); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_2205) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2206); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2206); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_int_2206) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3734); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3734); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_mstate_global->__pyx_int_3734) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3769); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3769); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 7, __pyx_mstate_global->__pyx_int_3769) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4089); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4089); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 8, __pyx_mstate_global->__pyx_int_4089) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4096); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4096); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 9, __pyx_mstate_global->__pyx_int_4096) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1790); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1790); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 10, __pyx_mstate_global->__pyx_int_1790) != (0)) __PYX_ERR(11, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4191); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4191); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 11, __pyx_mstate_global->__pyx_int_4191) != (0)) __PYX_ERR(11, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 258, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_PyLong_As_uint32_t(__pyx_v_reg_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 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(11, 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(11, 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(11, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2276); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2276); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_2276) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2279); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2279); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_2279) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3838); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3838); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_3838) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2280); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2280); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_2280) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3115); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3115); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_3115) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3310); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3310); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_int_3310) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2281); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2281); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_mstate_global->__pyx_int_2281) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2282); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2282); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 7, __pyx_mstate_global->__pyx_int_2282) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2283); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2283); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 8, __pyx_mstate_global->__pyx_int_2283) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2776); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2776); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 9, __pyx_mstate_global->__pyx_int_2776) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5077); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5077); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 10, __pyx_mstate_global->__pyx_int_5077) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5078); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5078); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 11, __pyx_mstate_global->__pyx_int_5078) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5079); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5079); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 12, __pyx_mstate_global->__pyx_int_5079) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5080); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5080); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 13, __pyx_mstate_global->__pyx_int_5080) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4538); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4538); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 14, __pyx_mstate_global->__pyx_int_4538) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3831); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3831); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 15, __pyx_mstate_global->__pyx_int_3831) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4537); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4537); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 16, __pyx_mstate_global->__pyx_int_4537) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2277); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2277); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 17, __pyx_mstate_global->__pyx_int_2277) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_32); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_32); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 18, __pyx_mstate_global->__pyx_int_32) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_325); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_325); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 19, __pyx_mstate_global->__pyx_int_325) != (0)) __PYX_ERR(11, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_269); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_269); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 20, __pyx_mstate_global->__pyx_int_269) != (0)) __PYX_ERR(11, 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(11, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 286, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_PyLong_As_uint32_t(__pyx_v_no_io_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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", 0); /* "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(11, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_19); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_19); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_19) != (0)) __PYX_ERR(11, 349, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1042); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1042); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_1042) != (0)) __PYX_ERR(11, 349, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1043); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1043); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_1043) != (0)) __PYX_ERR(11, 349, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_25); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_25); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_25) != (0)) __PYX_ERR(11, 349, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_142); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_142); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_142) != (0)) __PYX_ERR(11, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 357, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 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(11, 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_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 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(11, 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", 0); /* "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(11, 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", 0); /* "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(11, 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(11, 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", 0); /* "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(11, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3615); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3615); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_3615) != (0)) __PYX_ERR(11, 389, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3614); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3614); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_3614) != (0)) __PYX_ERR(11, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 394, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 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(11, 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(11, 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", 0); /* "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(11, 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", 0); /* "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(11, 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(11, 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", 0); /* "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(11, 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(11, 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(11, 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(11, 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", 0); /* "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(11, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_790); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_790); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_790) != (0)) __PYX_ERR(11, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 452, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 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(11, 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", 0); /* "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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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(11, 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", 0); /* "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_mstate_global->__pyx_n_u_IterableABC); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 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(2, 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_mstate_global->__pyx_n_u_SizedABC); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 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(2, 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(2, 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(2, 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_mstate_global->__pyx_n_u_MappingABC); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 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(2, 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(2, 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", 0); /* "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(2, 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(2, 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(2, 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; size_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); Py_ssize_t __pyx_t_10; long __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_array_shape", 0); /* "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(2, 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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_array_value}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 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(2, 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":62 * * if ndims[0] > ARRAY_MAXDIM: * raise ValueError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims[0], ARRAY_MAXDIM)) */ __pyx_t_4 = NULL; /* "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_7 = __pyx_mstate_global->__pyx_kp_u_number_of_array_dimensions_excee; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyLong_From_int32_t((__pyx_v_ndims[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_mstate_global->__pyx_int_6}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 62, __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(2, 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_3 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; __pyx_t_9 = NULL; } else { __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 68, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 68, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_1, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_1; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 68, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1)); #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1); #endif ++__pyx_t_1; } if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 68, __pyx_L1_error) } else { __pyx_t_6 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 68, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_6); __pyx_t_6 = 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_6 = __pyx_f_7asyncpg_8protocol_8protocol__is_sub_array_iterable(__pyx_v_elem); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_10 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(2, 71, __pyx_L1_error) __pyx_v_elemlen = __pyx_t_10; /* "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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_array_value}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 73, __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(2, 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_11 = 0; (__pyx_v_ndims[__pyx_t_11]) = ((__pyx_v_ndims[__pyx_t_11]) + 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_6 = __pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(__pyx_v_elem, __pyx_v_dims, __pyx_v_ndims); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_10 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(2, 77, __pyx_L1_error) __pyx_t_2 = (__pyx_t_10 != __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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_non_homogeneous_array}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 78, __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(2, 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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_non_homogeneous_array}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 81, __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(2, 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_3); __pyx_t_3 = 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_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __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; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; size_t __pyx_t_18; int __pyx_t_19; char const *__pyx_t_20; PyObject *__pyx_t_21 = NULL; 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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_write_array_data", 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, */ __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(2, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 90, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 90, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3)); #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); #endif ++__pyx_t_3; } if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 90, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 90, __pyx_L1_error) PyErr_Clear(); } 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(2, 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(2, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 94, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 94, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3)); #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); #endif ++__pyx_t_3; } if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 94, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 94, __pyx_L1_error) PyErr_Clear(); } 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(2, 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(2, 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(((PyObject *)(((PyTypeObject*)PyExc_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(2, 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":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 = NULL; /* "asyncpg/protocol/codecs/array.pyx":102 * except TypeError as e: * raise ValueError( * 'invalid array element: {}'.format(e.args[0])) from None # <<<<<<<<<<<<<< * * */ __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_invalid_array_element; __Pyx_INCREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 102, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_16, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 102, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_18 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_17}; __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 102, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_14); } __pyx_t_18 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14}; __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 101, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_12); } __Pyx_Raise(__pyx_t_12, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(2, 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_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 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_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26); if ( unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); __Pyx_XGOTREF(__pyx_t_21); __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_t_9 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23); __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; 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_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int32_t __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __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_t_22; char const *__pyx_t_23; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; PyObject *__pyx_t_28 = NULL; PyObject *__pyx_t_29 = NULL; int32_t __pyx_t_30; int32_t __pyx_t_31; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_encode", 0); /* "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(2, 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(2, 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":115 * * if not _is_array_iterable(obj): * raise TypeError( # <<<<<<<<<<<<<< * 'a sized iterable container expected (got type {!r})'.format( * type(obj).__name__)) */ __pyx_t_4 = NULL; /* "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_6 = __pyx_mstate_global->__pyx_kp_u_a_sized_iterable_container_expec; __Pyx_INCREF(__pyx_t_6); /* "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_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(2, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 115, __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(2, 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_1 = __pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(__pyx_v_obj, __pyx_v_dims, (&__pyx_v_ndims)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":121 * _get_array_shape(obj, dims, &ndims) * * elem_data = WriteBuffer.new() # <<<<<<<<<<<<<< * * if ndims > 1: */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 121, __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/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_1 = __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_1)) __PYX_ERR(2, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_9 = 0; 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_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 127, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 127, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_10; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 127, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10)); #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); #endif ++__pyx_t_10; } if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 127, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 127, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; __pyx_v_i = __pyx_t_9; __pyx_t_9 = (__pyx_t_9 + 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_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(2, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":132 * 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(2, 132, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L15_try_end; __pyx_L8_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/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_15 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError)))); if (__pyx_t_15) { __Pyx_AddTraceback("asyncpg.protocol.protocol.array_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(2, 133, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_v_e = __pyx_t_4; /*try:*/ { /* "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 = NULL; /* "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_18 = __pyx_mstate_global->__pyx_kp_u_invalid_array_element_at_index; __Pyx_INCREF(__pyx_t_18); /* "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_19 = __Pyx_PyLong_From_int32_t(__pyx_v_i); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 136, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 136, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_21 = __Pyx_GetItemInt(__pyx_t_20, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 136, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_8 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_t_19, __pyx_t_21}; __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 135, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_17); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_17}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 134, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_Raise(__pyx_t_6, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(2, 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_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 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; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29); if ( unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_28); __Pyx_XGOTREF(__pyx_t_29); __pyx_t_15 = __pyx_lineno; __pyx_t_22 = __pyx_clineno; __pyx_t_23 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_29); __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26); __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_22; __pyx_filename = __pyx_t_23; 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_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); 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_1); __pyx_t_1 = 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_1 = __Pyx_PyLong_From_long((12 + (8 * __pyx_v_ndims))); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __Pyx_PyLong_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 138, __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_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_v_ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = ((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_4)) __PYX_ERR(2, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_9 = __pyx_v_ndims; __pyx_t_30 = __pyx_t_9; for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) { __pyx_v_i = __pyx_t_31; /* "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_4 = ((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_4)) __PYX_ERR(2, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/codecs/array.pyx":150 * buf.write_int32(1) * # element data * 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(2, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_7); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __Pyx_XDECREF(__pyx_t_21); __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; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; size_t __pyx_t_18; int __pyx_t_19; char const *__pyx_t_20; PyObject *__pyx_t_21 = NULL; 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; Py_ssize_t __pyx_t_27; Py_ssize_t __pyx_t_28; Py_ssize_t __pyx_t_29; int __pyx_t_30; char const *__pyx_t_31; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_write_textarray_data", 0); /* "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(2, 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(2, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 171, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 171, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); #endif ++__pyx_t_3; } if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 171, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 171, __pyx_L1_error) PyErr_Clear(); } 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(2, 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(2, 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(2, 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(2, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 179, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 179, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); #endif ++__pyx_t_3; } if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 179, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 179, __pyx_L1_error) PyErr_Clear(); } 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->__pyx_new()); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 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(2, 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(2, 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_mstate_global->__pyx_n_b_NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 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(2, 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(((PyObject *)(((PyTypeObject*)PyExc_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(2, 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":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 = NULL; /* "asyncpg/protocol/codecs/array.pyx":195 * except TypeError as e: * raise ValueError( * 'invalid array element: {}'.format( # <<<<<<<<<<<<<< * e.args[0])) from None * */ __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_invalid_array_element; __Pyx_INCREF(__pyx_t_15); /* "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_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 196, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_16, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 196, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_18 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_17}; __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 195, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_14); } __pyx_t_18 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14}; __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 194, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_12); } __Pyx_Raise(__pyx_t_12, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(2, 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_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 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_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26); if ( unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); __Pyx_XGOTREF(__pyx_t_21); __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_t_9 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23); __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; 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(2, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyLong_SubtractObjC(__pyx_t_11, __pyx_mstate_global->__pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_27 = PyLong_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_27 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_elem_len = __pyx_t_27; /* "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_mstate_global->__pyx_kp_b__10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 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_19 = PyObject_GetBuffer(((PyObject *)__pyx_v_elem_data), (&__pyx_v_pybuf), PyBUF_SIMPLE); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(2, 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_19 = __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp_char(__pyx_v_elem_str, ((char const *)"NULL")); if (unlikely(__pyx_t_19 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 211, __pyx_L35_error) __pyx_t_2 = (!(__pyx_t_19 != 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(2, 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(2, 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(2, 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_27 = __pyx_v_elem_len; __pyx_t_28 = __pyx_t_27; 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":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_30 = (__pyx_v_ch == '{'); if (!__pyx_t_30) { } else { __pyx_t_2 = __pyx_t_30; goto __pyx_L41_bool_binop_done; } __pyx_t_30 = (__pyx_v_ch == '}'); if (!__pyx_t_30) { } else { __pyx_t_2 = __pyx_t_30; goto __pyx_L41_bool_binop_done; } __pyx_t_30 = (__pyx_v_ch == __pyx_v_delim); if (!__pyx_t_30) { } else { __pyx_t_2 = __pyx_t_30; 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_30 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace(((uint32_t)__pyx_v_ch)); if (unlikely(__pyx_t_30 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 226, __pyx_L35_error) __pyx_t_2 = __pyx_t_30; __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(2, 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(2, 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_27 = __pyx_v_elem_len; __pyx_t_28 = __pyx_t_27; 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":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(2, 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(2, 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(2, 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(2, 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_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 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_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24); if ( 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_26); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_19 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_31 = __pyx_filename; { PyBuffer_Release((&__pyx_v_pybuf)); } __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24); __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_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_31; 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(2, 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_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int32_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("textarray_encode", 0); /* "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(2, 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(2, 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":263 * * if not _is_array_iterable(obj): * raise TypeError( # <<<<<<<<<<<<<< * 'a sized iterable container expected (got type {!r})'.format( * type(obj).__name__)) */ __pyx_t_4 = NULL; /* "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_6 = __pyx_mstate_global->__pyx_kp_u_a_sized_iterable_container_expec; __Pyx_INCREF(__pyx_t_6); /* "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_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(2, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 263, __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(2, 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_1 = __pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(__pyx_v_obj, __pyx_v_dims, (&__pyx_v_ndims)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_array_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 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_1 = __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_1)) __PYX_ERR(2, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_array_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":273 * encoder, encoder_arg, typdelim) * buf.write_int32(array_data.len()) * buf.write_buffer(array_data) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = ((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_1)) __PYX_ERR(2, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_XDECREF(__pyx_t_7); __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; size_t __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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(2, 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 == ((void *)NULL))) __PYX_ERR(2, 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 == ((void *)NULL))) __PYX_ERR(2, 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(2, 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "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_mstate_global->__pyx_kp_u_number_of_array_dimensions_excee; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyLong_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_mstate_global->__pyx_int_6}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 294, __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(2, 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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 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_8 = __pyx_mstate_global->__pyx_kp_u_unexpected_array_dimensions_valu; __Pyx_INCREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyLong_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(2, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 298, __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(2, 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 == ((void *)NULL))) __PYX_ERR(2, 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_7 = __pyx_mstate_global->__pyx_kp_u_unexpected_array_dimension_size; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyLong_From_int32_t((__pyx_v_dims[__pyx_v_i])); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 304, __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(2, 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 == ((void *)NULL))) __PYX_ERR(2, 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(2, 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 == ((void *)NULL))) __PYX_ERR(2, 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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 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(2, 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(2, 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(2, 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; PyObject *__pyx_t_8 = NULL; size_t __pyx_t_9; int64_t __pyx_t_10; int64_t __pyx_t_11; char const *__pyx_t_12; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_13; int64_t __pyx_t_14; int64_t __pyx_t_15; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_nested_array_decode", 0); /* "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(2, 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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_array_length_overflow}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 361, __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(2, 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_10 = __pyx_t_3; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; /* "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_12 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_12 == ((void *)NULL))) __PYX_ERR(2, 365, __pyx_L1_error) __pyx_v_elem_len = unpack_int32(__pyx_t_12); /* "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_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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 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_13, __pyx_v_decoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 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_14 = __pyx_v_ndims-1; __pyx_t_14 >= 0; __pyx_t_14-=1) { __pyx_v_j = __pyx_t_14; /* "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(2, 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_15 = __pyx_v_j; (__pyx_v_indexes[__pyx_t_15]) = ((__pyx_v_indexes[__pyx_t_15]) + 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_16 = ((__pyx_v_indexes[__pyx_v_j]) == (__pyx_v_dims[__pyx_v_j])); if (__pyx_t_16) { } else { __pyx_t_4 = __pyx_t_16; goto __pyx_L13_bool_binop_done; } __pyx_t_16 = (__pyx_v_j != 0); __pyx_t_4 = __pyx_t_16; __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_XDECREF(__pyx_t_8); __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; PyObject *__pyx_t_15 = NULL; size_t __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("textarray_decode", 0); /* "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(2, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(2, 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 == ((void *)NULL))) __PYX_ERR(2, 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(2, 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(((PyObject *)(((PyTypeObject*)PyExc_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(2, 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_t_10 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 429, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 429, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_13 = __pyx_mstate_global->__pyx_kp_u_malformed_array_literal_r; __Pyx_INCREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 430, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 430, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_16 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_v_s, __pyx_t_15}; __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_16, (3-__pyx_t_16) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 430, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_16 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_16 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_16, (2-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 429, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(2, 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_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_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_9); __pyx_t_9 = 0; __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ( 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_6 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __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_6; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18; 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_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_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_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22); if ( 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_24); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_17 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_25 = __pyx_filename; { PyMem_Free(__pyx_v_array_text); } __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_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_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_25; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_22 = __pyx_r; __pyx_r = 0; PyMem_Free(__pyx_v_array_text); __pyx_r = __pyx_t_22; __pyx_t_22 = 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_XDECREF(__pyx_t_15); __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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; Py_UCS4 *__pyx_t_8; int32_t __pyx_t_9; int32_t __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12; int __pyx_t_13; long __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_textarray_decode", 0); /* "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(2, 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":486 * * if ndims > ARRAY_MAXDIM: * raise ValueError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM)) */ __pyx_t_3 = NULL; /* "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_5 = __pyx_mstate_global->__pyx_kp_u_number_of_array_dimensions_excee; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyLong_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_mstate_global->__pyx_int_6}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(2, 486, __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(2, 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_8 = __pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(__pyx_v_ptr, (&__pyx_v_ubound)); if (unlikely(__pyx_t_8 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 490, __pyx_L1_error) __pyx_v_ptr = __pyx_t_8; /* "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_4 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_missing_array_dimension_value}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 492, __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(2, 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_8 = __pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(__pyx_v_ptr, (&__pyx_v_ubound)); if (unlikely(__pyx_t_8 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 499, __pyx_L1_error) __pyx_v_ptr = __pyx_t_8; /* "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_4 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_missing_array_dimension_value}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 501, __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(2, 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_4 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_missing_after_array_dimensions}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 506, __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(2, 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_4 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_missing_after_array_dimensions_2}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 516, __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(2, 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(2, 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_2 = __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_2)) __PYX_ERR(2, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_4 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_specified_array_dimensions_do_no}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 531, __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(2, 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_9 = __pyx_v_ndims; __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/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_4 = NULL; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_specified_array_dimensions_do_no}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 536, __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(2, 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_2 = __pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(__pyx_v_ptr, __pyx_v_typdelim, __pyx_v_dims, (&__pyx_v_ndims)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = PyList_New((__pyx_v_dims[(__pyx_v_nest_level - 1)])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_new_stride, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 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_12 = ((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_12), (__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(2, 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_13 = (!__pyx_v_has_quoting); if (__pyx_t_13) { } else { __pyx_t_1 = __pyx_t_13; goto __pyx_L34_bool_binop_done; } __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp(__pyx_v_item_start, __pyx_v_7asyncpg_8protocol_8protocol_APG_NULL); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 638, __pyx_L1_error) __pyx_t_13 = (__pyx_t_11 == 0); __pyx_t_1 = __pyx_t_13; __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_2 = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, ((void *)__pyx_v_item_start), (__pyx_v_item_end - __pyx_v_item_start)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "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_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(2, 644, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_item_text, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 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_2 = __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_2)) __PYX_ERR(2, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(2, 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_2 = __pyx_v_decoder(__pyx_v_settings, (&__pyx_v_item_buf), __pyx_v_decoder_arg); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2); __pyx_t_2 = 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_12 = ((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_12), (__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_14 = (__pyx_v_nest_level - 1); (__pyx_v_indexes[__pyx_t_14]) = ((__pyx_v_indexes[__pyx_t_14]) + 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(2, 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_XDECREF(__pyx_t_6); __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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_UnexpectedCharacter", 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_XDECREF(__pyx_r); __pyx_t_2 = NULL; __pyx_t_4 = __pyx_mstate_global->__pyx_kp_u_unexpected_character_r_at_positi; __Pyx_INCREF(__pyx_t_4); /* "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_5 = PyUnicode_FromOrdinal(((int)(__pyx_v_ptr[0]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyLong_From_ptrdiff_t(((__pyx_v_ptr - __pyx_v_array_text) + 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 679, __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":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_XDECREF(__pyx_t_6); __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; PyObject *__pyx_t_4 = NULL; size_t __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; long __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_infer_array_dims", 0); /* "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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_unexpected_end_of_string}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 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(2, 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_6 = 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_6 = 1; break; } __pyx_t_7 = __pyx_t_6; if (__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; 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_6 = (__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED); if (__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; goto __pyx_L13_bool_binop_done; } __pyx_t_7 = __pyx_v_in_quotes; __pyx_L13_bool_binop_done:; __pyx_t_6 = (!__pyx_t_7); __pyx_t_2 = __pyx_t_6; __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(2, 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(2, 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_6 = __pyx_t_2; if (unlikely(__pyx_t_6)) { /* "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(2, 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(2, 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_6 = ((__pyx_v_ptr[1]) != 0); if (likely(__pyx_t_6)) { /* "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_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_unexpected_end_of_string}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 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(2, 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_6 = ((__pyx_v_ptr[0]) == 0x7B); if (__pyx_t_6) { /* "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_6 = 0; break; default: __pyx_t_6 = 1; break; } __pyx_t_2 = __pyx_t_6; 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(2, 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(2, 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":747 * parse_state = APS_STRIDE_STARTED * if nest_level >= ARRAY_MAXDIM: * raise ValueError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format( */ __pyx_t_4 = NULL; /* "asyncpg/protocol/codecs/array.pyx":749 * raise ValueError( * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format( # <<<<<<<<<<<<<< * nest_level, ARRAY_MAXDIM)) * */ __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_number_of_array_dimensions_excee; __Pyx_INCREF(__pyx_t_9); /* "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_10 = __Pyx_PyLong_From_int(__pyx_v_nest_level); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_10, __pyx_mstate_global->__pyx_int_6}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 747, __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(2, 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_6 = 0; break; default: __pyx_t_6 = 1; break; } __pyx_t_7 = __pyx_t_6; if (__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; 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_6 = (__pyx_v_nest_level == 1); if (__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; 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_6 = (__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED); __pyx_t_7 = __pyx_t_6; __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_6 = (!__pyx_t_7); __pyx_t_2 = __pyx_t_6; __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_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 761, __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(2, 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_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 766, __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(2, 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_6 = ((__pyx_v_prev_stride_len[__pyx_v_nest_level]) != 0); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; 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_6 = ((__pyx_v_stride_len[__pyx_v_nest_level]) != (__pyx_v_prev_stride_len[__pyx_v_nest_level])); __pyx_t_2 = __pyx_t_6; __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":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_8 = NULL; /* "asyncpg/protocol/codecs/array.pyx":774 * raise ValueError( * 'inconsistent sub-array dimensions' * ' at position {}'.format( # <<<<<<<<<<<<<< * ptr - array_text + 1)) * */ __pyx_t_10 = __pyx_mstate_global->__pyx_kp_u_inconsistent_sub_array_dimension; __Pyx_INCREF(__pyx_t_10); /* "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_9 = __Pyx_PyLong_From_ptrdiff_t(((__pyx_v_ptr - __pyx_v_array_text) + 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(2, 772, __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(2, 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_11 = (__pyx_v_nest_level - 1); (__pyx_v_dims[__pyx_t_11]) = ((__pyx_v_dims[__pyx_t_11]) + 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_6 = __pyx_t_2; if (unlikely(__pyx_t_6)) { /* "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(2, 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(2, 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_6 = (__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE); if (__pyx_t_6) { /* "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_11 = (__pyx_v_nest_level - 1); (__pyx_v_stride_len[__pyx_t_11]) = ((__pyx_v_stride_len[__pyx_t_11]) + 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_6 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 795, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_6); 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_6 = __pyx_t_2; if (unlikely(__pyx_t_6)) { /* "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(2, 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(2, 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_6 = (!__pyx_v_end_of_item); if (__pyx_t_6) { /* "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_6 = (!__pyx_v_array_is_empty); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/array.pyx":808 * * if not array_is_empty: * dims[ndims[0] - 1] += 1 # <<<<<<<<<<<<<< * * ptr += 1 */ __pyx_t_11 = ((__pyx_v_ndims[0]) - 1); (__pyx_v_dims[__pyx_t_11]) = ((__pyx_v_dims[__pyx_t_11]) + 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_6 = ((__pyx_v_ptr[0]) != 0); if (!__pyx_t_6) 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_6 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 814, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_6); 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(2, 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(2, 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_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __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", 0); /* "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(2, 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", 0); /* "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(2, 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", 0); /* "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(2, 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", 0); /* "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(2, 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", 0); /* "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(2, 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", 0); /* "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(2, 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", 0); /* "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(2, 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", 0); /* "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(2, 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", 0); /* "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(2, 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(2, 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", 0); /* "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_mstate_global->__pyx_n_u_apg_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Range); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 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(12, 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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int32_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("range_encode", 0); /* "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->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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":55 * * if arg_type == _RANGE_ARGUMENT_INVALID: * raise TypeError( # <<<<<<<<<<<<<< * 'list, tuple or Range object expected (got type {})'.format( * type(obj))) */ __pyx_t_3 = NULL; /* "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_5 = __pyx_mstate_global->__pyx_kp_u_list_tuple_or_Range_object_expec; __Pyx_INCREF(__pyx_t_5); /* "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_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_obj))}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 55, __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(12, 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_7 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(12, 60, __pyx_L1_error) __pyx_v_obj_len = __pyx_t_7; /* "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_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 62, __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":63 * if obj_len == 2: * lower = obj[0] * upper = obj[1] # <<<<<<<<<<<<<< * * if lower is None: */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 63, __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":65 * upper = obj[1] * * if lower is None: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INF * */ __pyx_t_8 = (__pyx_v_lower == Py_None); if (__pyx_t_8) { /* "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_8 = (__pyx_v_upper == Py_None); if (__pyx_t_8) { /* "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_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 74, __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":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":81 * * else: * raise ValueError( # <<<<<<<<<<<<<< * 'expected 0, 1 or 2 elements in range (got {})'.format( * obj_len)) */ __pyx_t_4 = NULL; /* "asyncpg/protocol/codecs/range.pyx":82 * else: * raise ValueError( * 'expected 0, 1 or 2 elements in range (got {})'.format( # <<<<<<<<<<<<<< * obj_len)) * */ __pyx_t_5 = __pyx_mstate_global->__pyx_kp_u_expected_0_1_or_2_elements_in_ra; __Pyx_INCREF(__pyx_t_5); /* "asyncpg/protocol/codecs/range.pyx":83 * raise ValueError( * 'expected 0, 1 or 2 elements in range (got {})'.format( * obj_len)) # <<<<<<<<<<<<<< * * else: */ __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_obj_len); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 81, __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(12, 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_mstate_global->__pyx_n_u_isempty); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(12, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "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_mstate_global->__pyx_n_u_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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_mstate_global->__pyx_n_u_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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_mstate_global->__pyx_n_u_lower_inc); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(12, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "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_8 = (__pyx_v_lower == Py_None); if (__pyx_t_8) { /* "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_mstate_global->__pyx_n_u_upper_inc); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(12, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "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_8 = (__pyx_v_upper == Py_None); if (__pyx_t_8) { /* "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_8 = __pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(__pyx_v_flags); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(12, 102, __pyx_L1_error) if (__pyx_t_8) { /* "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(12, 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_8 = __pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(__pyx_v_flags); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(12, 105, __pyx_L1_error) if (__pyx_t_8) { /* "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(12, 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(12, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyLong_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 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_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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(12, 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(12, 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_5); __Pyx_XDECREF(__pyx_t_9); __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; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; size_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("range_decode", 0); /* "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 == ((void *)NULL))) __PYX_ERR(12, 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(12, 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 == ((void *)NULL))) __PYX_ERR(12, 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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 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(12, 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(12, 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 == ((void *)NULL))) __PYX_ERR(12, 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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 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(12, 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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_apg_types); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Range); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "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(12, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "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_8 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 4) != 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "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_9 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 1) != 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 5 : 0)] = {__pyx_t_5, NULL}; __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_lower, __pyx_v_lower, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(12, 138, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_upper, __pyx_v_upper, __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(12, 138, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_lower_inc, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(12, 138, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_upper_inc, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(12, 138, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_empty, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(12, 138, __pyx_L1_error) __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; __pyx_t_4 = 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_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __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; PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; Py_ssize_t __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); Py_ssize_t __pyx_t_11; PyObject *__pyx_t_12[3]; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multirange_encode", 0); /* "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_mstate_global->__pyx_n_u_SequenceABC); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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":153 * * if not isinstance(obj, SequenceABC): * raise TypeError( # <<<<<<<<<<<<<< * 'expected a sequence (got type {!r})'.format(type(obj).__name__) * ) */ __pyx_t_4 = NULL; /* "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_6 = __pyx_mstate_global->__pyx_kp_u_expected_a_sequence_got_type_r; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 153, __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(12, 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_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 157, __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/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_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 159, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 159, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_9; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 159, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9)); #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9); #endif ++__pyx_t_9; } if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 159, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_10(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(12, 159, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_5); __pyx_t_5 = 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_5 = __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_5)) __PYX_ERR(12, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_1); __pyx_t_1 = 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_9 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(12, 162, __pyx_L1_error) __pyx_v_elem_count = __pyx_t_9; /* "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_5 = NULL; __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_multirange}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 164, __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(12, 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_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = PyLong_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_elem_data_len = __pyx_t_11; /* "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":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_5 = NULL; /* "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_4 = __Pyx_PyUnicode_From_long((INT32_MAX - 4), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_size_of_encoded_multirange_datum; __pyx_t_12[1] = __pyx_t_4; __pyx_t_12[2] = __pyx_mstate_global->__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_7 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, 61 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 6, 127); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 168, __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(12, 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_1 = ((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_1)) __PYX_ERR(12, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = ((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_1)) __PYX_ERR(12, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":176 * # Number of elements in multirange * buf.write_int32(elem_count) * buf.write_buffer(elem_data) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = ((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_1)) __PYX_ERR(12, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_XDECREF(__pyx_t_7); __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; size_t __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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(12, 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(12, 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_7 = __pyx_mstate_global->__pyx_kp_u_unexpected_multirange_size_value; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyLong_From_int32_t(__pyx_v_nelems); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 192, __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(12, 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(12, 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 == ((void *)NULL))) __PYX_ERR(12, 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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_unexpected_NULL_element_in_multi}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(12, 199, __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(12, 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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 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(12, 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", 0); /* "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(13, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_4, __pyx_t_1, 4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyLong_As_int32_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 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(13, 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(13, 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(13, 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; size_t __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", 0); /* "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 == ((void *)NULL))) __PYX_ERR(13, 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(13, 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 == ((void *)NULL))) __PYX_ERR(13, 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 == ((void *)NULL))) __PYX_ERR(13, 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(13, 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(13, 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(13, 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_t_9 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_10)) __PYX_ERR(13, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_11)) __PYX_ERR(13, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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_12 = __pyx_mstate_global->__pyx_kp_u_no_decoder_for_composite_type_el; __Pyx_INCREF(__pyx_t_12); __pyx_t_13 = PyLong_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_13)) __PYX_ERR(13, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyLong_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_14)) __PYX_ERR(13, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_13, __pyx_t_14}; __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(13, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_15 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11); assert(__pyx_t_9); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_15 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 42, __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(13, 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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(13, 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(13, 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; PyObject *__pyx_t_4 = NULL; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("anonymous_record_encode", 0); /* "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_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_input_of_anonymous_composite_typ}; __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_hint, __pyx_mstate_global->__pyx_kp_u_Consider_declaring_an_explicit_c, __pyx_t_3, __pyx_callargs+2, 0) < (0)) __PYX_ERR(13, 55, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_detail, __pyx_mstate_global->__pyx_kp_u_PostgreSQL_does_not_implement_an, __pyx_t_3, __pyx_callargs+2, 1) < (0)) __PYX_ERR(13, 55, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 55, __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(13, 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_XDECREF(__pyx_t_4); __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", 0); /* "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(13, 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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_authentication_method,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 93, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 93, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(3, 93, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, i); __PYX_ERR(3, 93, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 93, __pyx_L3_error) } __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(3, 93, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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(3, 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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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__", 0); /* "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_mstate_global->__pyx_kp_b_n); __Pyx_GIVEREF(__pyx_mstate_global->__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_mstate_global->__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; size_t __pyx_t_4; Py_ssize_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("create_client_first_message", 0); /* "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_mstate_global->__pyx_n_u_DEFAULT_CLIENT_NONCE_BYTES); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 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(3, 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(3, 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(3, 116, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_b_n_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 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_mstate_global->__pyx_kp_b_r_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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(3, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__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 */ __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_1 = NULL; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 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_mstate_global->__pyx_kp_b__11); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 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(3, 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(3, 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_5 = __Pyx_PyBytes_GET_SIZE(__pyx_v_client_first_message); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(3, 123, __pyx_L1_error) __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_4}; __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_byteorder, __pyx_mstate_global->__pyx_n_u_big, __pyx_t_7, __pyx_callargs+2, 0) < (0)) __PYX_ERR(3, 123, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_to_bytes, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } /* "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_6 = PyNumber_Add(__pyx_t_1, __pyx_v_client_first_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__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_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(3, 123, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 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_6); __Pyx_XDECREF(__pyx_t_7); __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; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; size_t __pyx_t_9; 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( */ __pyx_t_2 = NULL; { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 132, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); /* "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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_REQUIREMENTS_CLIENT_FINAL_MESSAG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 133, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 133, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 133, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 133, __pyx_L6_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 133, __pyx_L6_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6)); #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); #endif ++__pyx_t_6; } if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 133, __pyx_L6_error) } else { __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 133, __pyx_L6_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_val, __pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetAttr(((PyObject *)__pyx_v_self), __pyx_8genexpr2__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 132, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = (__pyx_t_4 == Py_None); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 132, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 132, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_any, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_8)) { /* "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 = NULL; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_you_need_values_from_server_to_g}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 134, __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, 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password(__pyx_v_self, __pyx_v_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(3, 138, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_password, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof(__pyx_v_self, __pyx_v_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 141, __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(3, 141, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->client_proof); __Pyx_DECREF(__pyx_v_self->client_proof); __pyx_v_self->client_proof = ((PyObject*)__pyx_t_1); __pyx_t_1 = 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 = NULL; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 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_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_b64encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->client_channel_binding}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(3, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_5 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_b_c_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_kp_b_r_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5 = PyNumber_Add(__pyx_t_1, __pyx_v_self->server_nonce); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_kp_b_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_b64encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->client_proof}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 145, __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; /* "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_5 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(3, 143, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 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_4); __Pyx_XDECREF(__pyx_t_5); __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; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; size_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_server_first_message", 0); /* "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_t_7 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 152, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 152, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_b_r_3, __pyx_v_self->server_first_message}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 152, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_1}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 153, __pyx_L3_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(3, 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; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_IndexError)))); if (__pyx_t_11) { __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.parse_server_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(3, 154, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __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_7 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_could_not_get_nonce}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 155, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(3, 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(3, 156, __pyx_L1_error) } __pyx_t_12 = __Pyx_PyBytes_Tailmatch(__pyx_v_self->server_nonce, __pyx_v_self->client_nonce, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(3, 156, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_12); if (unlikely(__pyx_t_13)) { /* "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_6 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_invalid_nonce}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 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(3, 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_t_9 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 159, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 159, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_9); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_b_s, __pyx_v_self->server_first_message}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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, 159, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_int_1}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 160, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); } if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(3, 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; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_IndexError)))); if (__pyx_t_11) { __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.parse_server_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(3, 161, __pyx_L14_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); /* "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_9 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_could_not_get_salt}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 162, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(3, 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_t_8 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 164, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 164, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_8); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_b_i_d, __pyx_v_self->server_first_message}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(3, 164, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_1}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 165, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); } /* "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_5 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 164, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 164, __pyx_L20_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->password_iterations = __pyx_t_11; /* "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; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_IndexError)))) || __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError)))) || __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ValueError)))); if (__pyx_t_11) { __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_4) < 0) __PYX_ERR(3, 166, __pyx_L22_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); /* "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_8 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_could_not_get_iterations}; __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 167, __pyx_L22_except_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(3, 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_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __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; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; size_t __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("verify_server_final_message", 0); /* "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_t_7 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 175, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 175, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_b_v, __pyx_v_server_final_message}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 175, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_1}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 176, __pyx_L3_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(3, 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; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_IndexError)))); if (__pyx_t_11) { __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.verify_server_final_message", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(3, 177, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __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_7 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_could_not_get_server_signature}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 178, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(3, 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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __pyx_v_self->server_key; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } /* "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_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_DIGEST); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_4, __pyx_v_self->authorization_message, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __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_t_9 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_b64encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_6 = __pyx_v_verify_server_signature; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_9); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = PyObject_RichCompare(__pyx_v_server_signature, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 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_8); __Pyx_XDECREF(__pyx_t_9); __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, __pyx_mstate_global->__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(3, 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, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication__bytes_xor_l, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(3, 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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); __PYX_ERR(3, 188, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(3, 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(3, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 188, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 188, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif ++__pyx_t_2; } if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 188, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 188, __pyx_L1_error) PyErr_Clear(); } 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(3, 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_INCREF(__pyx_t_5); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_6); } else { __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 188, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 188, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_6); } #else __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 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(3, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(3, 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(3, 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(3, 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(3, 188, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* 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_7); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __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":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; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_bytes_xor", 0); /* "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_2 = NULL; __pyx_t_4 = NULL; __pyx_t_5 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_a, __pyx_v_b}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_4 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 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_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_generate_client_nonce", 0); /* "asyncpg/protocol/scram.pyx":194 * bytes token * * token = secrets.token_bytes(num_bytes) # <<<<<<<<<<<<<< * * return base64.b64encode(token) */ __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_secrets); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_token_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_num_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 194, __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(3, 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_b64encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_token}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; size_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_generate_client_proof", 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 = NULL; { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 203, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); /* "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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_REQUIREMENTS_CLIENT_PROOF); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 204, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 204, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 204, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 204, __pyx_L6_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 204, __pyx_L6_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6)); #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); #endif ++__pyx_t_6; } if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 204, __pyx_L6_error) } else { __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 204, __pyx_L6_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_val, __pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_GetAttr(((PyObject *)__pyx_v_self), __pyx_8genexpr4__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 203, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = (__pyx_t_4 == Py_None); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 203, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 203, __pyx_L6_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_any, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_8)) { /* "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 = NULL; __pyx_t_9 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_you_need_values_from_server_to_g}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 205, __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, 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_1 = __pyx_v_self->password_salt; __Pyx_INCREF(__pyx_t_1); /* "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_3 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password(__pyx_v_self, __pyx_v_password, ((PyObject*)__pyx_t_1), __pyx_v_self->password_iterations); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 208, __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(3, 208, __pyx_L1_error) __pyx_v_salted_password = ((PyObject*)__pyx_t_3); __pyx_t_3 = 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_t_1 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_DIGEST); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_1); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_v_salted_password, __pyx_mstate_global->__pyx_kp_b_Client_Key, __pyx_t_2}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_v_client_key = __pyx_t_3; __pyx_t_3 = 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_5 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_v_client_key; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_DIGEST, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_v_stored_key = __pyx_t_3; __pyx_t_3 = 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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_DIGEST); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_salted_password, __pyx_mstate_global->__pyx_kp_b_Server_Key, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->server_key); __Pyx_DECREF(__pyx_v_self->server_key); __pyx_v_self->server_key = __pyx_t_3; __pyx_t_3 = 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_3 = PyNumber_Add(__pyx_v_self->client_first_message_bare, __pyx_mstate_global->__pyx_kp_b__12); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "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_1 = PyNumber_Add(__pyx_t_3, __pyx_v_self->server_first_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_mstate_global->__pyx_kp_b_c_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_b64encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_self->client_channel_binding}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 222, __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_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 221, __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/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_1 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_b_r_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = PyNumber_Add(__pyx_t_1, __pyx_v_self->server_nonce); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(3, 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_4); __Pyx_GOTREF(__pyx_v_self->authorization_message); __Pyx_DECREF(__pyx_v_self->authorization_message); __pyx_v_self->authorization_message = ((PyObject*)__pyx_t_4); __pyx_t_4 = 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_t_1 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_stored_key; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } /* "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_mstate_global->__pyx_n_u_DIGEST); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_1); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_3, __pyx_v_self->authorization_message, __pyx_t_2}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_client_signature = __pyx_t_4; __pyx_t_4 = 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_5 = __pyx_v_client_key; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 228, __pyx_L1_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(3, 228, __pyx_L1_error) __pyx_t_2 = __pyx_v_client_signature; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(3, 228, __pyx_L1_error) __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(__pyx_v_self, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_4); __Pyx_XDECREF(__pyx_t_5); __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; PyObject *__pyx_t_4 = NULL; size_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; long __pyx_t_7; long __pyx_t_8; long __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_generate_salted_password", 0); /* "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(3, 239, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_b64decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_salt}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 241, __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(3, 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Add(__pyx_v_s, __pyx_mstate_global->__pyx_kp_b__13); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_DIGEST); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_p, __pyx_t_2, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_3 = __pyx_v_ui; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 246, __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(3, 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __pyx_v_ui; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_hashlib); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sha256); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_p, __pyx_t_6, __pyx_t_10}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_2 = __pyx_v_ui; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 253, __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(3, 253, __pyx_L1_error) __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(__pyx_v_self, __pyx_v_u, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 253, __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(3, 253, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_u, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 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_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, __pyx_mstate_global->__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(3, 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, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication__normalize_p, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(3, 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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; 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_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(3, 287, __pyx_L1_error) __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(3, 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(3, 288, __pyx_L1_error) } __pyx_t_1 = PySequence_Tuple(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 288, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3)); #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); #endif ++__pyx_t_3; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_in_table_b1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = (!__pyx_t_8); if (__pyx_t_9) { /* "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 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_in_table_c12); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(3, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_9) { __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__14); __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__14; } 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(3, 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_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_10); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__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(3, 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, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication__normalize_p, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(3, 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; size_t __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(3, 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(3, 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(3, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 314, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 314, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif ++__pyx_t_2; } if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 314, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 314, __pyx_L1_error) PyErr_Clear(); } 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 * ): */ __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_in_prohibited_table); __pyx_t_6 = __pyx_cur_scope->__pyx_v_in_prohibited_table; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c)) { __Pyx_RaiseClosureNameError("c"); __PYX_ERR(3, 313, __pyx_L1_error) } __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 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_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, __pyx_mstate_global->__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(3, 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, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication__normalize_p, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(3, 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; PyObject *__pyx_t_6 = NULL; size_t __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(3, 327, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(3, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 327, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_in_table_d1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { __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_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, __pyx_mstate_global->__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(3, 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, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication__normalize_p, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(3, 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; PyObject *__pyx_t_6 = NULL; size_t __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(3, 336, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(3, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 336, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_in_table_d2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { /* "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_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __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; PyObject *__pyx_t_10 = NULL; size_t __pyx_t_11; Py_ssize_t __pyx_t_12; 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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, __pyx_mstate_global->__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(3, 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(3, 275, __pyx_L3_error) } __pyx_t_4 = PyUnicode_AsASCIIString(__pyx_v_original_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 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(((PyObject *)(((PyTypeObject*)PyExc_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(3, 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_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__15, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 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 * */ if (__pyx_v_normalized_password == Py_None) __pyx_t_7 = 0; else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_normalized_password); if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(3, 293, __pyx_L1_error) __pyx_t_7 = (__pyx_temp != 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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_unicodedata); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_normalize); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_NFKC, __pyx_v_normalized_password}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(3, 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 * */ if (__pyx_v_normalized_password == Py_None) __pyx_t_8 = 0; else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_normalized_password); if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(3, 301, __pyx_L1_error) __pyx_t_8 = (__pyx_temp != 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(3, 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_12 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 311, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12)); #else __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); #endif ++__pyx_t_12; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 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_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_SASLPREP_PROHIBITED); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); /* "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_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_Generator_GetInlinedResult(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(3, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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(3, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(3, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_in_table_d1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_normalized_password_tuple, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L19_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_t_9 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_in_table_d1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 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_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_9); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_6}; __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_7 = __pyx_t_8; __pyx_L19_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_10 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_9genexpr(NULL, __pyx_v_normalized_password_tuple); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 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_10); __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__", 0); __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__", 0); __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__", 0); __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__", 0); __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__", 0); __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__", 0); __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__", 0); __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__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->password_iterations); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 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__", 0); __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__", 0); __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__", 0); __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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(9, 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 3, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 3, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 3, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error) } __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(9, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(9, 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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_addr,&__pyx_mstate_global->__pyx_n_u_con_params,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(15, 26, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(15, 26, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(15, 26, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(15, 26, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(15, 26, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(15, 26, __pyx_L3_error) values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(15, 26, __pyx_L3_error) } __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(15, 26, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_2 = NULL; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "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_2 = NULL; __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 29, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); } __Pyx_GIVEREF((PyObject *)__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_mstate_global->__pyx_n_u_user); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_user, __pyx_t_1) < (0)) __PYX_ERR(15, 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_mstate_global->__pyx_n_u_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_password, __pyx_t_1) < (0)) __PYX_ERR(15, 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_mstate_global->__pyx_n_u_auth_msg, Py_None) < (0)) __PYX_ERR(15, 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_mstate_global->__pyx_kp_u_utf_8); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_utf_8); __Pyx_GOTREF(__pyx_v_self->encoding); __Pyx_DECREF(__pyx_v_self->encoding); __pyx_v_self->encoding = __pyx_mstate_global->__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(15, 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_XDECREF(__pyx_t_2); __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; size_t __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", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if ( #if !CYTHON_USE_TYPE_SLOTS unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol && __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC)) #else 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))) #endif ) { #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_mstate_global->__pyx_n_u_is_in_transaction); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(15, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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(15, 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_in_transaction", __pyx_kwds); 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", 0); __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(15, 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; PyObject *__pyx_t_11 = NULL; size_t __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14[5]; 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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_t_1 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 132, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 132, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_12 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); assert(__pyx_t_1); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_12 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_unknown_error_in_protocol_implem}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 132, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); } __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(15, 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(15, 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(15, 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(15, 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_t_11 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 148, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 148, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1 = PyUnicode_FromOrdinal(__pyx_v_mtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 149, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(15, 149, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "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_1 = __Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_state, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 150, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_cannot_process_message; __pyx_t_14[1] = __pyx_t_13; __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_protocol_is_in_an_unexpected_st; __pyx_t_14[3] = __pyx_t_1; __pyx_t_14[4] = __pyx_mstate_global->__pyx_kp_u__16; /* "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_15 = __Pyx_PyUnicode_Join(__pyx_t_14, 5, 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1)); if (unlikely(!__pyx_t_15)) __PYX_ERR(15, 149, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); assert(__pyx_t_11); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_12 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_15}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 148, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(15, 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_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 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)))); 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_10, &__pyx_t_15) < 0) __PYX_ERR(15, 152, __pyx_L12_except_error) __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_t_10); __pyx_v_ex = __pyx_t_10; /*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_11 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 157, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ( 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; } __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_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 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_15 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_15)) __PYX_ERR(15, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 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_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22); if ( 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_15 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_15)) __PYX_ERR(15, 162, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __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:; __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_11); __Pyx_XDECREF(__pyx_t_13); __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; PyObject *__pyx_t_13 = NULL; size_t __pyx_t_14; 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("_process__auth", 0); /* "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(15, 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(15, 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_mstate_global->__pyx_n_u_auth_msg); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 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_mstate_global->__pyx_n_u_auth_msg); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 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(15, 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_mstate_global->__pyx_n_u_auth_msg, Py_None) < (0)) __PYX_ERR(15, 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)))); 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(15, 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_t_10 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 175, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 175, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_11 = __Pyx_PyObject_FormatSimple(__pyx_v_ex, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 176, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_unexpected_error_while_performin, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(15, 176, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_14 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_13}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 175, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_9); } /* "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_mstate_global->__pyx_n_u_cause, __pyx_v_ex) < (0)) __PYX_ERR(15, 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(15, 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_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_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_9); __pyx_t_9 = 0; __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ( 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_7 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0; } __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_7; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; 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(15, 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(15, 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(15, 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(15, 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(15, 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_XDECREF(__pyx_t_13); __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", 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() */ 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(15, 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(15, 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(15, 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(15, 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(15, 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_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 228, __pyx_L1_error) __Pyx_GOTREF(__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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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", 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) */ 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(15, 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(15, 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(15, 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(15, 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", 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 */ 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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): */ __pyx_t_4 = __pyx_v_msg; __Pyx_INCREF(__pyx_t_4); if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(15, 436, __pyx_L1_error) __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", 0); /* "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(15, 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(15, 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(15, 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(15, 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; size_t __pyx_t_3; int __pyx_t_4; 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("_write_copy_data_msg", 0); /* "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(15, 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(15, 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(15, 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(15, 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_v_mview; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_release, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 475, __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_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_1); __pyx_t_1 = 0; __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ( 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_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { __pyx_t_2 = __pyx_v_mview; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_release, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 475, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __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_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; __pyx_L7_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); __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; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 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(15, 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_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", 0); /* "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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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_mstate_global->__pyx_kp_u__15); __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__15; __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(15, 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(15, 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(15, 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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; int32_t __pyx_t_8; 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", 0); /* "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(15, 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_parse_data_msgs_first_message_i}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 514, __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, 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_8 = __pyx_v_take_message_type(((PyObject *)__pyx_v_buf), 'D'); if (unlikely(__pyx_t_8 == ((int32_t)-1))) __PYX_ERR(15, 518, __pyx_L1_error) __pyx_t_2 = (__pyx_t_8 != 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(15, 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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "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 = __pyx_mstate_global->__pyx_kp_u_parse_data_msgs_result_is_not_a; __Pyx_INCREF(__pyx_t_9); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_self->result}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 524, __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, 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) */ __pyx_t_1 = __pyx_v_self->result; __Pyx_INCREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(15, 528, __pyx_L1_error) __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_8 = __pyx_v_take_message_type(((PyObject *)__pyx_v_buf), 'D'); if (unlikely(__pyx_t_8 == ((int32_t)-1))) __PYX_ERR(15, 529, __pyx_L1_error) __pyx_t_2 = (__pyx_t_8 != 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(15, 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(15, 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(15, 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(15, 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(15, 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_6); __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", 0); /* "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(15, 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(15, 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_msg_parameter_status", 0); /* "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(15, 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_v_name; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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(15, 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_v_val; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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(15, 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_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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_msg_notification", 0); /* "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(15, 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_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(15, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->encoding}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(15, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_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(15, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->encoding}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_PyLong_From_int32_t(__pyx_v_pid); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 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(15, 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; size_t __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("_parse_msg_authentication", 0); /* "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(15, 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(15, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 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(15, 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(15, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 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(15, 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(15, 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(15, 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(15, 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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication), __pyx_mstate_global->__pyx_n_u_AUTHENTICATION_METHODS); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 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(15, 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(15, 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(15, 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(15, 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] */ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_sasl_auth_methods); if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(15, 605, __pyx_L1_error) __pyx_t_3 = (__pyx_temp != 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(15, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(15, 607, __pyx_L9_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 607, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); __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_8genexpr9__pyx_v_m; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ascii}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 606, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); } if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(15, 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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_11 = __pyx_mstate_global->__pyx_kp_u_unsupported_SASL_Authentication; __Pyx_INCREF(__pyx_t_11); /* "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_12 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__17, __pyx_v_unsupported_sasl_auth_methods); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_12}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 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(15, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } /* "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(15, 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_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 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(15, 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(15, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 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(15, 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(15, 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(15, 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_t_9 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_9); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_could_not_verify_server_signatur}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(15, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_duplicate_GSSAPI_SSPI_authentica}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_mstate_global->__pyx_n_u_gsslib); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_gssapi, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(15, 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(15, 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(15, 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(15, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 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(15, 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(15, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 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_t_8 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_12 = __pyx_mstate_global->__pyx_kp_u_unsupported_authentication_metho; __Pyx_INCREF(__pyx_t_12); __pyx_t_13 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_AUTH_METHOD_NAME); if (unlikely(!__pyx_t_14)) __PYX_ERR(15, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_15)) __PYX_ERR(15, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = __Pyx_PyLong_From_int32_t(__pyx_v_status); if (unlikely(!__pyx_t_14)) __PYX_ERR(15, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = __Pyx_PyLong_From_int32_t(__pyx_v_status); if (unlikely(!__pyx_t_16)) __PYX_ERR(15, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15); assert(__pyx_t_13); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_15, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_14, __pyx_t_16}; __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_11}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_8); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } /* "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(15, 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_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.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; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_password_message_cleartext", 0); /* "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(15, 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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 672, __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(15, 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(15, 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(15, 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; PyObject *__pyx_t_8 = NULL; size_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_password_message_md5", 0); /* "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(15, 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_mstate_global->__pyx_n_u_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 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(15, 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_mstate_global->__pyx_kp_u__15); __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__15; __pyx_L3_bool_binop_done:; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_user); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 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(15, 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_mstate_global->__pyx_kp_u__15); __pyx_t_2 = __pyx_mstate_global->__pyx_kp_u__15; __pyx_L5_bool_binop_done:; __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_hashlib); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_md5); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __pyx_v_userpass; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_self->encoding}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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_1)) __PYX_ERR(15, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hexdigest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __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_t_7 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_hashlib); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_md5); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __pyx_v_md5_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ascii}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_v_salt); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hexdigest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __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_2 = __pyx_v_md5_2; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ascii}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_2 = PyNumber_Add(__pyx_mstate_global->__pyx_n_b_md5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(15, 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_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 688, __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/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(15, 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_XDECREF(__pyx_t_8); __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; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_password_message_sasl_initial", 0); /* "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') */ __pyx_t_2 = NULL; if (unlikely(__pyx_v_sasl_auth_methods == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(15, 698, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_sasl_auth_methods, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 698, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); } __Pyx_GIVEREF((PyObject *)__pyx_t_1); __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_1); __pyx_t_1 = 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_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 700, __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":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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_user); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(15, 701, __pyx_L1_error) if (!__pyx_t_5) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(15, 701, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__15); __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__15; __pyx_L3_bool_binop_done:; __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message(__pyx_v_self->scram, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 701, __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(15, 701, __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_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 701, __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":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_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(15, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_XDECREF(__pyx_t_3); __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; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_password_message_sasl_continue", 0); /* "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(15, 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(15, 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_mstate_global->__pyx_n_u_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 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(15, 715, __pyx_L1_error) if (!__pyx_t_3) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(15, 715, __pyx_L1_error) __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__15); __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__15; __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(15, 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() * */ __pyx_t_2 = __pyx_v_client_final_message; __Pyx_INCREF(__pyx_t_2); if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(15, 716, __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_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 716, __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":717 * self.password or '') * msg.write_bytes(client_final_message) * 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(15, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_XDECREF(__pyx_t_4); __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; 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; size_t __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); PyObject *__pyx_t_15[3]; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_gss_init_gssapi", 0); /* "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_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gssapi, 0, 0, NULL, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 723, __pyx_L3_error) __pyx_t_4 = __pyx_t_5; __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_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ModuleNotFoundError)))); if (__pyx_t_6) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_init_gssapi", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(15, 724, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /* "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_t_10 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 725, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 725, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_13 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_gssapi_module_not_found_please_i}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(15, 725, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); } /* "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_9, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(15, 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_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_get_service(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { PyObject* sequence = __pyx_t_8; 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(15, 730, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 730, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 730, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); } #else __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < (0)) __PYX_ERR(15, 730, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(15, 730, __pyx_L1_error) __pyx_L12_unpacking_done:; } __pyx_v_service_name = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_host = __pyx_t_4; __pyx_t_4 = 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_v_gssapi; __Pyx_INCREF(__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_9 = __pyx_v_gssapi; __Pyx_INCREF(__pyx_t_9); /* "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_12 = __Pyx_PyObject_FormatSimple(__pyx_v_service_name, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_host, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_15[0] = __pyx_t_12; __pyx_t_15[1] = __pyx_mstate_global->__pyx_kp_u__18; __pyx_t_15[2] = __pyx_t_10; __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_15, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_gssapi, __pyx_mstate_global->__pyx_n_u_NameType); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_hostbased_service); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_13 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_Name, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_13 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_4, NULL}; __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_name, __pyx_t_7, __pyx_t_12, __pyx_callargs+1, 0) < (0)) __PYX_ERR(15, 731, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_usage, __pyx_mstate_global->__pyx_n_u_initiate, __pyx_t_12, __pyx_callargs+1, 1) < (0)) __PYX_ERR(15, 731, __pyx_L1_error) __pyx_t_8 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_SecurityContext, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } /* "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_GIVEREF(__pyx_t_8); __Pyx_GOTREF(__pyx_v_self->gss_ctx); __Pyx_DECREF(__pyx_v_self->gss_ctx); __pyx_v_self->gss_ctx = __pyx_t_8; __pyx_t_8 = 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_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_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; 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; size_t __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); PyObject *__pyx_t_15[3]; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_gss_init_sspi", 0); /* "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_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sspilib, 0, 0, NULL, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 738, __pyx_L3_error) __pyx_t_4 = __pyx_t_5; __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_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ModuleNotFoundError)))); if (__pyx_t_6) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_init_sspi", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(15, 739, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /* "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_t_10 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 740, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 740, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_13 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_sspilib_module_not_found_please}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(15, 740, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); } /* "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_9, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(15, 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_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_get_service(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { PyObject* sequence = __pyx_t_8; 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(15, 745, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 745, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 745, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); } #else __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < (0)) __PYX_ERR(15, 745, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(15, 745, __pyx_L1_error) __pyx_L12_unpacking_done:; } __pyx_v_service_name = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_host = __pyx_t_4; __pyx_t_4 = 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_v_sspilib; __Pyx_INCREF(__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_7 = __Pyx_PyObject_FormatSimple(__pyx_v_service_name, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_host, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_15[0] = __pyx_t_7; __pyx_t_15[1] = __pyx_mstate_global->__pyx_kp_u__19; __pyx_t_15[2] = __pyx_t_9; __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_15, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_v_sspilib; __Pyx_INCREF(__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): */ if (__pyx_v_negotiate) { __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Negotiate); __pyx_t_10 = __pyx_mstate_global->__pyx_n_u_Negotiate; } else { __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Kerberos); __pyx_t_10 = __pyx_mstate_global->__pyx_n_u_Kerberos; } __pyx_t_13 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, NULL}; __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_protocol, __pyx_t_10, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(15, 748, __pyx_L1_error) __pyx_t_9 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_UserCredential, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_13 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_4, NULL}; __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_target_name, __pyx_t_12, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(15, 746, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_credential, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(15, 746, __pyx_L1_error) __pyx_t_8 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_ClientSecurityContext, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } /* "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_GIVEREF(__pyx_t_8); __Pyx_GOTREF(__pyx_v_self->gss_ctx); __Pyx_DECREF(__pyx_v_self->gss_ctx); __pyx_v_self->gss_ctx = __pyx_t_8; __pyx_t_8 = 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_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_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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_gss_get_service", 0); /* "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_mstate_global->__pyx_n_u_krbsrvname); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 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(15, 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_mstate_global->__pyx_n_u_postgres); __pyx_t_1 = __pyx_mstate_global->__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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_GSSAPI_SSPI_authentication_is_on}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 754, __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, 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_service_name); __Pyx_GIVEREF(__pyx_v_service_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_service_name) != (0)) __PYX_ERR(15, 758, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(15, 758, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 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_XDECREF(__pyx_t_5); __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; size_t __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_gss_step", 0); /* "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_v_self->gss_ctx; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_server_response}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_step, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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_4 = __Pyx_PyObject_IsTrue(__pyx_v_token); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(15, 765, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { /* "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(15, 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() * */ __pyx_t_1 = __pyx_v_token; __Pyx_INCREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(15, 769, __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(15, 769, __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":770 * msg = WriteBuffer.new_message(b'p') * msg.write_bytes(token) * 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(15, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_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", 0); /* "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(15, 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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_msg_error_response", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyUnicode_FromOrdinal(__pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely((PyDict_SetItem(__pyx_v_parsed, __pyx_t_4, __pyx_t_1) < 0))) __PYX_ERR(15, 799, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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(15, 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_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", 0); /* "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(15, 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(15, 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(15, 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; __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ( 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(15, 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(15, 812, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __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:; __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", 0); /* "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; PyObject *__pyx_t_4 = NULL; size_t __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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_set_state", 0); /* "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_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_cannot_switch_to_idle_state_prot}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 831, __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, 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_6 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE); if (__pyx_t_6) { /* "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_7 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT); if (__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; 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_7 = (__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA); __pyx_t_6 = __pyx_t_7; __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_6) { /* "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_7 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA); if (__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; 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_7 = (__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE); __pyx_t_6 = __pyx_t_7; __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_6) { /* "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_7 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN); if (__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; 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_7 = (__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA); __pyx_t_6 = __pyx_t_7; __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_6)) { /* "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_6 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED); if (unlikely(__pyx_t_6)) { /* "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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_8 = __pyx_mstate_global->__pyx_kp_u_cannot_switch_to_state_protocol; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_new_state); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 865, __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, 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_9 = __pyx_mstate_global->__pyx_kp_u_cannot_switch_to_state_another_o; __Pyx_INCREF(__pyx_t_9); /* "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_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_new_state); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->state); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 869, __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, 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_4); __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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ensure_connected", 0); /* "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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_not_connected}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 876, __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(15, 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_XDECREF(__pyx_t_5); __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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; 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", 0); /* "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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_already_connected}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 931, __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(15, 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(15, 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_5 = NULL; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 937, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__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(15, 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(15, 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_mstate_global->__pyx_n_b_client_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 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_5 = __pyx_mstate_global->__pyx_kp_u__20; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_self->encoding}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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_bytestring(__pyx_v_buf, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_mstate_global->__pyx_n_u_user, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_mstate_global->__pyx_n_u_user); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(15, 947, __pyx_L1_error) __pyx_t_2 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_5), ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_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_mstate_global->__pyx_n_u_database, ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 949, __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":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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_mstate_global->__pyx_n_u_database); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(15, 950, __pyx_L1_error) __pyx_t_3 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = ((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_5)) __PYX_ERR(15, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_mstate_global->__pyx_n_u_server_settings); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = (__pyx_t_5 != Py_None); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_mstate_global->__pyx_n_u_server_settings); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 953, __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'", "items"); __PYX_ERR(15, 953, __pyx_L1_error) } __pyx_t_2 = __Pyx_dict_iterator(__pyx_t_3, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_8, &__pyx_t_7, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(15, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3); __pyx_t_3 = 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) * */ __pyx_t_3 = __pyx_v_k; __Pyx_INCREF(__pyx_t_3); if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(15, 954, __pyx_L1_error) __pyx_t_2 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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'') */ __pyx_t_4 = __pyx_v_v; __Pyx_INCREF(__pyx_t_4); if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(15, 955, __pyx_L1_error) __pyx_t_2 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytestring(__pyx_v_buf, __pyx_mstate_global->__pyx_kp_b__15); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":960 * * # Send the buffer * outbuf = WriteBuffer() # <<<<<<<<<<<<<< * outbuf.write_int32(buf.len() + 4) * outbuf.write_buffer(buf) */ __pyx_t_3 = NULL; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 960, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_5); } __pyx_v_outbuf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_5); __pyx_t_5 = 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_5 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyLong_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(15, 961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_outbuf->__pyx_vtab)->write_int32(__pyx_v_outbuf, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":962 * outbuf = WriteBuffer() * outbuf.write_int32(buf.len() + 4) * outbuf.write_buffer(buf) # <<<<<<<<<<<<<< * self._write(outbuf) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_outbuf->__pyx_vtab)->write_buffer(__pyx_v_outbuf, __pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_outbuf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_5); __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", 0); /* "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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FLUSH_MESSAGE); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(15, 989, __pyx_L1_error) __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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1006, __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(15, 1006, __pyx_L1_error) __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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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", 0); 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(15, 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_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1042, __pyx_L1_error) __Pyx_GOTREF(__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(15, 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(15, 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->__pyx_new()); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 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(15, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_mstate_global->__pyx_int_32768, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 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(15, 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(15, 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(((PyObject *)(((PyTypeObject*)PyExc_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(15, 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(15, 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_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 1063, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_10); if (!(likely(PyBytes_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_10))) __PYX_ERR(15, 1063, __pyx_L10_except_error) __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(15, 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(15, 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(15, 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(15, 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)))); 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(15, 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(15, 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; __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ( 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; } __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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); 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(15, 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(15, 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(15, 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_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1103, __pyx_L1_error) __Pyx_GOTREF(__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(15, 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_mstate_global->__pyx_kp_u__15, __pyx_mstate_global->__pyx_n_u_ROLLBACK)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 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(15, 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_mstate_global->__pyx_kp_u__15, __pyx_mstate_global->__pyx_kp_u__15, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 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(15, 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_mstate_global->__pyx_kp_u__15, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 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(15, 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_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1116, __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(15, 1116, __pyx_L1_error) __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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1129, __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(15, 1129, __pyx_L1_error) __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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1143, __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(15, 1143, __pyx_L1_error) __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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(15, 1163, __pyx_L1_error) __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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "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(15, 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(15, 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(15, 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(15, 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(15, 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", 0); /* "asyncpg/protocol/coreproto.pyx":1208 * * cdef _write(self, buf): * raise NotImplementedError # <<<<<<<<<<<<<< * * cdef _writelines(self, list buffers): */ __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0); __PYX_ERR(15, 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", 0); /* "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(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0); __PYX_ERR(15, 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", 0); /* 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", 0); /* 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", 0); /* 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", 0); /* 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", 0); /* 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", 0); /* 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__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyLong_From_int32_t(__pyx_v_self->backend_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 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__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyLong_From_int32_t(__pyx_v_self->backend_secret); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0); /* "(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 and _dict: */ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_discard_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyLong_From_int32_t(__pyx_v_self->backend_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyLong_From_int32_t(__pyx_v_self->backend_secret); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_v_self->con_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 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(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_v_self->result_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->state); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_v_self->xact_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(23); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_2) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_3) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_4) != (0)) __PYX_ERR(9, 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)) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 10, __pyx_t_5) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 14, __pyx_t_6) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 18, __pyx_t_7) != (0)) __PYX_ERR(9, 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)) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 20, __pyx_t_8) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 22, __pyx_t_9) != (0)) __PYX_ERR(9, 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 and _dict: * state += (_dict,) */ __pyx_t_10 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 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 and _dict: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_12 = (__pyx_v__dict != Py_None); if (__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(9, 7, __pyx_L1_error) __pyx_t_11 = __pyx_t_12; __pyx_L4_bool_binop_done:; if (__pyx_t_11) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None and _dict: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 8, __pyx_L1_error); __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 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 and _dict: * 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 and _dict: # <<<<<<<<<<<<<< * 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_11 = __Pyx_PyObject_IsTrue(__pyx_mstate_global->__pyx_tuple[1]); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 11, __pyx_L1_error) __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_mstate_global->__pyx_n_u_pyx_unpickle_CoreProtocol); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 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)))) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_175807176); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_175807176); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_int_175807176) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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_mstate_global->__pyx_n_u_pyx_unpickle_CoreProtocol); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 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)))) != (0)) __PYX_ERR(9, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_175807176); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_175807176); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_int_175807176) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 15, __pyx_L1_error); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(9, 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 16, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 16, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 16, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error) } __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(9, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(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) # <<<<<<<<<<<<<< */ __pyx_t_1 = __pyx_v___pyx_state; __Pyx_INCREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(9, 17, __pyx_L1_error) if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'"); __PYX_ERR(9, 17, __pyx_L1_error) } __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 17, __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; /* "(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_XDECREF(__pyx_t_2); __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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_query,&__pyx_mstate_global->__pyx_n_u_protocol,&__pyx_mstate_global->__pyx_n_u_record_class,&__pyx_mstate_global->__pyx_n_u_ignore_custom_codec,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(17, 14, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(17, 14, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(17, 14, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(17, 14, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(17, 14, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(17, 14, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(17, 14, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, i); __PYX_ERR(17, 14, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(17, 14, __pyx_L3_error) values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(17, 14, __pyx_L3_error) values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(17, 14, __pyx_L3_error) values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(17, 14, __pyx_L3_error) values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(17, 14, __pyx_L3_error) } __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(17, 20, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, __pyx_nargs); __PYX_ERR(17, 14, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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(17, 16, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(17, 17, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_protocol), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, 1, "protocol", 0))) __PYX_ERR(17, 18, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_record_class), (&PyType_Type), 1, "record_class", 1))) __PYX_ERR(17, 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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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__", 0); /* "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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_get_parameters", __pyx_kwds); 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; size_t __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_parameters", 0); /* "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(17, 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(17, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 39, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 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(17, 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_t_6 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_9 = __pyx_mstate_global->__pyx_kp_u_missing_codec_information_for_OI; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_oid}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 42, __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(17, 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_t_8 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_apg_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Type); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 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_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_8); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_oid, __pyx_v_codec->name, __pyx_v_codec->kind, __pyx_v_codec->schema}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (5-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(17, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } /* "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(17, 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(17, 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_get_attributes", __pyx_kwds); 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; size_t __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_attributes", 0); /* "asyncpg/protocol/prepared_stmt.pyx":52 * cdef Codec codec * * if not self.row_desc: # <<<<<<<<<<<<<< * return () * */ if (__pyx_v_self->row_desc == Py_None) __pyx_t_1 = 0; else { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_self->row_desc); if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(17, 52, __pyx_L1_error) __pyx_t_1 = (__pyx_temp != 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_mstate_global->__pyx_empty_tuple); __pyx_r = __pyx_mstate_global->__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(17, 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(17, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 56, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 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_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_6 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 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(17, 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_t_7 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_9)) __PYX_ERR(17, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_10 = __pyx_mstate_global->__pyx_kp_u_missing_codec_information_for_OI; __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_oid}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 62, __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(17, 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_9 = __pyx_v_name; __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_self->settings->_encoding}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __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_t_9 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_apg_types); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Attribute); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 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_t_10 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_apg_types); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_Type); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_13, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_10, __pyx_v_oid, __pyx_v_codec->name, __pyx_v_codec->kind, __pyx_v_codec->schema}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_11, (5-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_9); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_name, __pyx_t_8}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } /* "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_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(17, 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(17, 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_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_init_types", __pyx_kwds); 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", 0); /* "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(17, 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) */ if (__pyx_v_self->parameters_desc == Py_None) __pyx_t_2 = 0; else { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_self->parameters_desc); if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(17, 78, __pyx_L1_error) __pyx_t_2 = (__pyx_temp != 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(17, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 79, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_PyLong_As_uint32_t(__pyx_v_p_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 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(17, 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(17, 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(17, 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(17, 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])) */ if (__pyx_v_self->row_desc == Py_None) __pyx_t_2 = 0; else { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_self->row_desc); if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(17, 84, __pyx_L1_error) __pyx_t_2 = (__pyx_temp != 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(17, 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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 85, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 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(17, 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(17, 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(17, 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 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(17, 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", 0); /* "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(17, 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(17, 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_init_codecs", __pyx_kwds); 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", 0); __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(17, 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("attach", __pyx_kwds); 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", 0); /* "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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("detach", __pyx_kwds); 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", 0); /* "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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("mark_closed", __pyx_kwds); 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", 0); /* "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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("mark_unprepared", __pyx_kwds); 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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mark_unprepared", 0); /* "asyncpg/protocol/prepared_stmt.pyx":106 * * def mark_unprepared(self): * if self.name: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * "named prepared statements cannot be marked unprepared") */ if (__pyx_v_self->name == Py_None) __pyx_t_1 = 0; else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_self->name); if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(17, 106, __pyx_L1_error) __pyx_t_1 = (__pyx_temp != 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_named_prepared_statements_cannot}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 107, __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(17, 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_XDECREF(__pyx_t_5); __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; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8[4]; size_t __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int16_t __pyx_t_15; int16_t __pyx_t_16; int __pyx_t_17; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_t_21; int __pyx_t_22; char const *__pyx_t_23; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; PyObject *__pyx_t_28 = NULL; PyObject *__pyx_t_29 = NULL; PyObject *__pyx_t_30[7]; char const *__pyx_t_31; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_encode_bind_msg", 0); 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DataError); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "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_4 = __Pyx_PyUnicode_From_int(__pyx_v_seqno, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_args)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_invalid_input_in_executemany_arg; __pyx_t_8[1] = __pyx_t_4; __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_expected_a_sequence_got; __pyx_t_8[3] = __pyx_t_7; /* "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_6 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 58 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 27 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(17, 119, __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(17, 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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_args)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Bind_expected_a_sequence_got, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 127, __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(17, 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_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(17, 130, __pyx_L1_error) __pyx_t_1 = (__pyx_t_10 > 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_the_number_of_query_arguments_ca}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 131, __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(17, 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->__pyx_new()); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 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_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(17, 136, __pyx_L1_error) __pyx_v_num_args_passed = __pyx_t_10; /* "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_mstate_global->__pyx_kp_u_Check_the_query_against_the_pass); __pyx_v_hint = __pyx_mstate_global->__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_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_v_hint, __pyx_mstate_global->__pyx_kp_u_Note_that_parameters_are_suppor); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __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_7 = __pyx_mstate_global->__pyx_kp_u_the_server_expects_x_argument_s; __Pyx_INCREF(__pyx_t_7); /* "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_4 = __Pyx_PyLong_From_int16_t(__pyx_v_self->args_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = (__pyx_v_self->args_num != 1); if (__pyx_t_1) { __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_s_2); __pyx_t_11 = __pyx_mstate_global->__pyx_n_u_s_2; } else { __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__15); __pyx_t_11 = __pyx_mstate_global->__pyx_kp_u__15; } /* "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_12 = PyLong_FromSsize_t(__pyx_v_num_args_passed); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* "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_mstate_global->__pyx_n_u_was); __pyx_t_13 = __pyx_mstate_global->__pyx_n_u_was; } else { __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_were); __pyx_t_13 = __pyx_mstate_global->__pyx_n_u_were; } __pyx_t_9 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_7, NULL}; __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(17, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_x, __pyx_t_4, __pyx_t_14, __pyx_callargs+1, 0) < (0)) __PYX_ERR(17, 151, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_s_2, __pyx_t_11, __pyx_t_14, __pyx_callargs+1, 1) < (0)) __PYX_ERR(17, 151, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_y, __pyx_t_12, __pyx_t_14, __pyx_callargs+1, 2) < (0)) __PYX_ERR(17, 151, __pyx_L1_error) if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_w, __pyx_t_13, __pyx_t_14, __pyx_callargs+1, 3) < (0)) __PYX_ERR(17, 151, __pyx_L1_error) __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } /* "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_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_3}; __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(17, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_hint, __pyx_v_hint, __pyx_t_14, __pyx_callargs+2, 0) < (0)) __PYX_ERR(17, 149, __pyx_L1_error) __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 149, __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(17, 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(17, 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_15 = __pyx_v_self->args_num; __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_idx = __pyx_t_17; /* "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(17, 160, __pyx_L1_error) } __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->args_codecs, __pyx_v_idx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_6)); __pyx_t_6 = 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_6 = ((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_6)) __PYX_ERR(17, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_6 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int32(__pyx_v_writer, 0x00010001); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_6 = ((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_6)) __PYX_ERR(17, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_15 = __pyx_v_self->args_num; __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_idx = __pyx_t_17; /* "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_6 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_idx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_6); __pyx_t_6 = 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_6 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int32(__pyx_v_writer, -1); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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(17, 173, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_self->args_codecs, __pyx_v_idx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); /*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_6 = __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_6)) __PYX_ERR(17, 175, __pyx_L14_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/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_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L21_try_end; __pyx_L14_error:; __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_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/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_6, &__pyx_t_2, &__pyx_t_14); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 176, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 176, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_21 = __Pyx_PyErr_GivenExceptionMatches2(__pyx_t_6, ((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_ErrRestore(__pyx_t_6, __pyx_t_2, __pyx_t_14); __pyx_t_6 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; if (__pyx_t_21) { __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_2, &__pyx_t_6) < 0) __PYX_ERR(17, 176, __pyx_L16_except_error) __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_6); /* "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_14); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_2, __pyx_t_6); __pyx_t_14 = 0; __pyx_t_2 = 0; __pyx_t_6 = 0; __PYX_ERR(17, 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_6, &__pyx_t_2, &__pyx_t_14); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 179, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 179, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_21 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_6, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_ErrRestore(__pyx_t_6, __pyx_t_2, __pyx_t_14); __pyx_t_6 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; if (__pyx_t_21) { __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_2, &__pyx_t_6) < 0) __PYX_ERR(17, 179, __pyx_L16_except_error) __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_6); __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_3 = __Pyx_PyUnicode_From_long((__pyx_v_idx + 1), 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 182, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u__21, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 182, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_pos = ((PyObject*)__pyx_t_5); __pyx_t_5 = 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_5 = __Pyx_PyUnicode_From_int(__pyx_v_seqno, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 185, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8[0] = __pyx_v_pos; __pyx_t_8[1] = __pyx_mstate_global->__pyx_kp_u_in_element; __pyx_t_8[2] = __pyx_t_5; __pyx_t_8[3] = __pyx_mstate_global->__pyx_kp_u_of_executemany_sequence; __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 26, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos)); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 185, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_pos, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 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_5 = __pyx_v_e; __Pyx_INCREF(__pyx_t_5); /* "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_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 189, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 189, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_12, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 189, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_query_argument; __pyx_t_8[1] = __pyx_v_pos; __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u__22; __pyx_t_8[3] = __pyx_t_13; __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13)); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 189, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_12}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_msg, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 188, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_3); } /* "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_3, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(17, 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_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 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_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_7); __pyx_t_7 = 0; __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29); if ( unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_28); __Pyx_XGOTREF(__pyx_t_29); __pyx_t_21 = __pyx_lineno; __pyx_t_22 = __pyx_clineno; __pyx_t_23 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_29); __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26); __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0; __pyx_lineno = __pyx_t_21; __pyx_clineno = __pyx_t_22; __pyx_filename = __pyx_t_23; 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_22 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_22) { __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_14) < 0) __PYX_ERR(17, 191, __pyx_L16_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_14); __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_3 = __Pyx_PyUnicode_From_long((__pyx_v_idx + 1), 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 194, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u__21, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 194, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_pos = ((PyObject*)__pyx_t_12); __pyx_t_12 = 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_12 = __Pyx_PyUnicode_From_int(__pyx_v_seqno, 0, ' ', 'd'); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 197, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_8[0] = __pyx_v_pos; __pyx_t_8[1] = __pyx_mstate_global->__pyx_kp_u_in_element; __pyx_t_8[2] = __pyx_t_12; __pyx_t_8[3] = __pyx_mstate_global->__pyx_kp_u_of_executemany_sequence; __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 26, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos)); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 197, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF_SET(__pyx_v_pos, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 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_3 = PyObject_Repr(__pyx_v_arg); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 200, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_value_repr = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":201 * ) * value_repr = repr(arg) * if len(value_repr) > 40: # <<<<<<<<<<<<<< * value_repr = value_repr[:40] + '...' * */ if (unlikely(__pyx_v_value_repr == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(17, 201, __pyx_L41_error) } __pyx_t_10 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_value_repr); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(17, 201, __pyx_L41_error) __pyx_t_1 = (__pyx_t_10 > 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( */ if (unlikely(__pyx_v_value_repr == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(17, 202, __pyx_L41_error) } __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_value_repr, 0, 40); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 202, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__23); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 202, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_value_repr, ((PyObject*)__pyx_t_12)); __pyx_t_12 = 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 204, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DataError); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 204, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":206 * raise exceptions.DataError( * f'invalid input for query argument' * f' {pos}: {value_repr} ({e})' # <<<<<<<<<<<<<< * ) from e * */ __pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_v_value_repr); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 206, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(17, 206, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_30[0] = __pyx_mstate_global->__pyx_kp_u_invalid_input_for_query_argument; __pyx_t_30[1] = __pyx_v_pos; __pyx_t_30[2] = __pyx_mstate_global->__pyx_kp_u__22; __pyx_t_30[3] = __pyx_t_5; __pyx_t_30[4] = __pyx_mstate_global->__pyx_kp_u__24; __pyx_t_30[5] = __pyx_t_11; __pyx_t_30[6] = __pyx_mstate_global->__pyx_kp_u__6; /* "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 = __Pyx_PyUnicode_Join(__pyx_t_30, 7, 33 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos) + 2 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 205, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_13, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 204, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_12); } /* "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_12, 0, 0, __pyx_v_e); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __PYX_ERR(17, 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_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 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_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_7); __pyx_t_7 = 0; __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24); if ( unlikely(__Pyx_GetException(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27) < 0)) __Pyx_ErrFetch(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27); __Pyx_XGOTREF(__pyx_t_29); __Pyx_XGOTREF(__pyx_t_28); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_22 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_31 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24); __Pyx_XGIVEREF(__pyx_t_29); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ErrRestore(__pyx_t_29, __pyx_t_28, __pyx_t_27); __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_22; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_31; 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_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); 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_14 = ((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_14)) __PYX_ERR(17, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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_15 = __pyx_v_self->cols_num; __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_idx = __pyx_t_17; /* "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(17, 212, __pyx_L1_error) } __pyx_t_14 = __Pyx_GetItemInt_Tuple(__pyx_v_self->rows_codecs, __pyx_v_idx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_14)) __PYX_ERR(17, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = __pyx_t_14; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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(17, 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(17, 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_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __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.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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int16_t __pyx_t_7; int __pyx_t_8; uint32_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ensure_rows_decoder", 0); /* "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 = RecordDescriptor({}, ()) * 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 = RecordDescriptor({}, ()) # <<<<<<<<<<<<<< * return * */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RecordDescriptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_empty_tuple}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->cols_desc); __Pyx_DECREF(__pyx_v_self->cols_desc); __pyx_v_self->cols_desc = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":234 * if self.cols_num == 0: * self.cols_desc = RecordDescriptor({}, ()) * 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 = RecordDescriptor({}, ()) * return */ } /* "asyncpg/protocol/prepared_stmt.pyx":236 * return * * cols_mapping = collections.OrderedDict() # <<<<<<<<<<<<<< * cols_names = [] * codecs = [] */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_cols_mapping = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":237 * * cols_mapping = collections.OrderedDict() * cols_names = [] # <<<<<<<<<<<<<< * codecs = [] * for i from 0 <= i < self.cols_num: */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_cols_names = ((PyObject*)__pyx_t_2); __pyx_t_2 = 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_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_codecs = ((PyObject*)__pyx_t_2); __pyx_t_2 = 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_7 = __pyx_v_self->cols_num; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __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(17, 240, __pyx_L1_error) } __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->row_desc, __pyx_v_i, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_2))) __PYX_ERR(17, 240, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 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(17, 241, __pyx_L1_error) } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_row, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->settings->_encoding}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(17, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_col_name, __pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_PyLong_From_long(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_v_cols_mapping, __pyx_v_col_name, __pyx_t_2) < 0))) __PYX_ERR(17, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_8 = __Pyx_PyList_Append(__pyx_v_cols_names, __pyx_v_col_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(17, 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(17, 244, __pyx_L1_error) } __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_row, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyLong_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_9 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_oid = __pyx_t_9; /* "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 = ((PyObject *)__pyx_v_self->settings); __Pyx_INCREF(__pyx_t_4); /* "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_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->ignore_custom_codec); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_3}; __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_custom_codec, __pyx_t_5, __pyx_t_10, __pyx_callargs+2, 0) < (0)) __PYX_ERR(17, 245, __pyx_L1_error) __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_get_data_codec, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 245, __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(): */ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(17, 245, __pyx_L1_error) __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":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_11 = (((PyObject *)__pyx_v_codec) == Py_None); if (!__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L8_bool_binop_done; } __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_codec); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(17, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = (!__pyx_t_11); __pyx_t_1 = __pyx_t_12; __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_t_10 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_4 = __pyx_mstate_global->__pyx_kp_u_no_decoder_for_OID; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_13}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 248, __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(17, 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_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary(__pyx_v_codec); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(17, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = (!__pyx_t_1); if (__pyx_t_12) { /* "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 = RecordDescriptor( */ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_codecs, ((PyObject *)__pyx_v_codec)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(17, 253, __pyx_L1_error) } /* "asyncpg/protocol/prepared_stmt.pyx":255 * codecs.append(codec) * * self.cols_desc = RecordDescriptor( # <<<<<<<<<<<<<< * cols_mapping, tuple(cols_names)) * */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RecordDescriptor); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "asyncpg/protocol/prepared_stmt.pyx":256 * * self.cols_desc = RecordDescriptor( * cols_mapping, tuple(cols_names)) # <<<<<<<<<<<<<< * * self.rows_codecs = tuple(codecs) */ __pyx_t_10 = PyList_AsTuple(__pyx_v_cols_names); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_cols_mapping, __pyx_t_10}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } /* "asyncpg/protocol/prepared_stmt.pyx":255 * codecs.append(codec) * * self.cols_desc = RecordDescriptor( # <<<<<<<<<<<<<< * cols_mapping, tuple(cols_names)) * */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->cols_desc); __Pyx_DECREF(__pyx_v_self->cols_desc); __pyx_v_self->cols_desc = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":258 * cols_mapping, tuple(cols_names)) * * self.rows_codecs = tuple(codecs) # <<<<<<<<<<<<<< * * cdef _ensure_args_encoder(self): */ __pyx_t_2 = PyList_AsTuple(__pyx_v_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->rows_codecs); __Pyx_DECREF(__pyx_v_self->rows_codecs); __pyx_v_self->rows_codecs = ((PyObject*)__pyx_t_2); __pyx_t_2 = 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_5); __Pyx_XDECREF(__pyx_t_10); __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; size_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ensure_args_encoder", 0); /* "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(17, 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(17, 270, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->parameters_desc, __pyx_v_i, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 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_6 = ((PyObject *)__pyx_v_self->settings); __Pyx_INCREF(__pyx_t_6); /* "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_7 = __Pyx_PyLong_From_uint32_t(__pyx_v_p_oid); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_self->ignore_custom_codec); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_7}; __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_custom_codec, __pyx_t_8, __pyx_t_10, __pyx_callargs+2, 0) < (0)) __PYX_ERR(17, 271, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_get_data_codec, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10); __Pyx_XDECREF(__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_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } /* "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(): */ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(17, 271, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1)); __pyx_t_1 = 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 273, __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(17, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = (!__pyx_t_3); __pyx_t_2 = __pyx_t_11; __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_t_10 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_6 = __pyx_mstate_global->__pyx_kp_u_no_encoder_for_OID; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyLong_From_uint32_t(__pyx_v_p_oid); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_12}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 274, __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(17, 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_1 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(__pyx_v_codec->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_t_7, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(17, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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(17, 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(17, 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_12); __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", 0); /* "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(17, 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(17, 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(17, 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(17, 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", 0); /* "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(17, 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(17, 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(17, 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(17, 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; size_t __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", 0); /* "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(17, 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 == ((void *)NULL))) __PYX_ERR(17, 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_7 = __pyx_mstate_global->__pyx_kp_u_the_number_of_columns_in_the_res; __Pyx_INCREF(__pyx_t_7); /* "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 = self.cols_desc.make_record(self.record_class, fnum) */ __pyx_t_8 = __Pyx_PyLong_From_int16_t(__pyx_v_fnum); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyLong_From_int16_t(__pyx_v_self->cols_num); if (unlikely(!__pyx_t_9)) __PYX_ERR(17, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 308, __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(17, 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 = self.cols_desc.make_record(self.record_class, fnum) # <<<<<<<<<<<<<< * for i in range(fnum): * flen = hton.unpack_int32(frb_read(&rbuf, 4)) */ __pyx_t_6 = __pyx_v_self->cols_desc; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyLong_From_int16_t(__pyx_v_fnum); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self->record_class), __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_record, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(17, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_dec_row = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":314 * * dec_row = self.cols_desc.make_record(self.record_class, 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 = self.cols_desc.make_record(self.record_class, 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 == ((void *)NULL))) __PYX_ERR(17, 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)-1L) && PyErr_Occurred())) __PYX_ERR(17, 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_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_check((&__pyx_v_rbuf), __pyx_v_flen); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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(17, 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_1 = ((PyObject *)__pyx_t_15); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1)); __pyx_t_1 = 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_codec, __pyx_v_settings, (&__pyx_v_rbuf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 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)-1L) && PyErr_Occurred())) __PYX_ERR(17, 329, __pyx_L1_error) __pyx_t_3 = (__pyx_t_14 != 0); if (unlikely(__pyx_t_3)) { /* "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 = NULL; /* "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_4 = __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_bytes_in_buf; __Pyx_INCREF(__pyx_t_4); /* "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)-1L) && PyErr_Occurred())) __PYX_ERR(17, 332, __pyx_L1_error) __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(17, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_BufferError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 330, __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(17, 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(17, 333, __pyx_L1_error) } __pyx_L6:; /* "asyncpg/protocol/prepared_stmt.pyx":335 * frb_set_len(&rbuf, bl - flen) * * cpython.Py_INCREF(val) # <<<<<<<<<<<<<< * recordcapi.ApgRecord_SET_ITEM(dec_row, i, val) * */ Py_INCREF(__pyx_v_val); /* "asyncpg/protocol/prepared_stmt.pyx":336 * * cpython.Py_INCREF(val) * recordcapi.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 * recordcapi.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)-1L) && PyErr_Occurred())) __PYX_ERR(17, 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_6 = NULL; __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_bytes_in_buf; __Pyx_INCREF(__pyx_t_9); /* "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)-1L) && PyErr_Occurred())) __PYX_ERR(17, 340, __pyx_L1_error) __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_BufferError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(17, 339, __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(17, 339, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":338 * recordcapi.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__", 0); __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__", 0); __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__", 0); __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__", 0); __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__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyLong_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__", 0); __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__", 0); __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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(9, 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 3, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 3, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 3, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error) } __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(9, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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__", 0); /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(9, 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", 0); /* "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(17, 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(17, 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(17, 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(17, 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_PyLong_From_uint32_t(__pyx_v_p_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 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(17, 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", 0); /* "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(17, 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(17, 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(17, 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(17, 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(17, 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(17, 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(17, 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(17, 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(17, 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(17, 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(17, 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_PyLong_From_uint32_t(__pyx_v_f_table_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyLong_From_int16_t(__pyx_v_f_column_num); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyLong_From_uint32_t(__pyx_v_f_dt_oid); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 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_PyLong_From_int16_t(__pyx_v_f_dt_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyLong_From_int32_t(__pyx_v_f_dt_mod); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyLong_From_int16_t(__pyx_v_f_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(17, 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(17, 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) != (0)) __PYX_ERR(17, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1) != (0)) __PYX_ERR(17, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5) != (0)) __PYX_ERR(17, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_6) != (0)) __PYX_ERR(17, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7) != (0)) __PYX_ERR(17, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_8) != (0)) __PYX_ERR(17, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_9) != (0)) __PYX_ERR(17, 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(17, 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":77 * * 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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_addr,&__pyx_mstate_global->__pyx_n_u_connected_fut,&__pyx_mstate_global->__pyx_n_u_con_params,&__pyx_mstate_global->__pyx_n_u_record_class,&__pyx_mstate_global->__pyx_n_u_loop,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 77, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 77, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 77, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 77, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 77, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 77, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 77, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, i); __PYX_ERR(0, 77, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 77, __pyx_L3_error) values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 77, __pyx_L3_error) values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 77, __pyx_L3_error) values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 77, __pyx_L3_error) values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 77, __pyx_L3_error) } __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, 77, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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", 2))) __PYX_ERR(0, 77, __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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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; size_t __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("__init__", 0); /* "asyncpg/protocol/protocol.pyx":79 * 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 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_addr, __pyx_v_con_params}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":81 * 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":82 * * 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":83 * 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":84 * 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":85 * 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":87 * self.cancel_sent_waiter = None * * self.settings = ConnectionSettings((addr, con_params.database)) # <<<<<<<<<<<<<< * self.record_class = record_class * */ __pyx_t_2 = NULL; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_con_params, __pyx_mstate_global->__pyx_n_u_database); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_addr) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 87, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); } __Pyx_GIVEREF((PyObject *)__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":88 * * 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":90 * 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":91 * * self.statement = None * self.return_extra = False # <<<<<<<<<<<<<< * * self.last_query = None */ __pyx_v_self->return_extra = 0; /* "asyncpg/protocol/protocol.pyx":93 * 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":95 * 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":96 * * 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":97 * self.closing = False * self.is_reading = True * self.writing_allowed = asyncio.Event() # <<<<<<<<<<<<<< * self.writing_allowed.set() * */ __pyx_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Event); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_3 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed, __pyx_t_1) < (0)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":98 * self.is_reading = True * self.writing_allowed = asyncio.Event() * self.writing_allowed.set() # <<<<<<<<<<<<<< * * self.timeout_handle = None */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":100 * 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":102 * self.timeout_handle = None * * self.queries_count = 0 # <<<<<<<<<<<<<< * * self._is_ssl = False */ __pyx_v_self->queries_count = 0; /* "asyncpg/protocol/protocol.pyx":104 * self.queries_count = 0 * * self._is_ssl = False # <<<<<<<<<<<<<< * * try: */ __pyx_v_self->_is_ssl = 0; /* "asyncpg/protocol/protocol.pyx":106 * self._is_ssl = False * * try: # <<<<<<<<<<<<<< * self.create_future = loop.create_future * except AttributeError: */ { __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/protocol.pyx":107 * * 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_mstate_global->__pyx_n_u_create_future); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __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":106 * self._is_ssl = False * * try: # <<<<<<<<<<<<<< * self.create_future = loop.create_future * except AttributeError: */ } __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_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_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":108 * try: * self.create_future = loop.create_future * except AttributeError: # <<<<<<<<<<<<<< * self.create_future = self._create_future_fallback * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_AttributeError)))); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 108, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); /* "asyncpg/protocol/protocol.pyx":109 * self.create_future = loop.create_future * except AttributeError: * self.create_future = self._create_future_fallback # <<<<<<<<<<<<<< * * def set_connection(self, connection): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_create_future_fallback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->create_future); __Pyx_DECREF(__pyx_v_self->create_future); __pyx_v_self->create_future = __pyx_t_2; __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/protocol/protocol.pyx":106 * self._is_ssl = False * * try: # <<<<<<<<<<<<<< * self.create_future = loop.create_future * except AttributeError: */ __pyx_L5_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_L4_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_L8_try_end:; } /* "asyncpg/protocol/protocol.pyx":77 * * 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_4); __Pyx_XDECREF(__pyx_t_5); __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":111 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_connection,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 111, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 111, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_connection", 0) < (0)) __PYX_ERR(0, 111, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_connection", 1, 1, 1, i); __PYX_ERR(0, 111, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 111, __pyx_L3_error) } __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, 111, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_4 = NULL; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_connection", 0); /* "asyncpg/protocol/protocol.pyx":112 * * def set_connection(self, connection): * self.conref = weakref.ref(connection) # <<<<<<<<<<<<<< * * cdef get_connection(self): */ __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_weakref); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ref); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_connection}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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":111 * 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_XDECREF(__pyx_t_4); __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":114 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_connection", 0); /* "asyncpg/protocol/protocol.pyx":115 * * 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":116 * cdef get_connection(self): * if self.conref is not None: * return self.conref() # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_self->conref); __pyx_t_4 = __pyx_v_self->conref; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":115 * * cdef get_connection(self): * if self.conref is not None: # <<<<<<<<<<<<<< * return self.conref() * else: */ } /* "asyncpg/protocol/protocol.pyx":118 * 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":114 * 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":120 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_server_pid", __pyx_kwds); 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", 0); /* "asyncpg/protocol/protocol.pyx":121 * * def get_server_pid(self): * return self.backend_pid # <<<<<<<<<<<<<< * * def get_settings(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyLong_From_int32_t(__pyx_v_self->__pyx_base.backend_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":120 * 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":123 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_settings", __pyx_kwds); 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", 0); /* "asyncpg/protocol/protocol.pyx":124 * * 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":123 * 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":126 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_record_class", __pyx_kwds); 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", 0); /* "asyncpg/protocol/protocol.pyx":127 * * 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":126 * 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":129 * 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; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("resume_reading", 0); /* "asyncpg/protocol/protocol.pyx":130 * * 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":131 * 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":132 * if not self.is_reading: * self.is_reading = True * self.transport.resume_reading() # <<<<<<<<<<<<<< * * cdef inline pause_reading(self): */ __pyx_t_3 = __pyx_v_self->__pyx_base.transport; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_resume_reading, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":130 * * cdef inline resume_reading(self): * if not self.is_reading: # <<<<<<<<<<<<<< * self.is_reading = True * self.transport.resume_reading() */ } /* "asyncpg/protocol/protocol.pyx":129 * 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_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":134 * 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pause_reading", 0); /* "asyncpg/protocol/protocol.pyx":135 * * 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":136 * 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":137 * if self.is_reading: * self.is_reading = False * self.transport.pause_reading() # <<<<<<<<<<<<<< * * async def prepare(self, stmt_name, query, timeout, */ __pyx_t_2 = __pyx_v_self->__pyx_base.transport; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pause_reading, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":135 * * cdef inline pause_reading(self): * if self.is_reading: # <<<<<<<<<<<<<< * self.is_reading = False * self.transport.pause_reading() */ } /* "asyncpg/protocol/protocol.pyx":134 * 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_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":139 * self.transport.pause_reading() * * async def prepare(self, stmt_name, query, timeout, # <<<<<<<<<<<<<< * *, * PreparedStatementState state=None, */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stmt_name,&__pyx_mstate_global->__pyx_n_u_query,&__pyx_mstate_global->__pyx_n_u_timeout,&__pyx_mstate_global->__pyx_n_u_record_class,&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_ignore_custom_codec,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 139, __pyx_L3_error) if (likely(__pyx_kwds_len > 0)) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 139, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 139, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 139, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "prepare", 0) < (0)) __PYX_ERR(0, 139, __pyx_L3_error) /* "asyncpg/protocol/protocol.pyx":141 * async def prepare(self, stmt_name, query, timeout, * *, * PreparedStatementState state=None, # <<<<<<<<<<<<<< * ignore_custom_codec=False, * record_class): */ if (!values[4]) values[4] = __Pyx_NewRef((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: */ if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_False)); for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("prepare", 1, 3, 3, i); __PYX_ERR(0, 139, __pyx_L3_error) } } for (Py_ssize_t i = 3; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseKeywordRequired("prepare", *(__pyx_pyargnames[i - 0])); __PYX_ERR(0, 139, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { __Pyx_RaiseKeywordRequired("prepare", __pyx_mstate_global->__pyx_n_u_record_class); __PYX_ERR(0, 139, __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, 139, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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_mstate_global->__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":139 * self.transport.pause_reading() * * async def prepare(self, stmt_name, query, timeout, # <<<<<<<<<<<<<< * *, * PreparedStatementState state=None, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, __pyx_mstate_global->__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, 139, __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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_12generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_prepare, __pyx_mstate_global->__pyx_n_u_BaseProtocol_prepare, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 139, __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; __Pyx_PySendResult __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; size_t __pyx_t_9; int __pyx_t_10; 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("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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 139, __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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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 if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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 if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __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_3 = ((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_3)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":151 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 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_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_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3; __pyx_t_3 = 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_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/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: */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_stmt_name; __Pyx_INCREF(__pyx_t_3); if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 155, __pyx_L11_error) __pyx_t_7 = __pyx_cur_scope->__pyx_v_query; __Pyx_INCREF(__pyx_t_7); if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_7))) __PYX_ERR(0, 155, __pyx_L11_error) __pyx_t_8 = ((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_t_3), ((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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( */ __pyx_t_8 = __pyx_cur_scope->__pyx_v_query; __Pyx_INCREF(__pyx_t_8); if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 156, __pyx_L11_error) __Pyx_GIVEREF(__pyx_t_8); __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_8); __pyx_t_8 = 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_7 = NULL; /* "asyncpg/protocol/protocol.pyx":159 * if state is None: * state = PreparedStatementState( * stmt_name, query, self, record_class, ignore_custom_codec) # <<<<<<<<<<<<<< * self.statement = state * except Exception as ex: */ __pyx_t_9 = 1; { PyObject *__pyx_callargs[6] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_stmt_name, __pyx_cur_scope->__pyx_v_query, ((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_record_class, __pyx_cur_scope->__pyx_v_ignore_custom_codec}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_callargs+__pyx_t_9, (6-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 158, __pyx_L11_error) __Pyx_GOTREF((PyObject *)__pyx_t_8); } __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_8)); __Pyx_GIVEREF((PyObject *)__pyx_t_8); __pyx_t_8 = 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_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 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_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_10) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(0, 161, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_v_ex = __pyx_t_7; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":162 * self.statement = state * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_12 = __pyx_cur_scope->__pyx_v_waiter; __Pyx_INCREF(__pyx_t_12); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_11); } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":163 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_11 = ((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_11)) __PYX_ERR(0, 163, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 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_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ( 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_10 = __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; } __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_10; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L13_except_error; } __pyx_L24:; } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 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_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L9_error; __pyx_L12_exception_handled:; __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); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":165 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def bind_execute( */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_3 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 165, __pyx_L1_error) } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __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_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __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_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_3 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 165, __pyx_L31_error) } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L30_return; } __pyx_L30_return:; __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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L0; __pyx_L31_error:; __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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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":139 * self.transport.pause_reading() * * async def prepare(self, stmt_name, query, timeout, # <<<<<<<<<<<<<< * *, * PreparedStatementState state=None, */ /* function exit code */ __pyx_L1_error:; __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); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("prepare", __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_12BaseProtocol_15generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":167 * return await waiter * * async def bind_execute( # <<<<<<<<<<<<<< * self, * state: PreparedStatementState, */ /* 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(*)(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; int __pyx_v_return_extra; 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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_portal_name,&__pyx_mstate_global->__pyx_n_u_limit,&__pyx_mstate_global->__pyx_n_u_return_extra,&__pyx_mstate_global->__pyx_n_u_timeout,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 167, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 167, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 167, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 167, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 167, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 167, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 167, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bind_execute", 0) < (0)) __PYX_ERR(0, 167, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 6; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, i); __PYX_ERR(0, 167, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 167, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 167, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 167, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 167, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 167, __pyx_L3_error) values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 167, __pyx_L3_error) } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_args = values[1]; __pyx_v_portal_name = ((PyObject*)values[2]); if (__Pyx_PyInt_FromNumber(&values[3], "limit", 0) < (0)) __PYX_ERR(0, 172, __pyx_L3_error) __pyx_v_limit = ((PyObject*)values[3]); __pyx_v_return_extra = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_return_extra == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error) __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:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 0, "state", 0))) __PYX_ERR(0, 169, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 0, "portal_name", 2))) __PYX_ERR(0, 171, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_limit), (&PyLong_Type), 0, "limit", 2))) __PYX_ERR(0, 172, __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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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, int __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, __pyx_mstate_global->__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_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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_15generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_bind_execute, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind_execute, __pyx_mstate_global->__pyx_n_u_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; __Pyx_PySendResult __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; int32_t __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; size_t __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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 167, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":176 * 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":177 * ): * 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 177, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 177, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":176 * timeout, * ): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "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 * 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":179 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 179, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 179, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":180 * 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":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 * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":182 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * args_buf = state._encode_bind_msg(args) */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":183 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * args_buf = state._encode_bind_msg(args) * */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":184 * self._check_state() * timeout = self._get_timeout_impl(timeout) * args_buf = state._encode_bind_msg(args) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_args_buf = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":186 * args_buf = state._encode_bind_msg(args) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * if not state.prepared: */ __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_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":187 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * if not state.prepared: * self._send_parse_message(state.name, state.query) */ /*try:*/ { { __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/protocol.pyx":188 * 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":189 * try: * if not state.prepared: * self._send_parse_message(state.name, state.query) # <<<<<<<<<<<<<< * * self._bind_execute( */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = ((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_3), ((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/protocol.pyx":188 * waiter = self._new_waiter(timeout) * try: * if not state.prepared: # <<<<<<<<<<<<<< * self._send_parse_message(state.name, state.query) * */ } /* "asyncpg/protocol/protocol.pyx":193 * self._bind_execute( * portal_name, * state.name, # <<<<<<<<<<<<<< * args_buf, * limit) # network op */ __pyx_t_8 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_8); /* "asyncpg/protocol/protocol.pyx":194 * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(0, 194, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":195 * state.name, * args_buf, * limit) # network op # <<<<<<<<<<<<<< * * self.last_query = state.query */ __pyx_t_9 = __Pyx_PyLong_As_int32_t(__pyx_cur_scope->__pyx_v_limit); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":191 * self._send_parse_message(state.name, state.query) * * self._bind_execute( # <<<<<<<<<<<<<< * portal_name, * state.name, */ __pyx_t_7 = ((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_8), ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_args_buf), __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 191, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":197 * limit) # network op * * self.last_query = state.query # <<<<<<<<<<<<<< * self.statement = state * self.return_extra = return_extra */ __pyx_t_7 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __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_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":198 * * 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":199 * self.last_query = state.query * self.statement = state * self.return_extra = return_extra # <<<<<<<<<<<<<< * self.queries_count += 1 * except Exception as ex: */ __pyx_cur_scope->__pyx_v_self->return_extra = __pyx_cur_scope->__pyx_v_return_extra; /* "asyncpg/protocol/protocol.pyx":200 * 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":187 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * if not state.prepared: * self._send_parse_message(state.name, state.query) */ } __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; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/protocol.pyx":201 * self.return_extra = return_extra * self.queries_count += 1 * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_10) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_3) < 0) __PYX_ERR(0, 201, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_v_ex = __pyx_t_8; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":202 * self.queries_count += 1 * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_12 = __pyx_cur_scope->__pyx_v_waiter; __Pyx_INCREF(__pyx_t_12); __pyx_t_13 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 202, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_11); } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":203 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_11 = ((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_11)) __PYX_ERR(0, 203, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } /* "asyncpg/protocol/protocol.pyx":201 * 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_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ( 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_10 = __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; } __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_10; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L13_except_error; } __pyx_L24:; } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":187 * * 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_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L9_error; __pyx_L12_exception_handled:; __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); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":205 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def bind_execute_many( */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 205, __pyx_L1_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_3 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 205, __pyx_L1_error) } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __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_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __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, 205, __pyx_L31_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_3 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 205, __pyx_L31_error) } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L30_return; } __pyx_L30_return:; __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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; goto __pyx_L0; __pyx_L31_error:; __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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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 * * async def bind_execute( # <<<<<<<<<<<<<< * self, * state: PreparedStatementState, */ /* function exit code */ __pyx_L1_error:; __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); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("bind_execute", __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_12BaseProtocol_18generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":207 * return await waiter * * async def bind_execute_many( # <<<<<<<<<<<<<< * self, * state: PreparedStatementState, */ /* 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(*)(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; int __pyx_v_return_rows; #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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_portal_name,&__pyx_mstate_global->__pyx_n_u_timeout,&__pyx_mstate_global->__pyx_n_u_return_rows,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 207, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 207, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 207, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 207, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 207, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 207, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bind_execute_many", 0) < (0)) __PYX_ERR(0, 207, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 5, 5, i); __PYX_ERR(0, 207, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 207, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 207, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 207, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 207, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 207, __pyx_L3_error) } __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 = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_return_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 207, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 0, "state", 0))) __PYX_ERR(0, 209, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 0, "portal_name", 2))) __PYX_ERR(0, 211, __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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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":228 * # 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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, __pyx_mstate_global->__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, 228, __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, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_bind_execute_many_locals_genexpr, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 228, __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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); __PYX_ERR(0, 228, __pyx_L1_error) } __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_t_1 = __pyx_mstate_global->__pyx_int_0; if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 228, __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, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __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_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3)); #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); #endif ++__pyx_t_3; } if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 228, __pyx_L1_error) PyErr_Clear(); } 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_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __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, 228, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __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, 228, __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, 228, __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 */ __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_5); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __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/protocol.pyx":207 * return await waiter * * async def bind_execute_many( # <<<<<<<<<<<<<< * self, * state: PreparedStatementState, */ 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, int __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, __pyx_mstate_global->__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, 207, __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_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_18generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_bind_execute_many, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind_execute_many, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 207, __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; __Pyx_PySendResult __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; size_t __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; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_t_18; int __pyx_t_19; int __pyx_t_20; char const *__pyx_t_21; PyObject *__pyx_t_22 = NULL; char const *__pyx_t_23; 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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 207, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":215 * 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":216 * ): * 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 216, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 216, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":215 * 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":217 * 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":218 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 218, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 218, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":219 * 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":217 * 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":221 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * timer = Timer(timeout) */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":222 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * timer = Timer(timeout) * */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":223 * self._check_state() * timeout = self._get_timeout_impl(timeout) * timer = Timer(timeout) # <<<<<<<<<<<<<< * * # Make sure the argument sequence is encoded lazily with */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Timer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_timer = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":228 * # 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_3 = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_data_gen = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":229 * # 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_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_data_gen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_arg_bufs = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":231 * arg_bufs = iter(data_gen) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * if not state.prepared: */ __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_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":232 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * if not state.prepared: * self._send_parse_message(state.name, state.query) */ /*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":233 * 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":234 * try: * if not state.prepared: * self._send_parse_message(state.name, state.query) # <<<<<<<<<<<<<< * * more = self._bind_execute_many( */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_5); __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_3), ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L11_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_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":233 * waiter = self._new_waiter(timeout) * try: * if not state.prepared: # <<<<<<<<<<<<<< * self._send_parse_message(state.name, state.query) * */ } /* "asyncpg/protocol/protocol.pyx":238 * 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":236 * self._send_parse_message(state.name, state.query) * * more = self._bind_execute_many( # <<<<<<<<<<<<<< * portal_name, * state.name, */ __pyx_t_1 = ((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_cur_scope->__pyx_v_return_rows); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L11_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_cur_scope->__pyx_v_more = __pyx_t_1; /* "asyncpg/protocol/protocol.pyx":242 * 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":243 * * 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":244 * 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":245 * 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":247 * 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":248 * * 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_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 248, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = NULL; __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_4); } __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":249 * while more: * with timer: * await compat.wait_for( # <<<<<<<<<<<<<< * self.writing_allowed.wait(), * timeout=timer.get_remaining_budget()) */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_compat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_wait_for); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 249, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":250 * 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_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 250, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = __pyx_t_16; __Pyx_INCREF(__pyx_t_15); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_5); } /* "asyncpg/protocol/protocol.pyx":251 * 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_15 = __pyx_cur_scope->__pyx_v_timer; __Pyx_INCREF(__pyx_t_15); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL}; __pyx_t_16 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 251, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_16); } __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_14); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_14, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_5}; __pyx_t_15 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 249, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_15); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_timeout, __pyx_t_16, __pyx_t_15, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 249, __pyx_L26_error) __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_15); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4, &__pyx_r); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_0 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __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_7 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); __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, 249, __pyx_L26_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 249, __pyx_L26_error) } /* "asyncpg/protocol/protocol.pyx":254 * # 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_t_14 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 254, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_sleep); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 254, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_16))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_16); assert(__pyx_t_14); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_16, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_mstate_global->__pyx_int_0}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4, &__pyx_r); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_0 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __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_7 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); __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, 254, __pyx_L26_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 254, __pyx_L26_error) } /* "asyncpg/protocol/protocol.pyx":248 * * 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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_16, &__pyx_t_14) < 0) __PYX_ERR(0, 248, __pyx_L28_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __pyx_t_15 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_16, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 248, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 248, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_17); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_1 < (0)) __PYX_ERR(0, 248, __pyx_L28_except_error) __pyx_t_18 = (!__pyx_t_1); if (unlikely(__pyx_t_18)) { __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_16, __pyx_t_14); __pyx_t_4 = 0; __pyx_t_16 = 0; __pyx_t_14 = 0; __PYX_ERR(0, 248, __pyx_L28_except_error) } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 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_mstate_global->__pyx_tuple[2], NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 248, __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":255 * # 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_16 = __pyx_cur_scope->__pyx_v_timer; __Pyx_INCREF(__pyx_t_16); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_mstate_global->__pyx_int_0}; __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_has_budget_greater_than, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 255, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_14); } __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 255, __pyx_L11_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_1 = (!__pyx_t_18); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":256 * 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_14, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 256, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 256, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_Raise(__pyx_t_16, 0, 0, 0); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __PYX_ERR(0, 256, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":255 * # 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":257 * 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_1 = ((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, 257, __pyx_L11_error) __pyx_cur_scope->__pyx_v_more = __pyx_t_1; } /* "asyncpg/protocol/protocol.pyx":232 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * if not state.prepared: * self._send_parse_message(state.name, state.query) */ } __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_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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":259 * 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_16, &__pyx_t_14, &__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 259, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_19 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_16, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_ErrRestore(__pyx_t_16, __pyx_t_14, __pyx_t_4); __pyx_t_16 = 0; __pyx_t_14 = 0; __pyx_t_4 = 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_4, &__pyx_t_14, &__pyx_t_16) < 0) __PYX_ERR(0, 259, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_cur_scope->__pyx_v_e = __pyx_t_14; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":260 * * except asyncio.TimeoutError as e: * self._bind_execute_many_fail(e) # network op # <<<<<<<<<<<<<< * * except Exception as ex: */ __pyx_t_5 = ((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_5)) __PYX_ERR(0, 260, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "asyncpg/protocol/protocol.pyx":259 * 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_22 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_17, &__pyx_t_22); if ( 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_22); __pyx_t_19 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __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; } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_17, __pyx_t_22); __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_22 = 0; __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21; goto __pyx_L13_except_error; } __pyx_L47:; } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L12_exception_handled; } /* "asyncpg/protocol/protocol.pyx":262 * self._bind_execute_many_fail(e) # network op * * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_20 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_20) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_14, &__pyx_t_4) < 0) __PYX_ERR(0, 262, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_cur_scope->__pyx_v_ex = __pyx_t_14; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":263 * * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_15 = __pyx_cur_scope->__pyx_v_waiter; __Pyx_INCREF(__pyx_t_15); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":264 * 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, 264, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "asyncpg/protocol/protocol.pyx":262 * 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_22 = 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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_10); if ( unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_17, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_17, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_22); __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_20 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_23 = __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; } __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_22); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_17, __pyx_t_11); __pyx_t_22 = 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_20; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_23; goto __pyx_L13_except_error; } __pyx_L58:; } __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":232 * * 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_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_L12_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_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":266 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def bind(self, PreparedStatementState state, args, */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 266, __pyx_L1_error) __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_4 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 266, __pyx_L1_error) } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_13, &__pyx_t_12); if ( unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_12); { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_0 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __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_7 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); __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, 266, __pyx_L65_error) __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_4 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 266, __pyx_L65_error) } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L64_return; } __pyx_L64_return:; __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_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; goto __pyx_L0; __pyx_L65_error:; __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_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 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":207 * return await waiter * * async def bind_execute_many( # <<<<<<<<<<<<<< * self, * state: PreparedStatementState, */ /* 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_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("bind_execute_many", __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_12BaseProtocol_21generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":268 * return await waiter * * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_portal_name,&__pyx_mstate_global->__pyx_n_u_timeout,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 268, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 268, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 268, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 268, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 268, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bind", 0) < (0)) __PYX_ERR(0, 268, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, i); __PYX_ERR(0, 268, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 268, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 268, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 268, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 268, __pyx_L3_error) } __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, 268, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 268, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 269, __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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, __pyx_mstate_global->__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, 268, __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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_21generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_bind, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 268, __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; __Pyx_PySendResult __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; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; size_t __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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 268, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":271 * 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":272 * * 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 272, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 272, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":271 * 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":273 * 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":274 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 274, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 274, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":275 * 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":273 * 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":277 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * args_buf = state._encode_bind_msg(args) */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":278 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * args_buf = state._encode_bind_msg(args) * */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":279 * self._check_state() * timeout = self._get_timeout_impl(timeout) * args_buf = state._encode_bind_msg(args) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_args_buf = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":281 * args_buf = state._encode_bind_msg(args) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._bind( */ __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_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":282 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind( * portal_name, */ /*try:*/ { { __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/protocol.pyx":285 * self._bind( * portal_name, * state.name, # <<<<<<<<<<<<<< * args_buf) # network op * */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_3); /* "asyncpg/protocol/protocol.pyx":286 * 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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(0, 286, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":283 * waiter = self._new_waiter(timeout) * try: * self._bind( # <<<<<<<<<<<<<< * portal_name, * state.name, */ __pyx_t_7 = ((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_3), ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_args_buf)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":288 * args_buf) # network op * * self.last_query = state.query # <<<<<<<<<<<<<< * self.statement = state * except Exception as ex: */ __pyx_t_7 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __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_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":289 * * 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":282 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind( * portal_name, */ } __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; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":290 * self.last_query = state.query * self.statement = state * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(0, 290, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_ex = __pyx_t_3; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":291 * self.statement = state * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __pyx_cur_scope->__pyx_v_waiter; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 291, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":292 * 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, 292, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":290 * 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_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ( 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_8 = __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; } __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_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L13_except_error; } __pyx_L23:; } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":282 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind( * portal_name, */ __pyx_L13_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_L9_error; __pyx_L12_exception_handled:; __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); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":294 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def execute(self, PreparedStatementState state, */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 294, __pyx_L1_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_9 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 294, __pyx_L1_error) } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __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_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __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, 294, __pyx_L30_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_9 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 294, __pyx_L30_error) } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L29_return; } __pyx_L29_return:; __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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L0; __pyx_L30_error:; __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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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":268 * return await waiter * * async def bind(self, PreparedStatementState state, args, # <<<<<<<<<<<<<< * str portal_name, timeout): * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("bind", __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_12BaseProtocol_24generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":296 * return await waiter * * async def execute(self, PreparedStatementState state, # <<<<<<<<<<<<<< * str portal_name, int limit, return_extra, * timeout): */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_portal_name,&__pyx_mstate_global->__pyx_n_u_limit,&__pyx_mstate_global->__pyx_n_u_return_extra,&__pyx_mstate_global->__pyx_n_u_timeout,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 296, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 296, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 296, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 296, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 296, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 296, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "execute", 0) < (0)) __PYX_ERR(0, 296, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, i); __PYX_ERR(0, 296, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 296, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 296, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 296, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 296, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 296, __pyx_L3_error) } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_portal_name = ((PyObject*)values[1]); __pyx_v_limit = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 297, __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, 296, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 296, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 297, __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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, __pyx_mstate_global->__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, 296, __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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_24generator4, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_execute, __pyx_mstate_global->__pyx_n_u_BaseProtocol_execute, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 296, __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; __Pyx_PySendResult __pyx_t_2; 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; size_t __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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 296, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":300 * 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":301 * * 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 301, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 301, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":300 * timeout): * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":302 * 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":303 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 303, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 303, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":304 * 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":302 * 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":306 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":307 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":309 * timeout = self._get_timeout_impl(timeout) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._execute( */ __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_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":310 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._execute( * portal_name, */ /*try:*/ { { __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/protocol.pyx":311 * waiter = self._new_waiter(timeout) * try: * self._execute( # <<<<<<<<<<<<<< * portal_name, * limit) # network op */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 311, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":315 * limit) # network op * * self.last_query = state.query # <<<<<<<<<<<<<< * self.statement = state * self.return_extra = return_extra */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __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_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":316 * * 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":317 * 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, 317, __pyx_L11_error) __pyx_cur_scope->__pyx_v_self->return_extra = __pyx_t_1; /* "asyncpg/protocol/protocol.pyx":318 * 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":310 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._execute( * portal_name, */ } __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; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":319 * self.return_extra = return_extra * self.queries_count += 1 * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_7) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 319, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_v_ex = __pyx_t_8; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":320 * self.queries_count += 1 * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __pyx_cur_scope->__pyx_v_waiter; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 320, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":321 * 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, 321, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":319 * 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_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ( 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; } __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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":310 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._execute( * portal_name, */ __pyx_L13_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_L9_error; __pyx_L12_exception_handled:; __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); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":323 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def close_portal(self, str portal_name, timeout): */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 323, __pyx_L1_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_9 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 323, __pyx_L1_error) } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __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_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __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, 323, __pyx_L30_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_9 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 323, __pyx_L30_error) } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L29_return; } __pyx_L29_return:; __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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L0; __pyx_L30_error:; __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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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":296 * return await waiter * * async def execute(self, PreparedStatementState state, # <<<<<<<<<<<<<< * str portal_name, int limit, return_extra, * timeout): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("execute", __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_12BaseProtocol_27generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":325 * return await waiter * * async def close_portal(self, str portal_name, timeout): # <<<<<<<<<<<<<< * * if self.cancel_waiter is not None: */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_portal_name,&__pyx_mstate_global->__pyx_n_u_timeout,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 325, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 325, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 325, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "close_portal", 0) < (0)) __PYX_ERR(0, 325, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("close_portal", 1, 2, 2, i); __PYX_ERR(0, 325, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 325, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 325, __pyx_L3_error) } __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, 325, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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, 325, __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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, __pyx_mstate_global->__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, 325, __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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_27generator5, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_close_portal, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close_portal, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 325, __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; __Pyx_PySendResult __pyx_t_2; 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; size_t __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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 325, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":327 * 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":328 * * 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 328, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 328, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":327 * 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":329 * 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":330 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 330, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 330, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":331 * 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":329 * 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":333 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":334 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":336 * timeout = self._get_timeout_impl(timeout) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._close( */ __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_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":337 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._close( * portal_name, */ /*try:*/ { { __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/protocol.pyx":338 * waiter = self._new_waiter(timeout) * try: * self._close( # <<<<<<<<<<<<<< * portal_name, * True) # network op */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 338, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":337 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._close( * portal_name, */ } __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; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":341 * portal_name, * True) # network op * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_7) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 341, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_v_ex = __pyx_t_8; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":342 * True) # network op * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __pyx_cur_scope->__pyx_v_waiter; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 342, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":343 * 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, 343, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":341 * 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_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ( 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; } __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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":337 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._close( * portal_name, */ __pyx_L13_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_L9_error; __pyx_L12_exception_handled:; __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); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":345 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def query(self, query, timeout): */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 345, __pyx_L1_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_9 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 345, __pyx_L1_error) } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __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_4 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __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, 345, __pyx_L30_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_9 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 345, __pyx_L30_error) } __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L29_return; } __pyx_L29_return:; __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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L0; __pyx_L30_error:; __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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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":325 * return await waiter * * async def close_portal(self, str portal_name, timeout): # <<<<<<<<<<<<<< * * if self.cancel_waiter is not None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("close_portal", __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_12BaseProtocol_30generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":347 * return await waiter * * async def query(self, query, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_query,&__pyx_mstate_global->__pyx_n_u_timeout,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 347, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 347, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 347, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "query", 0) < (0)) __PYX_ERR(0, 347, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("query", 1, 2, 2, i); __PYX_ERR(0, 347, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 347, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 347, __pyx_L3_error) } __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, 347, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, __pyx_mstate_global->__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, 347, __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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_30generator6, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_query, __pyx_mstate_global->__pyx_n_u_BaseProtocol_query, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 347, __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; __Pyx_PySendResult __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; size_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; 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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 347, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":348 * * 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":349 * 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 349, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 349, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":348 * * 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":350 * 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":351 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 351, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 351, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":352 * 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":350 * 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":354 * 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_3 = ((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_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":358 * # 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_4 = ((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_timeout, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":360 * timeout = self._get_timeout(timeout) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._simple_query(query) # network op */ __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_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":361 * * 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":362 * waiter = self._new_waiter(timeout) * try: * self._simple_query(query) # network op # <<<<<<<<<<<<<< * self.last_query = query * self.queries_count += 1 */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_query; __Pyx_INCREF(__pyx_t_3); if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 362, __pyx_L11_error) __pyx_t_4 = ((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_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":363 * try: * self._simple_query(query) # network op * self.last_query = query # <<<<<<<<<<<<<< * self.queries_count += 1 * except Exception as ex: */ __pyx_t_4 = __pyx_cur_scope->__pyx_v_query; __Pyx_INCREF(__pyx_t_4); if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 363, __pyx_L11_error) __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":364 * 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":361 * * 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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":365 * 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)))); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.query", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_10) < 0) __PYX_ERR(0, 365, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_ex = __pyx_t_3; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":366 * self.queries_count += 1 * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_12 = __pyx_cur_scope->__pyx_v_waiter; __Pyx_INCREF(__pyx_t_12); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 366, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":367 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_11 = ((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_11)) __PYX_ERR(0, 367, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } /* "asyncpg/protocol/protocol.pyx":365 * 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_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ( 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; } __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_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":361 * * 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":369 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def copy_out(self, copy_stmt, sink, timeout): */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 369, __pyx_L1_error) __pyx_t_10 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_10); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_10 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 369, __pyx_L1_error) } __pyx_r = __pyx_t_10; __pyx_t_10 = 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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ( 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 369, __pyx_L30_error) __pyx_t_10 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_10); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_10 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 369, __pyx_L30_error) } __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L29_return; } __pyx_L29_return:; __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:; __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":347 * return await waiter * * async def query(self, query, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ /* function exit code */ __pyx_L1_error:; __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); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("query", __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_12BaseProtocol_33generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":371 * return await waiter * * async def copy_out(self, copy_stmt, sink, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_copy_stmt,&__pyx_mstate_global->__pyx_n_u_sink,&__pyx_mstate_global->__pyx_n_u_timeout,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 371, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 371, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 371, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 371, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copy_out", 0) < (0)) __PYX_ERR(0, 371, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("copy_out", 1, 3, 3, i); __PYX_ERR(0, 371, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 371, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 371, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 371, __pyx_L3_error) } __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, 371, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":410 * # 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_f,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 410, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 410, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda6", 0) < (0)) __PYX_ERR(0, 410, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lambda6", 1, 1, 1, i); __PYX_ERR(0, 410, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 410, __pyx_L3_error) } __pyx_v_f = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 410, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda6", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_f; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_exception, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __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_XDECREF(__pyx_t_2); __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":371 * return await waiter * * async def copy_out(self, copy_stmt, sink, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ 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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, __pyx_mstate_global->__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, 371, __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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_33generator7, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_copy_out, __pyx_mstate_global->__pyx_n_u_BaseProtocol_copy_out, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 371, __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; __Pyx_PySendResult __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; size_t __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)(PyObject *); PyObject *__pyx_t_14 = NULL; int __pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_t_20; 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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 371, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":372 * * 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":373 * 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 373, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 373, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":372 * * 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":374 * 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":375 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 375, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 375, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":376 * 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":374 * 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":378 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * * timeout = self._get_timeout_impl(timeout) */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":380 * self._check_state() * * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * timer = Timer(timeout) * */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":381 * * timeout = self._get_timeout_impl(timeout) * timer = Timer(timeout) # <<<<<<<<<<<<<< * * # The copy operation is guarded by a single timeout */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Timer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_timer = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":385 * # 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_5 = __pyx_cur_scope->__pyx_v_timer; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_5 = ((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_5)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":387 * waiter = self._new_waiter(timer.get_remaining_budget()) * * self._copy_out(copy_stmt) # <<<<<<<<<<<<<< * * try: */ __pyx_t_5 = __pyx_cur_scope->__pyx_v_copy_stmt; __Pyx_INCREF(__pyx_t_5); if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 387, __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_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __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":389 * self._copy_out(copy_stmt) * * try: # <<<<<<<<<<<<<< * while True: * self.resume_reading() */ /*try:*/ { /* "asyncpg/protocol/protocol.pyx":390 * * try: * while True: # <<<<<<<<<<<<<< * self.resume_reading() * */ while (1) { /* "asyncpg/protocol/protocol.pyx":391 * 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, 391, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":393 * self.resume_reading() * * with timer: # <<<<<<<<<<<<<< * buffer, done, status_msg = await waiter * */ /*with:*/ { __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = NULL; __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __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/protocol/protocol.pyx":394 * * with timer: * buffer, done, status_msg = await waiter # <<<<<<<<<<<<<< * * # buffer will be empty if CopyDone was received apart from */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_0 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; __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_7 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 394, __pyx_L19_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_3 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 394, __pyx_L19_error) } 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, 394, __pyx_L19_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_11); } else { __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L19_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L19_error) __Pyx_XGOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 394, __pyx_L19_error) __Pyx_XGOTREF(__pyx_t_11); } #else __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 394, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 394, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L28_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L28_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L28_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < (0)) __PYX_ERR(0, 394, __pyx_L19_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L29_unpacking_done; __pyx_L28_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 394, __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_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_done); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_done, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_status_msg); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_status_msg, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":393 * self.resume_reading() * * with timer: # <<<<<<<<<<<<<< * buffer, done, status_msg = await waiter * */ } __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_L26_try_end; __pyx_L19_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 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; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_11, &__pyx_t_5) < 0) __PYX_ERR(0, 393, __pyx_L21_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 393, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_1 < (0)) __PYX_ERR(0, 393, __pyx_L21_except_error) __pyx_t_15 = (!__pyx_t_1); if (unlikely(__pyx_t_15)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_11, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_11 = 0; __pyx_t_5 = 0; __PYX_ERR(0, 393, __pyx_L21_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L20_exception_handled; } __pyx_L21_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_L9_error; __pyx_L20_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_L26_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_7) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2], NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 393, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L18; } __pyx_L18:; } goto __pyx_L33; __pyx_L13_error:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_error; __pyx_L33:; } /* "asyncpg/protocol/protocol.pyx":398 * # 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, 398, __pyx_L9_error) } __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_buffer); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 398, __pyx_L9_error) if (__pyx_t_15) { /* "asyncpg/protocol/protocol.pyx":399 * # the last CopyData message. * if buffer: * try: # <<<<<<<<<<<<<< * with timer: * await compat.wait_for( */ { __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":400 * if buffer: * try: * with timer: # <<<<<<<<<<<<<< * await compat.wait_for( * sink(buffer), */ /*with:*/ { __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = NULL; __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L43_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_11); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L43_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":401 * try: * with timer: * await compat.wait_for( # <<<<<<<<<<<<<< * sink(buffer), * timeout=timer.get_remaining_budget()) */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_compat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 401, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_wait_for); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":402 * with timer: * await compat.wait_for( * sink(buffer), # <<<<<<<<<<<<<< * timeout=timer.get_remaining_budget()) * except (Exception, asyncio.CancelledError) as ex: */ __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sink); __pyx_t_18 = __pyx_cur_scope->__pyx_v_sink; if (unlikely(!__pyx_cur_scope->__pyx_v_buffer)) { __Pyx_RaiseUnboundLocalError("buffer"); __PYX_ERR(0, 402, __pyx_L49_error) } __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_18))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_18); assert(__pyx_t_12); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_18, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_buffer}; __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 402, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_11); } /* "asyncpg/protocol/protocol.pyx":403 * 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_12 = __pyx_cur_scope->__pyx_v_timer; __Pyx_INCREF(__pyx_t_12); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL}; __pyx_t_18 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 403, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_18); } __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_11}; __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 401, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_12); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_timeout, __pyx_t_18, __pyx_t_12, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 401, __pyx_L49_error) __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5, &__pyx_r); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_0 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_14); __pyx_cur_scope->__pyx_t_4 = __pyx_t_14; __Pyx_XGIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_t_5 = __pyx_t_16; __Pyx_XGIVEREF(__pyx_t_17); __pyx_cur_scope->__pyx_t_6 = __pyx_t_17; __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_7 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_14 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_14); __pyx_t_16 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_16); __pyx_t_17 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 401, __pyx_L49_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 401, __pyx_L49_error) } /* "asyncpg/protocol/protocol.pyx":400 * if buffer: * try: * with timer: # <<<<<<<<<<<<<< * await compat.wait_for( * sink(buffer), */ } __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L56_try_end; __pyx_L49_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 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; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_12) < 0) __PYX_ERR(0, 400, __pyx_L51_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_18 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 400, __pyx_L51_except_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_18, NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 400, __pyx_L51_except_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_19); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; if (__pyx_t_15 < (0)) __PYX_ERR(0, 400, __pyx_L51_except_error) __pyx_t_1 = (!__pyx_t_15); if (unlikely(__pyx_t_1)) { __Pyx_GIVEREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_12); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_12 = 0; __PYX_ERR(0, 400, __pyx_L51_except_error) } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L50_exception_handled; } __pyx_L51_except_error:; __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_16, __pyx_t_17); goto __pyx_L35_error; __pyx_L50_exception_handled:; __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_16, __pyx_t_17); __pyx_L56_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_8) { __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[2], NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 400, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } goto __pyx_L48; } __pyx_L48:; } goto __pyx_L61; __pyx_L43_error:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L35_error; __pyx_L61:; } /* "asyncpg/protocol/protocol.pyx":399 * # the last CopyData message. * if buffer: * try: # <<<<<<<<<<<<<< * with timer: * await compat.wait_for( */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L42_try_end; __pyx_L35_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 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; /* "asyncpg/protocol/protocol.pyx":404 * 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_12, &__pyx_t_4, &__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 404, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_CancelledError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 404, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_20 = __Pyx_PyErr_GivenExceptionMatches2(__pyx_t_12, ((PyObject *)(((PyTypeObject*)PyExc_Exception))), __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_ErrRestore(__pyx_t_12, __pyx_t_4, __pyx_t_5); __pyx_t_12 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; if (__pyx_t_20) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_12) < 0) __PYX_ERR(0, 404, __pyx_L37_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_ex = __pyx_t_4; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":407 * # Abort the COPY operation on any error in * # output sink. * self._request_cancel() # <<<<<<<<<<<<<< * # Make asyncio shut up about unretrieved * # QueryCanceledError */ __pyx_t_18 = ((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_INCREF(__pyx_t_18); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_18, NULL}; __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 407, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_11); } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":410 * # Make asyncio shut up about unretrieved * # QueryCanceledError * waiter.add_done_callback(lambda f: f.exception()) # <<<<<<<<<<<<<< * raise * */ __pyx_t_18 = __pyx_cur_scope->__pyx_v_waiter; __Pyx_INCREF(__pyx_t_18); __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6, 0, __pyx_mstate_global->__pyx_n_u_copy_out_locals_lambda, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_3}; __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_done_callback, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 410, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_11); } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":411 * # QueryCanceledError * waiter.add_done_callback(lambda f: f.exception()) * raise # <<<<<<<<<<<<<< * * # done will be True upon receipt of CopyDone. */ __Pyx_GIVEREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_12); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_12 = 0; __PYX_ERR(0, 411, __pyx_L67_error) } /* "asyncpg/protocol/protocol.pyx":404 * 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_8 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_14 = 0; __pyx_t_19 = 0; __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_19, &__pyx_t_23); if ( unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_17, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_23); __pyx_t_20 = __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; } __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_19, __pyx_t_23); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_17, __pyx_t_16); __pyx_t_8 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_14 = 0; __pyx_t_19 = 0; __pyx_t_23 = 0; __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_22; goto __pyx_L37_except_error; } } } goto __pyx_L37_except_error; /* "asyncpg/protocol/protocol.pyx":399 * # the last CopyData message. * if buffer: * try: # <<<<<<<<<<<<<< * with timer: * await compat.wait_for( */ __pyx_L37_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_10, __pyx_t_9); goto __pyx_L9_error; __pyx_L42_try_end:; } /* "asyncpg/protocol/protocol.pyx":398 * # buffer will be empty if CopyDone was received apart from * # the last CopyData message. * if buffer: # <<<<<<<<<<<<<< * try: * with timer: */ } /* "asyncpg/protocol/protocol.pyx":414 * * # 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, 414, __pyx_L9_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_done); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 414, __pyx_L9_error) if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":415 * # 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":414 * * # done will be True upon receipt of CopyDone. * if done: # <<<<<<<<<<<<<< * break * */ } /* "asyncpg/protocol/protocol.pyx":417 * break * * waiter = self._new_waiter(timer.get_remaining_budget()) # <<<<<<<<<<<<<< * * finally: */ __pyx_t_4 = __pyx_cur_scope->__pyx_v_timer; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 417, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_12); } __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_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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":420 * * 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, 420, __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_9 = 0; __pyx_t_10 = 0; __pyx_t_7 = 0; __pyx_t_23 = 0; __pyx_t_19 = 0; __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 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_ExceptionSwap(&__pyx_t_23, &__pyx_t_19, &__pyx_t_14); if ( unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_14); __pyx_t_21 = __pyx_lineno; __pyx_t_20 = __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, 420, __pyx_L75_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_19, __pyx_t_14); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_7); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_7 = 0; __pyx_t_23 = 0; __pyx_t_19 = 0; __pyx_t_14 = 0; __pyx_lineno = __pyx_t_21; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_24; goto __pyx_L1_error; __pyx_L75_error:; __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_19, __pyx_t_14); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_23 = 0; __pyx_t_19 = 0; __pyx_t_14 = 0; goto __pyx_L1_error; } __pyx_L10:; } /* "asyncpg/protocol/protocol.pyx":422 * self.resume_reading() * * return status_msg # <<<<<<<<<<<<<< * * async def copy_in(self, copy_stmt, reader, data, */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_cur_scope->__pyx_v_status_msg)) { __Pyx_RaiseUnboundLocalError("status_msg"); __PYX_ERR(0, 422, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_status_msg); __pyx_r = __pyx_cur_scope->__pyx_v_status_msg; goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":371 * return await waiter * * async def copy_out(self, copy_stmt, sink, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ /* 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_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_18); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("copy_out", __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_12BaseProtocol_36generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":424 * return status_msg * * async def copy_in(self, copy_stmt, reader, data, # <<<<<<<<<<<<<< * records, PreparedStatementState record_stmt, timeout): * cdef: */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_copy_stmt,&__pyx_mstate_global->__pyx_n_u_reader,&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_records,&__pyx_mstate_global->__pyx_n_u_record_stmt,&__pyx_mstate_global->__pyx_n_u_timeout,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 424, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 424, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 424, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 424, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 424, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 424, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 424, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copy_in", 0) < (0)) __PYX_ERR(0, 424, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 6; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, i); __PYX_ERR(0, 424, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 424, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 424, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 424, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 424, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 424, __pyx_L3_error) values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 424, __pyx_L3_error) } __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, 424, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "record_stmt", 0))) __PYX_ERR(0, 425, __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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":553 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_f,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 553, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 553, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda7", 0) < (0)) __PYX_ERR(0, 553, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lambda7", 1, 1, 1, i); __PYX_ERR(0, 553, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 553, __pyx_L3_error) } __pyx_v_f = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda7", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 553, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda7", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_f; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_exception, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __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_XDECREF(__pyx_t_2); __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":424 * return status_msg * * async def copy_in(self, copy_stmt, reader, data, # <<<<<<<<<<<<<< * records, PreparedStatementState record_stmt, timeout): * cdef: */ 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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, __pyx_mstate_global->__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, 424, __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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_36generator8, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_copy_in, __pyx_mstate_global->__pyx_n_u_BaseProtocol_copy_in, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 424, __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; __Pyx_PySendResult __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; int __pyx_t_11; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; Py_ssize_t __pyx_t_17; Py_ssize_t __pyx_t_18; Py_ssize_t __pyx_t_19; PyObject *__pyx_t_20; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *(*__pyx_t_26)(PyObject *); int __pyx_t_27; PyObject *__pyx_t_28 = NULL; PyObject *__pyx_t_29 = NULL; PyObject *__pyx_t_30 = NULL; int __pyx_t_31; char const *__pyx_t_32; 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_L131_resume_from_await; case 9: goto __pyx_L142_resume_from_await; case 10: goto __pyx_L156_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(__pyx_sent_value != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 424, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":431 * 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":432 * * 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 432, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 432, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":431 * 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":433 * 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":434 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 434, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 434, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":435 * 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":433 * 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":437 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * * timeout = self._get_timeout_impl(timeout) */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":439 * self._check_state() * * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * timer = Timer(timeout) * */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":440 * * timeout = self._get_timeout_impl(timeout) * timer = Timer(timeout) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timer.get_remaining_budget()) */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Timer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_timer = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":442 * timer = Timer(timeout) * * waiter = self._new_waiter(timer.get_remaining_budget()) # <<<<<<<<<<<<<< * * # Initiate COPY IN. */ __pyx_t_5 = __pyx_cur_scope->__pyx_v_timer; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_5 = ((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_5)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":445 * * # Initiate COPY IN. * self._copy_in(copy_stmt) # <<<<<<<<<<<<<< * * try: */ __pyx_t_5 = __pyx_cur_scope->__pyx_v_copy_stmt; __Pyx_INCREF(__pyx_t_5); if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 445, __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_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __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":447 * self._copy_in(copy_stmt) * * try: # <<<<<<<<<<<<<< * if record_stmt is not None: * # copy_in_records in binary mode */ { __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":448 * * 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":450 * 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->__pyx_new()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __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":452 * 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_mstate_global->__pyx_kp_b_PGCOPY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":454 * 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, 454, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":456 * 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, 456, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":458 * 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, 458, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":459 * * 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":460 * 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, 460, __pyx_L8_error) } __pyx_t_10 = __Pyx_PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_codecs); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 460, __pyx_L8_error) __pyx_cur_scope->__pyx_v_num_cols = __pyx_t_10; /* "asyncpg/protocol/protocol.pyx":461 * 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":463 * 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, 463, __pyx_L8_error) } __pyx_t_3 = __pyx_cur_scope->__pyx_v_codecs; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 463, __pyx_L8_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10)); #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); #endif ++__pyx_t_10; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(0, 463, __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_5)); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":464 * * for codec in codecs: * if (not codec.has_encoder() or # <<<<<<<<<<<<<< * codec.format != PG_FORMAT_BINARY): * raise apg_exc.InternalClientError( */ __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_cur_scope->__pyx_v_codec); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 464, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_12 = (!__pyx_t_11); if (!__pyx_t_12) { } else { __pyx_t_1 = __pyx_t_12; goto __pyx_L18_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":465 * 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_12 = (__pyx_cur_scope->__pyx_v_codec->format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); __pyx_t_1 = __pyx_t_12; __pyx_L18_bool_binop_done:; /* "asyncpg/protocol/protocol.pyx":464 * * 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":466 * 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 466, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 466, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":468 * raise apg_exc.InternalClientError( * 'no binary format encoder for ' * 'type {} (OID {})'.format(codec.name, codec.oid)) # <<<<<<<<<<<<<< * * if isinstance(records, collections.abc.AsyncIterable): */ __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_no_binary_format_encoder_for_typ; __Pyx_INCREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyLong_From_uint32_t(__pyx_cur_scope->__pyx_v_codec->oid); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 468, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_6 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_cur_scope->__pyx_v_codec->name, __pyx_t_16}; __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 468, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); } __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_14, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_13}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L8_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(0, 466, __pyx_L8_error) /* "asyncpg/protocol/protocol.pyx":464 * * for codec in codecs: * if (not codec.has_encoder() or # <<<<<<<<<<<<<< * codec.format != PG_FORMAT_BINARY): * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/protocol.pyx":463 * 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":470 * '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_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AsyncIterable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 470, __pyx_L8_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":471 * * 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, 471, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); for (;;) { __pyx_t_5 = __Pyx_Coroutine_AsyncIterNext(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 471, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5, &__pyx_r); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __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_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_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)) { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type && (exc_type == PyExc_StopAsyncIteration || ( exc_type != PyExc_StopIteration && exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopAsyncIteration))))) { PyErr_Clear(); break; } __PYX_ERR(0, 471, __pyx_L8_error) } __pyx_t_5 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_5); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_5 = __pyx_r; __pyx_r = NULL; } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type && (exc_type == PyExc_StopAsyncIteration || ( exc_type != PyExc_StopIteration && exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopAsyncIteration))))) { PyErr_Clear(); break; } __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 471, __pyx_L8_error) } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":473 * async for row in records: * # Tuple header * wbuf.write_int16(num_cols) # <<<<<<<<<<<<<< * # Tuple data * for i in range(num_cols): */ __pyx_t_5 = ((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_5)) __PYX_ERR(0, 473, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":475 * wbuf.write_int16(num_cols) * # Tuple data * for i in range(num_cols): # <<<<<<<<<<<<<< * item = row[i] * if item is None: */ __pyx_t_17 = __pyx_cur_scope->__pyx_v_num_cols; __pyx_t_18 = __pyx_t_17; for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_19; /* "asyncpg/protocol/protocol.pyx":476 * # Tuple data * for i in range(num_cols): * item = row[i] # <<<<<<<<<<<<<< * if item is None: * wbuf.write_int32(-1) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":477 * 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":478 * item = row[i] * if item is None: * wbuf.write_int32(-1) # <<<<<<<<<<<<<< * else: * codec = cpython.PyTuple_GET_ITEM( */ __pyx_t_5 = ((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_5)) __PYX_ERR(0, 478, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":477 * 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":480 * wbuf.write_int32(-1) * else: * codec = cpython.PyTuple_GET_ITEM( # <<<<<<<<<<<<<< * codecs, i) * codec.encode(settings, wbuf, item) */ /*else*/ { /* "asyncpg/protocol/protocol.pyx":481 * else: * codec = cpython.PyTuple_GET_ITEM( * codecs, i) # <<<<<<<<<<<<<< * codec.encode(settings, wbuf, item) * */ __pyx_t_20 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_codecs, __pyx_cur_scope->__pyx_v_i); /* "asyncpg/protocol/protocol.pyx":480 * wbuf.write_int32(-1) * else: * codec = cpython.PyTuple_GET_ITEM( # <<<<<<<<<<<<<< * codecs, i) * codec.encode(settings, wbuf, item) */ __pyx_t_5 = ((PyObject *)__pyx_t_20); __Pyx_INCREF(__pyx_t_5); __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_5)); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":482 * codec = cpython.PyTuple_GET_ITEM( * codecs, i) * codec.encode(settings, wbuf, item) # <<<<<<<<<<<<<< * * if wbuf.len() >= _COPY_BUFFER_SIZE: */ __pyx_t_5 = __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_5)) __PYX_ERR(0, 482, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L27:; } /* "asyncpg/protocol/protocol.pyx":484 * codec.encode(settings, wbuf, item) * * if wbuf.len() >= _COPY_BUFFER_SIZE: # <<<<<<<<<<<<<< * with timer: * await self.writing_allowed.wait() */ __pyx_t_5 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_cur_scope->__pyx_v_wbuf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_14 = PyObject_RichCompare(__pyx_t_5, __pyx_mstate_global->__pyx_int_524288, Py_GE); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 484, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 484, __pyx_L8_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":485 * * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) */ /*with:*/ { __pyx_t_21 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 485, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_5 = NULL; __pyx_t_13 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 485, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_13); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_13, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 485, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_14); } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":486 * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: * await self.writing_allowed.wait() # <<<<<<<<<<<<<< * self._write_copy_data_msg(wbuf) * wbuf = WriteBuffer.new() */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = __pyx_t_5; __Pyx_INCREF(__pyx_t_13); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL}; __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 486, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_14); } __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_14, &__pyx_r); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __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_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_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_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_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); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 486, __pyx_L35_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 486, __pyx_L35_error) } /* "asyncpg/protocol/protocol.pyx":485 * * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) */ } __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; goto __pyx_L42_try_end; __pyx_L35_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_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_5, &__pyx_t_13) < 0) __PYX_ERR(0, 485, __pyx_L37_except_error) __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_4 = PyTuple_Pack(3, __pyx_t_14, __pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 485, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_25); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_25); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (__pyx_t_1 < (0)) __PYX_ERR(0, 485, __pyx_L37_except_error) __pyx_t_12 = (!__pyx_t_1); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_5, __pyx_t_13); __pyx_t_14 = 0; __pyx_t_5 = 0; __pyx_t_13 = 0; __PYX_ERR(0, 485, __pyx_L37_except_error) } __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L36_exception_handled; } __pyx_L37_except_error:; __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); goto __pyx_L8_error; __pyx_L36_exception_handled:; __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_L42_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_21) { __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_mstate_global->__pyx_tuple[2], NULL); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 485, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; } goto __pyx_L34; } __pyx_L34:; } goto __pyx_L47; __pyx_L29_error:; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; goto __pyx_L8_error; __pyx_L47:; } /* "asyncpg/protocol/protocol.pyx":487 * with timer: * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) # <<<<<<<<<<<<<< * wbuf = WriteBuffer.new() * else: */ __pyx_t_13 = ((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_13)) __PYX_ERR(0, 487, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":488 * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) * wbuf = WriteBuffer.new() # <<<<<<<<<<<<<< * else: * for row in records: */ __pyx_t_13 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 488, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __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_13)); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":484 * codec.encode(settings, wbuf, item) * * if wbuf.len() >= _COPY_BUFFER_SIZE: # <<<<<<<<<<<<<< * with timer: * await self.writing_allowed.wait() */ } /* "asyncpg/protocol/protocol.pyx":471 * * 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":470 * '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":490 * 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_10 = 0; __pyx_t_26 = NULL; } else { __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_records); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_26 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 490, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_26)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L8_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } __pyx_t_13 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_10; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L8_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_13 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10)); #else __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); #endif ++__pyx_t_10; } if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 490, __pyx_L8_error) } else { __pyx_t_13 = __pyx_t_26(__pyx_t_3); if (unlikely(!__pyx_t_13)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 490, __pyx_L8_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":492 * for row in records: * # Tuple header * wbuf.write_int16(num_cols) # <<<<<<<<<<<<<< * # Tuple data * for i in range(num_cols): */ __pyx_t_13 = ((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_13)) __PYX_ERR(0, 492, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":494 * wbuf.write_int16(num_cols) * # Tuple data * for i in range(num_cols): # <<<<<<<<<<<<<< * item = row[i] * if item is None: */ __pyx_t_17 = __pyx_cur_scope->__pyx_v_num_cols; __pyx_t_18 = __pyx_t_17; for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_19; /* "asyncpg/protocol/protocol.pyx":495 * # Tuple data * for i in range(num_cols): * item = row[i] # <<<<<<<<<<<<<< * if item is None: * wbuf.write_int32(-1) */ __pyx_t_13 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 495, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":496 * for i in range(num_cols): * item = row[i] * if item is None: # <<<<<<<<<<<<<< * wbuf.write_int32(-1) * else: */ __pyx_t_12 = (__pyx_cur_scope->__pyx_v_item == Py_None); if (__pyx_t_12) { /* "asyncpg/protocol/protocol.pyx":497 * item = row[i] * if item is None: * wbuf.write_int32(-1) # <<<<<<<<<<<<<< * else: * codec = cpython.PyTuple_GET_ITEM( */ __pyx_t_13 = ((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_13)) __PYX_ERR(0, 497, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":496 * 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":499 * wbuf.write_int32(-1) * else: * codec = cpython.PyTuple_GET_ITEM( # <<<<<<<<<<<<<< * codecs, i) * codec.encode(settings, wbuf, item) */ /*else*/ { /* "asyncpg/protocol/protocol.pyx":500 * else: * codec = cpython.PyTuple_GET_ITEM( * codecs, i) # <<<<<<<<<<<<<< * codec.encode(settings, wbuf, item) * */ __pyx_t_20 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_codecs, __pyx_cur_scope->__pyx_v_i); /* "asyncpg/protocol/protocol.pyx":499 * wbuf.write_int32(-1) * else: * codec = cpython.PyTuple_GET_ITEM( # <<<<<<<<<<<<<< * codecs, i) * codec.encode(settings, wbuf, item) */ __pyx_t_13 = ((PyObject *)__pyx_t_20); __Pyx_INCREF(__pyx_t_13); __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_13)); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":501 * codec = cpython.PyTuple_GET_ITEM( * codecs, i) * codec.encode(settings, wbuf, item) # <<<<<<<<<<<<<< * * if wbuf.len() >= _COPY_BUFFER_SIZE: */ __pyx_t_13 = __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_13)) __PYX_ERR(0, 501, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __pyx_L53:; } /* "asyncpg/protocol/protocol.pyx":503 * codec.encode(settings, wbuf, item) * * if wbuf.len() >= _COPY_BUFFER_SIZE: # <<<<<<<<<<<<<< * with timer: * await self.writing_allowed.wait() */ __pyx_t_13 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_cur_scope->__pyx_v_wbuf); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 503, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = PyObject_RichCompare(__pyx_t_13, __pyx_mstate_global->__pyx_int_524288, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L8_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 503, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_12) { /* "asyncpg/protocol/protocol.pyx":504 * * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) */ /*with:*/ { __pyx_t_21 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 504, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_13 = NULL; __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 504, __pyx_L55_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14); assert(__pyx_t_13); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_14, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L55_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":505 * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: * await self.writing_allowed.wait() # <<<<<<<<<<<<<< * self._write_copy_data_msg(wbuf) * wbuf = WriteBuffer.new() */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 505, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __pyx_t_13; __Pyx_INCREF(__pyx_t_14); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5, &__pyx_r); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __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_cur_scope->__pyx_t_8 = __pyx_t_10; __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_cur_scope->__pyx_t_9 = __pyx_t_26; __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_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_10 = __pyx_cur_scope->__pyx_t_8; __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_26 = __pyx_cur_scope->__pyx_t_9; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 505, __pyx_L61_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 505, __pyx_L61_error) } /* "asyncpg/protocol/protocol.pyx":504 * * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) */ } __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; goto __pyx_L68_try_end; __pyx_L61_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_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_13, &__pyx_t_14) < 0) __PYX_ERR(0, 504, __pyx_L63_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __pyx_t_4 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L63_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 504, __pyx_L63_except_error) __Pyx_GOTREF(__pyx_t_25); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_25); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (__pyx_t_12 < (0)) __PYX_ERR(0, 504, __pyx_L63_except_error) __pyx_t_1 = (!__pyx_t_12); if (unlikely(__pyx_t_1)) { __Pyx_GIVEREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_13, __pyx_t_14); __pyx_t_5 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __PYX_ERR(0, 504, __pyx_L63_except_error) } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L62_exception_handled; } __pyx_L63_except_error:; __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); goto __pyx_L8_error; __pyx_L62_exception_handled:; __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_L68_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_21) { __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_mstate_global->__pyx_tuple[2], NULL); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 504, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } goto __pyx_L60; } __pyx_L60:; } goto __pyx_L73; __pyx_L55_error:; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; goto __pyx_L8_error; __pyx_L73:; } /* "asyncpg/protocol/protocol.pyx":506 * with timer: * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) # <<<<<<<<<<<<<< * wbuf = WriteBuffer.new() * */ __pyx_t_14 = ((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_14)) __PYX_ERR(0, 506, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "asyncpg/protocol/protocol.pyx":507 * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) * wbuf = WriteBuffer.new() # <<<<<<<<<<<<<< * * # End of binary copy. */ __pyx_t_14 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 507, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_14); __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_14)); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = 0; /* "asyncpg/protocol/protocol.pyx":503 * codec.encode(settings, wbuf, item) * * if wbuf.len() >= _COPY_BUFFER_SIZE: # <<<<<<<<<<<<<< * with timer: * await self.writing_allowed.wait() */ } /* "asyncpg/protocol/protocol.pyx":490 * 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":510 * * # 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, 510, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":511 * # 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, 511, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":448 * * try: * if record_stmt is not None: # <<<<<<<<<<<<<< * # copy_in_records in binary mode * wbuf = WriteBuffer.new() */ goto __pyx_L14; } /* "asyncpg/protocol/protocol.pyx":513 * 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":514 * * elif reader is not None: * try: # <<<<<<<<<<<<<< * aiter = reader.__aiter__ * except AttributeError: */ { __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":515 * 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_mstate_global->__pyx_n_u_aiter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __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":514 * * elif reader is not None: * try: # <<<<<<<<<<<<<< * aiter = reader.__aiter__ * except AttributeError: */ } /* "asyncpg/protocol/protocol.pyx":519 * raise TypeError('reader is not an asynchronous iterable') * else: * iterator = aiter() # <<<<<<<<<<<<<< * * try: */ /*else:*/ { __pyx_t_14 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_aiter); __pyx_t_13 = __pyx_cur_scope->__pyx_v_aiter; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); assert(__pyx_t_14); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_13, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L77_except_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_iterator = __pyx_t_3; __pyx_t_3 = 0; } __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_L80_try_end; __pyx_L75_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_16); __pyx_t_16 = 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; /* "asyncpg/protocol/protocol.pyx":516 * try: * aiter = reader.__aiter__ * except AttributeError: # <<<<<<<<<<<<<< * raise TypeError('reader is not an asynchronous iterable') * else: */ __pyx_t_27 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_AttributeError)))); if (__pyx_t_27) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_13, &__pyx_t_14) < 0) __PYX_ERR(0, 516, __pyx_L77_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); /* "asyncpg/protocol/protocol.pyx":517 * aiter = reader.__aiter__ * except AttributeError: * raise TypeError('reader is not an asynchronous iterable') # <<<<<<<<<<<<<< * else: * iterator = aiter() */ __pyx_t_4 = NULL; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_reader_is_not_an_asynchronous_it}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L77_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(0, 517, __pyx_L77_except_error) } goto __pyx_L77_except_error; /* "asyncpg/protocol/protocol.pyx":514 * * elif reader is not None: * try: # <<<<<<<<<<<<<< * aiter = reader.__aiter__ * except AttributeError: */ __pyx_L77_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_L80_try_end:; } /* "asyncpg/protocol/protocol.pyx":521 * iterator = aiter() * * try: # <<<<<<<<<<<<<< * while True: * # We rely on protocol flow control to moderate the */ { __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":522 * * try: * while True: # <<<<<<<<<<<<<< * # We rely on protocol flow control to moderate the * # rate of data messages. */ while (1) { /* "asyncpg/protocol/protocol.pyx":525 * # 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_24 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 525, __pyx_L83_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_13 = NULL; __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L91_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_13); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL}; __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 525, __pyx_L91_error) __Pyx_GOTREF(__pyx_t_14); } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_25, &__pyx_t_28, &__pyx_t_29); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_28); __Pyx_XGOTREF(__pyx_t_29); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":526 * # rate of data messages. * with timer: * await self.writing_allowed.wait() # <<<<<<<<<<<<<< * with timer: * chunk = await compat.wait_for( */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 526, __pyx_L97_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_3 = __pyx_t_13; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 526, __pyx_L97_error) __Pyx_GOTREF(__pyx_t_14); } __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_14, &__pyx_r); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_0 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_3 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_4 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_5 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_6 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_t_25); __pyx_cur_scope->__pyx_t_7 = __pyx_t_25; __Pyx_XGIVEREF(__pyx_t_28); __pyx_cur_scope->__pyx_t_10 = __pyx_t_28; __Pyx_XGIVEREF(__pyx_t_29); __pyx_cur_scope->__pyx_t_11 = __pyx_t_29; __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_7 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_21 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_22 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_23 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_24); __pyx_t_25 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_25); __pyx_t_28 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_28); __pyx_t_29 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_29); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 526, __pyx_L97_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 526, __pyx_L97_error) } /* "asyncpg/protocol/protocol.pyx":525 * # 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_25); __pyx_t_25 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0; goto __pyx_L104_try_end; __pyx_L97_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_16); __pyx_t_16 = 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; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_13, &__pyx_t_3) < 0) __PYX_ERR(0, 525, __pyx_L99_except_error) __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_14, __pyx_t_13, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L99_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_30 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 525, __pyx_L99_except_error) __Pyx_GOTREF(__pyx_t_30); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_30); __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0; if (__pyx_t_1 < (0)) __PYX_ERR(0, 525, __pyx_L99_except_error) __pyx_t_12 = (!__pyx_t_1); if (unlikely(__pyx_t_12)) { __Pyx_GIVEREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_13, __pyx_t_3); __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 525, __pyx_L99_except_error) } __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L98_exception_handled; } __pyx_L99_except_error:; __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_29); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_28, __pyx_t_29); goto __pyx_L83_error; __pyx_L98_exception_handled:; __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_29); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_28, __pyx_t_29); __pyx_L104_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_24) { __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_mstate_global->__pyx_tuple[2], NULL); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 525, __pyx_L83_error) __Pyx_GOTREF(__pyx_t_29); __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; } goto __pyx_L96; } __pyx_L96:; } goto __pyx_L109; __pyx_L91_error:; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; goto __pyx_L83_error; __pyx_L109:; } /* "asyncpg/protocol/protocol.pyx":527 * with timer: * await self.writing_allowed.wait() * with timer: # <<<<<<<<<<<<<< * chunk = await compat.wait_for( * iterator.__anext__(), */ /*with:*/ { __pyx_t_24 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 527, __pyx_L83_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_13 = NULL; __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 527, __pyx_L110_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14); assert(__pyx_t_13); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_14, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L110_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_29, &__pyx_t_28, &__pyx_t_25); __Pyx_XGOTREF(__pyx_t_29); __Pyx_XGOTREF(__pyx_t_28); __Pyx_XGOTREF(__pyx_t_25); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":528 * await self.writing_allowed.wait() * with timer: * chunk = await compat.wait_for( # <<<<<<<<<<<<<< * iterator.__anext__(), * timeout=timer.get_remaining_budget()) */ __pyx_t_14 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_compat); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 528, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_wait_for); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":529 * with timer: * chunk = await compat.wait_for( * iterator.__anext__(), # <<<<<<<<<<<<<< * timeout=timer.get_remaining_budget()) * self._write_copy_data_msg(chunk) */ __pyx_t_4 = __pyx_cur_scope->__pyx_v_iterator; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_anext, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 529, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_13); } /* "asyncpg/protocol/protocol.pyx":530 * chunk = await compat.wait_for( * iterator.__anext__(), * timeout=timer.get_remaining_budget()) # <<<<<<<<<<<<<< * self._write_copy_data_msg(chunk) * except builtins.StopAsyncIteration: */ __pyx_t_16 = __pyx_cur_scope->__pyx_v_timer; __Pyx_INCREF(__pyx_t_16); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_14); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_14, __pyx_t_13}; __pyx_t_16 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 528, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_16); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_timeout, __pyx_t_4, __pyx_t_16, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 528, __pyx_L116_error) __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_16); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3, &__pyx_r); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_0 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_3 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_4 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_5 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_6 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_t_25); __pyx_cur_scope->__pyx_t_7 = __pyx_t_25; __Pyx_XGIVEREF(__pyx_t_28); __pyx_cur_scope->__pyx_t_10 = __pyx_t_28; __Pyx_XGIVEREF(__pyx_t_29); __pyx_cur_scope->__pyx_t_11 = __pyx_t_29; __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_7 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_21 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_22 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_23 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_24); __pyx_t_25 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_25); __pyx_t_28 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_28); __pyx_t_29 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_29); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 528, __pyx_L116_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_3 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 528, __pyx_L116_error) } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunk); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunk, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":527 * with timer: * await self.writing_allowed.wait() * with timer: # <<<<<<<<<<<<<< * chunk = await compat.wait_for( * iterator.__anext__(), */ } __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; goto __pyx_L123_try_end; __pyx_L116_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_16); __pyx_t_16 = 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; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_16) < 0) __PYX_ERR(0, 527, __pyx_L118_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_4 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_5, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L118_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_30 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 527, __pyx_L118_except_error) __Pyx_GOTREF(__pyx_t_30); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_30); __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0; if (__pyx_t_12 < (0)) __PYX_ERR(0, 527, __pyx_L118_except_error) __pyx_t_1 = (!__pyx_t_12); if (unlikely(__pyx_t_1)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_5, __pyx_t_16); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_16 = 0; __PYX_ERR(0, 527, __pyx_L118_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L117_exception_handled; } __pyx_L118_except_error:; __Pyx_XGIVEREF(__pyx_t_29); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_29, __pyx_t_28, __pyx_t_25); goto __pyx_L83_error; __pyx_L117_exception_handled:; __Pyx_XGIVEREF(__pyx_t_29); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_29, __pyx_t_28, __pyx_t_25); __pyx_L123_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_24) { __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_mstate_global->__pyx_tuple[2], NULL); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 527, __pyx_L83_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; } goto __pyx_L115; } __pyx_L115:; } goto __pyx_L128; __pyx_L110_error:; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; goto __pyx_L83_error; __pyx_L128:; } /* "asyncpg/protocol/protocol.pyx":531 * 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, 531, __pyx_L83_error) } __pyx_t_16 = ((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_16)) __PYX_ERR(0, 531, __pyx_L83_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } /* "asyncpg/protocol/protocol.pyx":521 * iterator = aiter() * * try: # <<<<<<<<<<<<<< * while True: * # We rely on protocol flow control to moderate the */ } __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_L88_try_end; __pyx_L83_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_16); __pyx_t_16 = 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; /* "asyncpg/protocol/protocol.pyx":532 * timeout=timer.get_remaining_budget()) * self._write_copy_data_msg(chunk) * except builtins.StopAsyncIteration: # <<<<<<<<<<<<<< * pass * else: */ __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_5, &__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_builtins); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L85_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_StopAsyncIteration); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 532, __pyx_L85_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_27 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_16, __pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_ErrRestore(__pyx_t_16, __pyx_t_5, __pyx_t_3); __pyx_t_16 = 0; __pyx_t_5 = 0; __pyx_t_3 = 0; if (__pyx_t_27) { __Pyx_ErrRestore(0,0,0); goto __pyx_L84_exception_handled; } goto __pyx_L85_except_error; /* "asyncpg/protocol/protocol.pyx":521 * iterator = aiter() * * try: # <<<<<<<<<<<<<< * while True: * # We rely on protocol flow control to moderate the */ __pyx_L85_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_L84_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_L88_try_end:; } /* "asyncpg/protocol/protocol.pyx":513 * self._write_copy_data_msg(wbuf) * * elif reader is not None: # <<<<<<<<<<<<<< * try: * aiter = reader.__aiter__ */ goto __pyx_L14; } /* "asyncpg/protocol/protocol.pyx":536 * else: * # Buffer passed in directly. * await self.writing_allowed.wait() # <<<<<<<<<<<<<< * self._write_copy_data_msg(data) * */ /*else*/ { __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 536, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_5 = __pyx_t_16; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3, &__pyx_r); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_0 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_1 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_2 = __pyx_t_9; __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_L131_resume_from_await:; __pyx_t_7 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 536, __pyx_L8_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 536, __pyx_L8_error) } /* "asyncpg/protocol/protocol.pyx":537 * # Buffer passed in directly. * await self.writing_allowed.wait() * self._write_copy_data_msg(data) # <<<<<<<<<<<<<< * * except asyncio.TimeoutError: */ __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), __pyx_cur_scope->__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L14:; /* "asyncpg/protocol/protocol.pyx":447 * self._copy_in(copy_stmt) * * try: # <<<<<<<<<<<<<< * if record_stmt is not None: * # copy_in_records in binary mode */ } __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_L13_try_end; __pyx_L8_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_16); __pyx_t_16 = 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; /* "asyncpg/protocol/protocol.pyx":539 * self._write_copy_data_msg(data) * * except asyncio.TimeoutError: # <<<<<<<<<<<<<< * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) */ __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_16, &__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 539, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_27 = __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_16, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_16 = 0; __pyx_t_5 = 0; if (__pyx_t_27) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_16, &__pyx_t_3) < 0) __PYX_ERR(0, 539, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_3); /* "asyncpg/protocol/protocol.pyx":540 * * except asyncio.TimeoutError: * self._write_copy_fail_msg('TimeoutError') # <<<<<<<<<<<<<< * self._on_timeout(self.waiter) * try: */ __pyx_t_4 = ((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_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":541 * except asyncio.TimeoutError: * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) # <<<<<<<<<<<<<< * try: * await waiter */ __pyx_t_13 = ((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_INCREF(__pyx_t_13); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_cur_scope->__pyx_v_self->waiter}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_on_timeout, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":542 * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) * try: # <<<<<<<<<<<<<< * await waiter * except TimeoutError: */ { __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":543 * self._on_timeout(self.waiter) * try: * await waiter # <<<<<<<<<<<<<< * except TimeoutError: * raise */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_1 = __pyx_t_5; __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_9); __pyx_cur_scope->__pyx_t_4 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_t_5 = __pyx_t_16; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_6 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_7 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_10 = __pyx_t_23; __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_L142_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_5 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_5); __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_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_16 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_16); __pyx_t_21 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_22 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_23 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_23); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 543, __pyx_L134_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 543, __pyx_L134_error) } /* "asyncpg/protocol/protocol.pyx":542 * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) * try: # <<<<<<<<<<<<<< * await waiter * except TimeoutError: */ } /* "asyncpg/protocol/protocol.pyx":547 * raise * else: * raise apg_exc.InternalClientError('TimoutError was not raised') # <<<<<<<<<<<<<< * * except (Exception, asyncio.CancelledError) as e: */ /*else:*/ { __pyx_t_13 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 547, __pyx_L136_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L136_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15); assert(__pyx_t_13); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_15, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_TimoutError_was_not_raised}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L136_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, 547, __pyx_L136_except_error) } __pyx_L134_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_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":544 * try: * await waiter * except TimeoutError: # <<<<<<<<<<<<<< * raise * else: */ __pyx_t_27 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TimeoutError)))); if (__pyx_t_27) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_15, &__pyx_t_13) < 0) __PYX_ERR(0, 544, __pyx_L136_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); /* "asyncpg/protocol/protocol.pyx":545 * await waiter * except TimeoutError: * raise # <<<<<<<<<<<<<< * else: * raise apg_exc.InternalClientError('TimoutError was not raised') */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_15, __pyx_t_13); __pyx_t_4 = 0; __pyx_t_15 = 0; __pyx_t_13 = 0; __PYX_ERR(0, 545, __pyx_L136_except_error) } goto __pyx_L136_except_error; /* "asyncpg/protocol/protocol.pyx":542 * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) * try: # <<<<<<<<<<<<<< * await waiter * except TimeoutError: */ __pyx_L136_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_L10_except_error; } } /* "asyncpg/protocol/protocol.pyx":549 * 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_3, &__pyx_t_16, &__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 549, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_CancelledError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 549, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_27 = __Pyx_PyErr_GivenExceptionMatches2(__pyx_t_3, ((PyObject *)(((PyTypeObject*)PyExc_Exception))), __pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_ErrRestore(__pyx_t_3, __pyx_t_16, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_16 = 0; __pyx_t_5 = 0; if (__pyx_t_27) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_16, &__pyx_t_3) < 0) __PYX_ERR(0, 549, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_v_e = __pyx_t_16; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":550 * * 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_15 = __Pyx_PyObject_Unicode(__pyx_cur_scope->__pyx_v_e); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 550, __pyx_L150_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_13 = ((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_15)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 550, __pyx_L150_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":551 * 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_15 = ((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_INCREF(__pyx_t_15); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL}; __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 551, __pyx_L150_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":553 * self._request_cancel() * # Make asyncio shut up about unretrieved QueryCanceledError * waiter.add_done_callback(lambda f: f.exception()) # <<<<<<<<<<<<<< * raise * */ __pyx_t_15 = __pyx_cur_scope->__pyx_v_waiter; __Pyx_INCREF(__pyx_t_15); __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7, 0, __pyx_mstate_global->__pyx_n_u_copy_in_locals_lambda, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L150_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_4}; __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_done_callback, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 553, __pyx_L150_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":554 * # 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_5); __Pyx_GIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_16, __pyx_t_3); __pyx_t_5 = 0; __pyx_t_16 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 554, __pyx_L150_error) } /* "asyncpg/protocol/protocol.pyx":549 * 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_L150_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_28 = 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_4); __pyx_t_4 = 0; __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_28); if ( unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_28); __pyx_t_27 = __pyx_lineno; __pyx_t_31 = __pyx_clineno; __pyx_t_32 = __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; } __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_28); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_23, __pyx_t_22, __pyx_t_21); __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_28 = 0; __pyx_lineno = __pyx_t_27; __pyx_clineno = __pyx_t_31; __pyx_filename = __pyx_t_32; goto __pyx_L10_except_error; } } } goto __pyx_L10_except_error; /* "asyncpg/protocol/protocol.pyx":447 * 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_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_L13_try_end:; } /* "asyncpg/protocol/protocol.pyx":556 * raise * * self._write_copy_done_msg() # <<<<<<<<<<<<<< * * status_msg = await waiter */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":558 * self._write_copy_done_msg() * * status_msg = await waiter # <<<<<<<<<<<<<< * * return status_msg */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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_L156_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 558, __pyx_L1_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_3 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 558, __pyx_L1_error) } __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_status_msg = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":560 * status_msg = await waiter * * return status_msg # <<<<<<<<<<<<<< * * async def close_statement(self, PreparedStatementState state, timeout): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_status_msg); __pyx_r = __pyx_cur_scope->__pyx_v_status_msg; goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":424 * return status_msg * * async def copy_in(self, copy_stmt, reader, data, # <<<<<<<<<<<<<< * records, PreparedStatementState record_stmt, timeout): * 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_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("copy_in", __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_12BaseProtocol_39generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":562 * return status_msg * * async def close_statement(self, PreparedStatementState state, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_timeout,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 562, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 562, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 562, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "close_statement", 0) < (0)) __PYX_ERR(0, 562, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("close_statement", 1, 2, 2, i); __PYX_ERR(0, 562, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 562, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 562, __pyx_L3_error) } __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, 562, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 562, __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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, __pyx_mstate_global->__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, 562, __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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_39generator9, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_close_statement, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close_statement, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 562, __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; __Pyx_PySendResult __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; size_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; 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("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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 562, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":563 * * 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":564 * 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 564, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 564, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":563 * * 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":565 * 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":566 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 566, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 566, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":567 * 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":565 * 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":569 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * * if state.refs != 0: */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":571 * 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":572 * * if state.refs != 0: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'cannot close prepared statement; refs == {} != 0'.format( * state.refs)) */ __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":573 * if state.refs != 0: * raise apg_exc.InternalClientError( * 'cannot close prepared statement; refs == {} != 0'.format( # <<<<<<<<<<<<<< * state.refs)) * */ __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_cannot_close_prepared_statement; __Pyx_INCREF(__pyx_t_7); /* "asyncpg/protocol/protocol.pyx":574 * raise apg_exc.InternalClientError( * 'cannot close prepared statement; refs == {} != 0'.format( * state.refs)) # <<<<<<<<<<<<<< * * timeout = self._get_timeout_impl(timeout) */ __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_cur_scope->__pyx_v_state->refs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __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(0, 572, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":571 * self._check_state() * * if state.refs != 0: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'cannot close prepared statement; refs == {} != 0'.format( */ } /* "asyncpg/protocol/protocol.pyx":576 * state.refs)) * * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * waiter = self._new_waiter(timeout) * try: */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":577 * * timeout = self._get_timeout_impl(timeout) * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._close(state.name, False) # network op */ __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_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":578 * 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_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":579 * waiter = self._new_waiter(timeout) * try: * self._close(state.name, False) # network op # <<<<<<<<<<<<<< * state.closed = True * except Exception as ex: */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = ((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_3), 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":580 * 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":578 * 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_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_L17_try_end; __pyx_L12_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; __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; /* "asyncpg/protocol/protocol.pyx":581 * self._close(state.name, False) # network op * state.closed = True * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_13) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(0, 581, __pyx_L14_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_ex = __pyx_t_3; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":582 * state.closed = True * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_8 = __pyx_cur_scope->__pyx_v_waiter; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":583 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_4 = ((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_4)) __PYX_ERR(0, 583, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/protocol.pyx":581 * 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_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_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ( 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_13 = __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; } __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_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L14_except_error; } __pyx_L24:; } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L13_exception_handled; } goto __pyx_L14_except_error; /* "asyncpg/protocol/protocol.pyx":578 * 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_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L10_error; __pyx_L13_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_L17_try_end:; } } /* "asyncpg/protocol/protocol.pyx":585 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * def is_closed(self): */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 585, __pyx_L1_error) __pyx_t_5 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_5); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_5 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 585, __pyx_L1_error) } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } __pyx_L10_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 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; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__pyx_r); __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_0 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_1 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_2 = __pyx_t_12; __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_10 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_12); __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, 585, __pyx_L31_error) __pyx_t_5 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_5); } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __pyx_t_5 = __pyx_r; __pyx_r = NULL; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 585, __pyx_L31_error) } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L30_return; } __pyx_L30_return:; __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_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; goto __pyx_L0; __pyx_L31_error:; __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_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 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":562 * return status_msg * * async def close_statement(self, PreparedStatementState state, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ /* 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); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("close_statement", __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/protocol.pyx":587 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_closed", __pyx_kwds); 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", 0); /* "asyncpg/protocol/protocol.pyx":588 * * 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, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":587 * 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":590 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_connected", __pyx_kwds); 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", 0); /* "asyncpg/protocol/protocol.pyx":591 * * 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, 591, __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, 591, __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":590 * 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":593 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("abort", __pyx_kwds); 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("abort", 0); /* "asyncpg/protocol/protocol.pyx":594 * * def abort(self): * if self.closing: # <<<<<<<<<<<<<< * return * self.closing = True */ if (__pyx_v_self->closing) { /* "asyncpg/protocol/protocol.pyx":595 * 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":594 * * def abort(self): * if self.closing: # <<<<<<<<<<<<<< * return * self.closing = True */ } /* "asyncpg/protocol/protocol.pyx":596 * 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":597 * 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, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":598 * 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, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":599 * self._handle_waiter_on_connection_lost(None) * self._terminate() * self.transport.abort() # <<<<<<<<<<<<<< * self.transport = None * */ __pyx_t_2 = __pyx_v_self->__pyx_base.transport; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":600 * self._terminate() * self.transport.abort() * self.transport = None # <<<<<<<<<<<<<< * * async def close(self, timeout): */ __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":593 * 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_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":602 * self.transport = None * * async def close(self, timeout): # <<<<<<<<<<<<<< * if self.closing: * return */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_timeout,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 602, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 602, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "close", 0) < (0)) __PYX_ERR(0, 602, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("close", 1, 1, 1, i); __PYX_ERR(0, 602, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 602, __pyx_L3_error) } __pyx_v_timeout = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("close", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 602, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, __pyx_mstate_global->__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, 602, __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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_48generator10, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_close, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 602, __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; __Pyx_PySendResult __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; size_t __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; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = 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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 602, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":603 * * async def close(self, timeout): * if self.closing: # <<<<<<<<<<<<<< * return * */ if (__pyx_cur_scope->__pyx_v_self->closing) { /* "asyncpg/protocol/protocol.pyx":604 * async def close(self, timeout): * if self.closing: * return # <<<<<<<<<<<<<< * * self.closing = True */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":603 * * async def close(self, timeout): * if self.closing: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/protocol.pyx":606 * return * * self.closing = True # <<<<<<<<<<<<<< * * if self.cancel_sent_waiter is not None: */ __pyx_cur_scope->__pyx_v_self->closing = 1; /* "asyncpg/protocol/protocol.pyx":608 * 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":609 * * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 609, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 609, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":610 * 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":608 * 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":612 * 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":613 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * * if self.waiter is not None: */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 613, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 613, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":612 * self.cancel_sent_waiter = None * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * */ } /* "asyncpg/protocol/protocol.pyx":615 * 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":617 * 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_4 = ((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":618 * # 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 618, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 618, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":619 * 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":620 * 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":621 * self.cancel_sent_waiter = None * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * * assert self.waiter is None */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 621, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 621, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":620 * 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":615 * 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":623 * 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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0); __PYX_ERR(0, 623, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 623, __pyx_L1_error) #endif /* "asyncpg/protocol/protocol.pyx":625 * assert self.waiter is None * * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * * # Ask the server to terminate the connection and wait for it */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":629 * # Ask the server to terminate the connection and wait for it * # to drop. * self.waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * self._terminate() * try: */ __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_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __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_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":630 * # to drop. * self.waiter = self._new_waiter(timeout) * self._terminate() # <<<<<<<<<<<<<< * try: * await self.waiter */ __pyx_t_3 = ((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_3)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":631 * 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":632 * self._terminate() * try: * await self.waiter # <<<<<<<<<<<<<< * except ConnectionResetError: * # There appears to be a difference in behaviour of asyncio */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 632, __pyx_L16_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 632, __pyx_L16_error) } /* "asyncpg/protocol/protocol.pyx":631 * 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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":633 * 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_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ConnectionResetError)))); if (__pyx_t_9) { __Pyx_ErrRestore(0,0,0); goto __pyx_L17_exception_handled; } goto __pyx_L18_except_error; /* "asyncpg/protocol/protocol.pyx":631 * 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":639 * 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":640 * finally: * self.waiter = None * self.transport.abort() # <<<<<<<<<<<<<< * * def _request_cancel(self): */ __pyx_t_4 = __pyx_cur_scope->__pyx_v_self->__pyx_base.transport; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); if ( 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_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { /* "asyncpg/protocol/protocol.pyx":639 * 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":640 * finally: * self.waiter = None * self.transport.abort() # <<<<<<<<<<<<<< * * def _request_cancel(self): */ __pyx_t_4 = __pyx_cur_scope->__pyx_v_self->__pyx_base.transport; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); __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_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L1_error; __pyx_L26_error:; __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); __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_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; goto __pyx_L1_error; } __pyx_L15:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":602 * self.transport = None * * async def close(self, timeout): # <<<<<<<<<<<<<< * 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_3); __Pyx_XDECREF(__pyx_t_4); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("close", __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/protocol.pyx":642 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_request_cancel", __pyx_kwds); 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; size_t __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_request_cancel", 0); /* "asyncpg/protocol/protocol.pyx":643 * * def _request_cancel(self): * self.cancel_waiter = self.create_future() # <<<<<<<<<<<<<< * self.cancel_sent_waiter = self.create_future() * */ __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_self->create_future); __pyx_t_3 = __pyx_v_self->create_future; __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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":644 * def _request_cancel(self): * self.cancel_waiter = self.create_future() * self.cancel_sent_waiter = self.create_future() # <<<<<<<<<<<<<< * * con = self.get_connection() */ __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_self->create_future); __pyx_t_2 = __pyx_v_self->create_future; __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __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":646 * 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, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_con = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":647 * * 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":650 * # 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_v_con; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->cancel_sent_waiter}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cancel_current_command, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":647 * * 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":652 * 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_v_self->loop; __Pyx_INCREF(__pyx_t_2); /* "asyncpg/protocol/protocol.pyx":653 * 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, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_kp_u_asyncpg_Protocol_has_no_referenc) < (0)) __PYX_ERR(0, 653, __pyx_L1_error) __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_call_exception_handler, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":658 * 'github.com/magicstack/asyncpg.' * }) * self.abort() # <<<<<<<<<<<<<< * * if self.state == PROTOCOL_PREPARE: */ __pyx_t_3 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":660 * 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":666 * # 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_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((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_3)) __PYX_ERR(0, 666, __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/protocol.pyx":660 * 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":667 * # 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_3 = ((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_3)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":642 * 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_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":669 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fut,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 669, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 669, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_on_timeout", 0) < (0)) __PYX_ERR(0, 669, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_on_timeout", 1, 1, 1, i); __PYX_ERR(0, 669, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 669, __pyx_L3_error) } __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, 669, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; size_t __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_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_timeout", 0); /* "asyncpg/protocol/protocol.pyx":670 * * 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_v_fut; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __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(0, 670, __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":671 * 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":672 * 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":670 * * 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":673 * 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":670 * * 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":674 * self.timeout_handle is None: * return * self._request_cancel() # <<<<<<<<<<<<<< * self.waiter.set_exception(asyncio.TimeoutError()) * */ __pyx_t_4 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":675 * return * self._request_cancel() * self.waiter.set_exception(asyncio.TimeoutError()) # <<<<<<<<<<<<<< * * def _on_waiter_completed(self, fut): */ __pyx_t_4 = __pyx_v_self->waiter; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":669 * 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_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __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":677 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fut,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 677, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 677, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_on_waiter_completed", 0) < (0)) __PYX_ERR(0, 677, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_on_waiter_completed", 1, 1, 1, i); __PYX_ERR(0, 677, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 677, __pyx_L3_error) } __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, 677, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; size_t __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_waiter_completed", 0); /* "asyncpg/protocol/protocol.pyx":678 * * 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, 678, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":679 * 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_v_self->timeout_handle; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cancel, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":680 * 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":678 * * def _on_waiter_completed(self, fut): * if self.timeout_handle: # <<<<<<<<<<<<<< * self.timeout_handle.cancel() * self.timeout_handle = None */ } /* "asyncpg/protocol/protocol.pyx":681 * 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_5 = (__pyx_v_fut != __pyx_v_self->waiter); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->cancel_waiter != Py_None); __pyx_t_1 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":682 * 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":681 * 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":683 * if fut is not self.waiter or self.cancel_waiter is not None: * return * if fut.cancelled(): # <<<<<<<<<<<<<< * self._request_cancel() * */ __pyx_t_3 = __pyx_v_fut; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cancelled, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":684 * return * if fut.cancelled(): * self._request_cancel() # <<<<<<<<<<<<<< * * def _create_future_fallback(self): */ __pyx_t_3 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":683 * if fut is not self.waiter or self.cancel_waiter is not None: * return * if fut.cancelled(): # <<<<<<<<<<<<<< * self._request_cancel() * */ } /* "asyncpg/protocol/protocol.pyx":677 * 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_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":686 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_create_future_fallback", __pyx_kwds); 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; PyObject *__pyx_t_4 = NULL; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_create_future_fallback", 0); /* "asyncpg/protocol/protocol.pyx":687 * * def _create_future_fallback(self): * return asyncio.Future(loop=self.loop) # <<<<<<<<<<<<<< * * cdef _handle_waiter_on_connection_lost(self, cause): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Future); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_loop, __pyx_v_self->loop, __pyx_t_3, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 687, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":686 * 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_XDECREF(__pyx_t_4); __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":689 * 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; size_t __pyx_t_5; 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("_handle_waiter_on_connection_lost", 0); /* "asyncpg/protocol/protocol.pyx":690 * * 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_v_self->waiter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __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(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (!__pyx_t_2); __pyx_t_1 = __pyx_t_6; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":691 * 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_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ConnectionDoesNotExistError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_connection_was_closed_in_the_mid}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_v_exc = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":694 * '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":695 * '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_mstate_global->__pyx_n_u_cause, __pyx_v_cause) < (0)) __PYX_ERR(0, 695, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":694 * '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":696 * if cause is not None: * exc.__cause__ = cause * self.waiter.set_exception(exc) # <<<<<<<<<<<<<< * self.waiter = None * */ __pyx_t_8 = __pyx_v_self->waiter; __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_exc}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":690 * * 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":697 * 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":689 * 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_7); __Pyx_XDECREF(__pyx_t_8); __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":699 * 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; 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("_set_server_parameter", 0); /* "asyncpg/protocol/protocol.pyx":700 * * cdef _set_server_parameter(self, name, val): * self.settings.add_setting(name, val) # <<<<<<<<<<<<<< * * def _get_timeout(self, timeout): */ __pyx_t_1 = __pyx_v_name; __Pyx_INCREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 700, __pyx_L1_error) __pyx_t_2 = __pyx_v_val; __Pyx_INCREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 700, __pyx_L1_error) __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting(__pyx_v_self->settings, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 700, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":699 * 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_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __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":702 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_timeout,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 702, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 702, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_timeout", 0) < (0)) __PYX_ERR(0, 702, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_timeout", 1, 1, 1, i); __PYX_ERR(0, 702, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 702, __pyx_L3_error) } __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, 702, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_12 = NULL; size_t __pyx_t_13; 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":703 * * 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":704 * 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":705 * 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":706 * try: * if type(timeout) is bool: * raise ValueError # <<<<<<<<<<<<<< * timeout = float(timeout) * except ValueError: */ __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), 0, 0, 0); __PYX_ERR(0, 706, __pyx_L4_error) /* "asyncpg/protocol/protocol.pyx":705 * if timeout is not None: * try: * if type(timeout) is bool: # <<<<<<<<<<<<<< * raise ValueError * timeout = float(timeout) */ } /* "asyncpg/protocol/protocol.pyx":707 * 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, 707, __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":704 * 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":708 * raise ValueError * timeout = float(timeout) * except ValueError: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid timeout value: expected non-negative float ' */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_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, 708, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /* "asyncpg/protocol/protocol.pyx":709 * timeout = float(timeout) * except ValueError: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid timeout value: expected non-negative float ' * '(got {!r})'.format(timeout)) from None */ __pyx_t_10 = NULL; /* "asyncpg/protocol/protocol.pyx":711 * raise ValueError( * 'invalid timeout value: expected non-negative float ' * '(got {!r})'.format(timeout)) from None # <<<<<<<<<<<<<< * * return self._get_timeout_impl(timeout) */ __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_invalid_timeout_value_expected_n; __Pyx_INCREF(__pyx_t_12); __pyx_t_13 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_timeout}; __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 711, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_13 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 709, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(0, 709, __pyx_L6_except_error) } goto __pyx_L6_except_error; /* "asyncpg/protocol/protocol.pyx":704 * 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":703 * * def _get_timeout(self, timeout): * if timeout is not None: # <<<<<<<<<<<<<< * try: * if type(timeout) is bool: */ } /* "asyncpg/protocol/protocol.pyx":713 * '(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, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":702 * 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_XDECREF(__pyx_t_12); __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":715 * 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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; 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":716 * * 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":717 * 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, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __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_mstate_global->__pyx_n_u_command_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __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":716 * * 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":718 * 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_mstate_global->__pyx_n_u_NO_TIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __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":719 * 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":718 * 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":721 * 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, 721, __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":723 * 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_mstate_global->__pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 723, __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":724 * * if timeout is not None and timeout <= 0: * raise asyncio.TimeoutError() # <<<<<<<<<<<<<< * return timeout * */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __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(0, 724, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":723 * timeout = float(timeout) * * if timeout is not None and timeout <= 0: # <<<<<<<<<<<<<< * raise asyncio.TimeoutError() * return timeout */ } /* "asyncpg/protocol/protocol.pyx":725 * 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":715 * 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_XDECREF(__pyx_t_6); __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":727 * 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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_check_state", 0); /* "asyncpg/protocol/protocol.pyx":728 * * 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":729 * 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_another}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __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(0, 729, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":728 * * 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":731 * 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":732 * '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_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_connect}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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, 732, __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(0, 732, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":731 * 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":734 * 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_7 = (__pyx_v_self->waiter != Py_None); if (!__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L6_bool_binop_done; } __pyx_t_7 = (__pyx_v_self->timeout_handle != Py_None); __pyx_t_1 = __pyx_t_7; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":735 * '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_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_another_2}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __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(0, 735, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":734 * 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":727 * 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_XDECREF(__pyx_t_5); __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":738 * '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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_is_cancelling", __pyx_kwds); 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", 0); /* "asyncpg/protocol/protocol.pyx":739 * * 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":740 * 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, 740, __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":741 * 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, 741, __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":738 * '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":744 * ) * * async def _wait_for_cancellation(self): # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ /* 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_wait_for_cancellation", __pyx_kwds); 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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, __pyx_mstate_global->__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, 744, __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_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_63generator11, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_wait_for_cancellation, __pyx_mstate_global->__pyx_n_u_BaseProtocol__wait_for_cancellat, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 744, __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; __Pyx_PySendResult __pyx_t_2; 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 != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine"); __PYX_ERR(0, 744, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":745 * * 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":746 * 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_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 746, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 746, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":747 * 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":745 * * 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":748 * 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":749 * self.cancel_sent_waiter = None * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * * cdef _coreproto_error(self): */ __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r); if (likely(__pyx_t_2 == PYGEN_NEXT)) { __Pyx_GOTREF(__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, 749, __pyx_L1_error) } else if (likely(__pyx_t_2 == PYGEN_RETURN)) { __Pyx_GOTREF(__pyx_r); __Pyx_DECREF(__pyx_r); __pyx_r = 0; } else { __Pyx_XGOTREF(__pyx_r); __PYX_ERR(0, 749, __pyx_L1_error) } /* "asyncpg/protocol/protocol.pyx":748 * 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":744 * ) * * async def _wait_for_cancellation(self): # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("_wait_for_cancellation", __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/protocol.pyx":751 * 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; size_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __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("_coreproto_error", 0); /* "asyncpg/protocol/protocol.pyx":752 * * cdef _coreproto_error(self): * try: # <<<<<<<<<<<<<< * if self.waiter is not None: * if not self.waiter.done(): */ /*try:*/ { /* "asyncpg/protocol/protocol.pyx":753 * 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":754 * 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_v_self->waiter; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 754, __pyx_L4_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = (!__pyx_t_1); if (unlikely(__pyx_t_5)) { /* "asyncpg/protocol/protocol.pyx":755 * 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 755, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 755, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_waiter_is_not_done_while_handlin}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L4_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(0, 755, __pyx_L4_error) /* "asyncpg/protocol/protocol.pyx":754 * 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":758 * '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":753 * cdef _coreproto_error(self): * try: * if self.waiter is not None: # <<<<<<<<<<<<<< * if not self.waiter.done(): * raise apg_exc.InternalClientError( */ } } /* "asyncpg/protocol/protocol.pyx":760 * self.waiter = None * finally: * self.abort() # <<<<<<<<<<<<<< * * cdef _new_waiter(self, timeout): */ /*finally:*/ { /*normal exit:*/{ __pyx_t_7 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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_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_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ( 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_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { __pyx_t_7 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __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_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; __pyx_L9_error:; __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_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_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "asyncpg/protocol/protocol.pyx":751 * 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_6); __Pyx_XDECREF(__pyx_t_7); __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":762 * 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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_new_waiter", 0); /* "asyncpg/protocol/protocol.pyx":763 * * 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":764 * 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_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_another_2}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __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(0, 764, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":763 * * 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":766 * 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_t_5 = NULL; __Pyx_INCREF(__pyx_v_self->create_future); __pyx_t_3 = __pyx_v_self->create_future; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __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":767 * '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":768 * 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_3 = __pyx_v_self->loop; __Pyx_INCREF(__pyx_t_3); /* "asyncpg/protocol/protocol.pyx":769 * 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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_on_timeout); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_timeout, __pyx_t_5, __pyx_v_self->waiter}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_call_later, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } /* "asyncpg/protocol/protocol.pyx":768 * 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":767 * '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":770 * 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_5 = __pyx_v_self->waiter; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_on_waiter_completed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_done_callback, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":771 * 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":762 * 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_5); __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":773 * 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__connect", 0); /* "asyncpg/protocol/protocol.pyx":774 * * cdef _on_result__connect(self, object waiter): * waiter.set_result(True) # <<<<<<<<<<<<<< * * cdef _on_result__prepare(self, object waiter): */ __pyx_t_2 = __pyx_v_waiter; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, Py_True}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":773 * 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_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":776 * 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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__prepare", 0); /* "asyncpg/protocol/protocol.pyx":777 * * 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":778 * 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":779 * if PG_DEBUG: * if self.statement is None: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_on_result__prepare: statement is None') * */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_on_result__prepare_statement_is}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __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(0, 779, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":778 * 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":777 * * cdef _on_result__prepare(self, object waiter): * if PG_DEBUG: # <<<<<<<<<<<<<< * if self.statement is None: * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/protocol.pyx":782 * '_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":783 * * 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_5 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc(__pyx_v_self->statement, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":782 * '_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":784 * 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":785 * 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_5 = __pyx_v_self->__pyx_base.result_row_desc; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc(__pyx_v_self->statement, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":784 * 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":786 * 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_5 = __pyx_v_waiter; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->statement)}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":776 * 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_XDECREF(__pyx_t_5); __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":788 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__bind_and_exec", 0); /* "asyncpg/protocol/protocol.pyx":789 * * 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":790 * 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_v_waiter; __Pyx_INCREF(__pyx_t_2); /* "asyncpg/protocol/protocol.pyx":793 * 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, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/protocol.pyx":791 * 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, 791, __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) != (0)) __PYX_ERR(0, 791, __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) != (0)) __PYX_ERR(0, 791, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 791, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":789 * * 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":795 * self.result_execute_completed)) * else: * waiter.set_result(self.result) # <<<<<<<<<<<<<< * * cdef _on_result__bind(self, object waiter): */ /*else*/ { __pyx_t_4 = __pyx_v_waiter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->__pyx_base.result}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":788 * 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":797 * 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__bind", 0); /* "asyncpg/protocol/protocol.pyx":798 * * 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_v_waiter; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.result}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":797 * 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_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":800 * 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__close_stmt_or_portal", 0); /* "asyncpg/protocol/protocol.pyx":801 * * 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_v_waiter; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.result}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":800 * 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_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":803 * 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; size_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__simple_query", 0); /* "asyncpg/protocol/protocol.pyx":804 * * 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_v_waiter; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_v_self->__pyx_base.result_status_msg; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->__pyx_base.encoding}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":803 * 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_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":806 * 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; size_t __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("_on_result__copy_out", 0); /* "asyncpg/protocol/protocol.pyx":807 * * 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":808 * 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":809 * 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_v_self->__pyx_base.result_status_msg; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.encoding}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_status_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":808 * 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":811 * 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 = ((PyObject*)Py_None); } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":815 * # 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, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":817 * self.pause_reading() * * waiter.set_result((self.result, copy_done, status_msg)) # <<<<<<<<<<<<<< * * cdef _on_result__copy_in(self, object waiter): */ __pyx_t_2 = __pyx_v_waiter; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_copy_done); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __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) != (0)) __PYX_ERR(0, 817, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 817, __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) != (0)) __PYX_ERR(0, 817, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":806 * 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_4); __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":819 * 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__copy_in", 0); /* "asyncpg/protocol/protocol.pyx":820 * * 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_v_self->__pyx_base.result_status_msg; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.encoding}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_status_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":821 * 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_v_waiter; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_status_msg}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":819 * 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_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":823 * 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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decode_row", 0); /* "asyncpg/protocol/protocol.pyx":824 * * 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":825 * 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":826 * if PG_DEBUG: * if self.statement is None: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_decode_row: statement is None') * */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_decode_row_statement_is_None}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __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(0, 826, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":825 * 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":824 * * 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":829 * '_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, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":823 * 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_XDECREF(__pyx_t_5); __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":831 * 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; PyObject *__pyx_t_5 = NULL; size_t __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; 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", 0); /* "asyncpg/protocol/protocol.pyx":832 * * 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":833 * 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":835 * 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":836 * * 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":837 * if PG_DEBUG: * if waiter is None: * raise apg_exc.InternalClientError('_on_result: waiter is None') # <<<<<<<<<<<<<< * * if waiter.cancelled(): */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_on_result_waiter_is_None}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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, 837, __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(0, 837, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":836 * * if PG_DEBUG: * if waiter is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is None') * */ } /* "asyncpg/protocol/protocol.pyx":835 * self.waiter = None * * if PG_DEBUG: # <<<<<<<<<<<<<< * if waiter is None: * raise apg_exc.InternalClientError('_on_result: waiter is None') */ } /* "asyncpg/protocol/protocol.pyx":839 * raise apg_exc.InternalClientError('_on_result: waiter is None') * * if waiter.cancelled(): # <<<<<<<<<<<<<< * return * */ __pyx_t_5 = __pyx_v_waiter; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cancelled, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __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(0, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":840 * * 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":839 * raise apg_exc.InternalClientError('_on_result: waiter is None') * * if waiter.cancelled(): # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/protocol.pyx":842 * return * * if waiter.done(): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is done') * */ __pyx_t_5 = __pyx_v_waiter; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __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(0, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/protocol.pyx":843 * * if waiter.done(): * raise apg_exc.InternalClientError('_on_result: waiter is done') # <<<<<<<<<<<<<< * * if self.result_type == RESULT_FAILED: */ __pyx_t_5 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_on_result_waiter_is_done}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __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(0, 843, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":842 * return * * if waiter.done(): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is done') * */ } /* "asyncpg/protocol/protocol.pyx":845 * 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":846 * * 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":847 * 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_5, __pyx_mstate_global->__pyx_n_u_apg_exc_base); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PostgresError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); /* "asyncpg/protocol/protocol.pyx":848 * if isinstance(self.result, dict): * exc = apg_exc_base.PostgresError.new( * self.result, query=self.last_query) # <<<<<<<<<<<<<< * else: * exc = self.result */ __pyx_t_6 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_self->__pyx_base.result}; __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_query, __pyx_v_self->last_query, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 847, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_exc = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":846 * * 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":850 * self.result, query=self.last_query) * else: * exc = self.result # <<<<<<<<<<<<<< * waiter.set_exception(exc) * return */ /*else*/ { __pyx_t_1 = __pyx_v_self->__pyx_base.result; __Pyx_INCREF(__pyx_t_1); __pyx_v_exc = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L8:; /* "asyncpg/protocol/protocol.pyx":851 * else: * exc = self.result * waiter.set_exception(exc) # <<<<<<<<<<<<<< * return * */ __pyx_t_3 = __pyx_v_waiter; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_exc}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":852 * 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":845 * 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":854 * 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":855 * * 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":856 * try: * if self.state == PROTOCOL_AUTH: * self._on_result__connect(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_PREPARE: */ __pyx_t_1 = ((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_1)) __PYX_ERR(0, 856, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":855 * * try: * if self.state == PROTOCOL_AUTH: # <<<<<<<<<<<<<< * self._on_result__connect(waiter) * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE: /* "asyncpg/protocol/protocol.pyx":859 * * elif self.state == PROTOCOL_PREPARE: * self._on_result__prepare(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_BIND_EXECUTE: */ __pyx_t_1 = ((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_1)) __PYX_ERR(0, 859, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":858 * 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":862 * * elif self.state == PROTOCOL_BIND_EXECUTE: * self._on_result__bind_and_exec(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_BIND_EXECUTE_MANY: */ __pyx_t_1 = ((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_1)) __PYX_ERR(0, 862, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":861 * 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":865 * * elif self.state == PROTOCOL_BIND_EXECUTE_MANY: * self._on_result__bind_and_exec(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_EXECUTE: */ __pyx_t_1 = ((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_1)) __PYX_ERR(0, 865, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":864 * 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":868 * * elif self.state == PROTOCOL_EXECUTE: * self._on_result__bind_and_exec(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_BIND: */ __pyx_t_1 = ((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_1)) __PYX_ERR(0, 868, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":867 * 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":871 * * elif self.state == PROTOCOL_BIND: * self._on_result__bind(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_CLOSE_STMT_PORTAL: */ __pyx_t_1 = ((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_1)) __PYX_ERR(0, 871, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":870 * 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":874 * * elif self.state == PROTOCOL_CLOSE_STMT_PORTAL: * self._on_result__close_stmt_or_portal(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_SIMPLE_QUERY: */ __pyx_t_1 = ((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_1)) __PYX_ERR(0, 874, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":873 * 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":877 * * elif self.state == PROTOCOL_SIMPLE_QUERY: * self._on_result__simple_query(waiter) # <<<<<<<<<<<<<< * * elif (self.state == PROTOCOL_COPY_OUT_DATA or */ __pyx_t_1 = ((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_1)) __PYX_ERR(0, 877, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":876 * 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":879 * 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":881 * 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_1 = ((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_1)) __PYX_ERR(0, 881, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":879 * 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":884 * * elif self.state == PROTOCOL_COPY_IN_DATA: * self._on_result__copy_in(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_TERMINATING: */ __pyx_t_1 = ((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_1)) __PYX_ERR(0, 884, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":883 * 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":886 * 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":892 * * else: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'got result for unknown protocol state {}'. * format(self.state)) */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":894 * raise apg_exc.InternalClientError( * 'got result for unknown protocol state {}'. * format(self.state)) # <<<<<<<<<<<<<< * * except Exception as exc: */ __pyx_t_10 = __pyx_mstate_global->__pyx_kp_u_got_result_for_unknown_protocol; __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->__pyx_base.state); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 894, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 894, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L9_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(0, 892, __pyx_L9_error) break; } /* "asyncpg/protocol/protocol.pyx":854 * 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_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":896 * format(self.state)) * * except Exception as exc: # <<<<<<<<<<<<<< * waiter.set_exception(exc) * */ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_12) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._dispatch_result", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 896, __pyx_L11_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_v_exc = __pyx_t_4; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":897 * * except Exception as exc: * waiter.set_exception(exc) # <<<<<<<<<<<<<< * * cdef _on_result(self): */ __pyx_t_11 = __pyx_v_waiter; __Pyx_INCREF(__pyx_t_11); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_exc}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 897, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/protocol/protocol.pyx":896 * 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_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ( 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; } __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_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L10_exception_handled; } goto __pyx_L11_except_error; /* "asyncpg/protocol/protocol.pyx":854 * 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":831 * 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_5); __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":899 * 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; size_t __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; char const *__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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result", 0); /* "asyncpg/protocol/protocol.pyx":900 * * 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":901 * cdef _on_result(self): * if self.timeout_handle is not None: * self.timeout_handle.cancel() # <<<<<<<<<<<<<< * self.timeout_handle = None * */ __pyx_t_3 = __pyx_v_self->timeout_handle; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cancel, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":902 * 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":900 * * cdef _on_result(self): * if self.timeout_handle is not None: # <<<<<<<<<<<<<< * self.timeout_handle.cancel() * self.timeout_handle = None */ } /* "asyncpg/protocol/protocol.pyx":904 * 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":906 * 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_v_self->cancel_waiter; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = (!__pyx_t_1); if (__pyx_t_5) { /* "asyncpg/protocol/protocol.pyx":909 * # 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_v_self->cancel_waiter; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, Py_None}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":906 * 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":910 * # 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":911 * 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_5 = __pyx_t_1; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = __pyx_v_self->waiter; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __pyx_t_1; __pyx_L7_bool_binop_done:; if (__pyx_t_5) { /* "asyncpg/protocol/protocol.pyx":912 * 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":911 * 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":913 * if self.waiter is not None and self.waiter.done(): * self.waiter = None * if self.waiter is None: # <<<<<<<<<<<<<< * return * */ __pyx_t_5 = (__pyx_v_self->waiter == Py_None); if (__pyx_t_5) { /* "asyncpg/protocol/protocol.pyx":914 * 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":913 * if self.waiter is not None and self.waiter.done(): * self.waiter = None * if self.waiter is None: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/protocol.pyx":904 * 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":916 * return * * try: # <<<<<<<<<<<<<< * self._dispatch_result() * finally: */ /*try:*/ { /* "asyncpg/protocol/protocol.pyx":917 * * 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, 917, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "asyncpg/protocol/protocol.pyx":919 * 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":920 * 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":921 * 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_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); if ( unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __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_XGOTREF(__pyx_t_14); __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; { /* "asyncpg/protocol/protocol.pyx":919 * 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":920 * 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":921 * self.statement = None * self.last_query = None * self.return_extra = False # <<<<<<<<<<<<<< * * cdef _on_notice(self, parsed): */ __pyx_v_self->return_extra = 0; } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); __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_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; goto __pyx_L1_error; } __pyx_L12:; } /* "asyncpg/protocol/protocol.pyx":899 * 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_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":923 * 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; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_notice", 0); /* "asyncpg/protocol/protocol.pyx":924 * * 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, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_con = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":925 * 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":926 * 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_v_con; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_parsed, __pyx_v_self->last_query}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_process_log_message, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":925 * 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":923 * 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_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":928 * 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; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_notification", 0); /* "asyncpg/protocol/protocol.pyx":929 * * 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, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_con = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":930 * 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":931 * 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_v_con; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_pid, __pyx_v_channel, __pyx_v_payload}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_process_notification, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":930 * 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":928 * 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_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":933 * 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; size_t __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_connection_lost", 0); /* "asyncpg/protocol/protocol.pyx":934 * * 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":937 * # 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_v_self->waiter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __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(0, 937, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (!__pyx_t_2); __pyx_t_1 = __pyx_t_6; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":938 * # 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":939 * 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_v_self->waiter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, Py_None}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":938 * # 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":941 * self.waiter.set_result(None) * else: * self.waiter.set_exception(exc) # <<<<<<<<<<<<<< * self.waiter = None * else: */ /*else*/ { __pyx_t_4 = __pyx_v_self->waiter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_exc}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L7:; /* "asyncpg/protocol/protocol.pyx":937 * # 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":942 * 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":934 * * 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":947 * # 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":950 * # 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, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_con = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":951 * # 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":952 * con = self.get_connection() * if con is not None: * con._cleanup() # <<<<<<<<<<<<<< * self._handle_waiter_on_connection_lost(exc) * */ __pyx_t_4 = __pyx_v_con; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cleanup, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":951 * # 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":953 * 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, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":933 * 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_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":955 * 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; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_write", 0); /* "asyncpg/protocol/protocol.pyx":956 * * cdef _write(self, buf): * self.transport.write(memoryview(buf)) # <<<<<<<<<<<<<< * * cdef _writelines(self, list buffers): */ __pyx_t_2 = __pyx_v_self->__pyx_base.transport; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyMemoryView_FromObject(__pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":955 * 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_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":958 * 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; size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_writelines", 0); /* "asyncpg/protocol/protocol.pyx":959 * * cdef _writelines(self, list buffers): * self.transport.writelines(buffers) # <<<<<<<<<<<<<< * * # asyncio callbacks: */ __pyx_t_2 = __pyx_v_self->__pyx_base.transport; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_buffers}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_writelines, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":958 * 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_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":963 * # 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 963, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 963, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "data_received", 0) < (0)) __PYX_ERR(0, 963, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("data_received", 1, 1, 1, i); __PYX_ERR(0, 963, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 963, __pyx_L3_error) } __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, 963, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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", 0); /* "asyncpg/protocol/protocol.pyx":964 * * 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, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":965 * 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, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":963 * # 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":967 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_transport,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 967, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 967, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "connection_made", 0) < (0)) __PYX_ERR(0, 967, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("connection_made", 1, 1, 1, i); __PYX_ERR(0, 967, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 967, __pyx_L3_error) } __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, 967, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; size_t __pyx_t_3; 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; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; 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("connection_made", 0); /* "asyncpg/protocol/protocol.pyx":968 * * 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":970 * self.transport = transport * * sock = transport.get_extra_info('socket') # <<<<<<<<<<<<<< * if (sock is not None and * (not hasattr(socket, 'AF_UNIX') */ __pyx_t_2 = __pyx_v_transport; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_extra_info, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_sock = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":971 * * 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_5 = (__pyx_v_sock != Py_None); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":972 * 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_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_HasAttr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_AF_UNIX); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_5); if (!__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":973 * 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_mstate_global->__pyx_n_u_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_AF_UNIX); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_6; __pyx_L4_bool_binop_done:; /* "asyncpg/protocol/protocol.pyx":971 * * 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_4) { /* "asyncpg/protocol/protocol.pyx":974 * (not hasattr(socket, 'AF_UNIX') * or sock.family != socket.AF_UNIX)): * sock.setsockopt(socket.IPPROTO_TCP, # <<<<<<<<<<<<<< * socket.TCP_NODELAY, 1) * */ __pyx_t_7 = __pyx_v_sock; __Pyx_INCREF(__pyx_t_7); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_IPPROTO_TCP); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":975 * or sock.family != socket.AF_UNIX)): * sock.setsockopt(socket.IPPROTO_TCP, * socket.TCP_NODELAY, 1) # <<<<<<<<<<<<<< * * try: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_TCP_NODELAY); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_mstate_global->__pyx_int_1}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setsockopt, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":971 * * 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":977 * 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":978 * * 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, 978, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":977 * 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_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/protocol.pyx":979 * try: * self._connect() * except Exception as ex: # <<<<<<<<<<<<<< * transport.abort() * self.con_status = CONNECTION_BAD */ __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); 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_9, &__pyx_t_8) < 0) __PYX_ERR(0, 979, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_v_ex = __pyx_t_9; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":980 * self._connect() * except Exception as ex: * transport.abort() # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) */ __pyx_t_1 = __pyx_v_transport; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 980, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":981 * 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":982 * transport.abort() * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) # <<<<<<<<<<<<<< * self._on_error(ex) * */ __pyx_t_7 = ((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_7)) __PYX_ERR(0, 982, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":983 * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) * self._on_error(ex) # <<<<<<<<<<<<<< * * def connection_lost(self, exc): */ __pyx_t_1 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_ex}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_on_error, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 983, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "asyncpg/protocol/protocol.pyx":979 * 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_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_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ( 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_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0; } __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_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L9_except_error; } __pyx_L19:; } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L8_exception_handled; } goto __pyx_L9_except_error; /* "asyncpg/protocol/protocol.pyx":977 * 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":967 * 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_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __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":985 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_exc,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 985, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 985, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "connection_lost", 0) < (0)) __PYX_ERR(0, 985, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("connection_lost", 1, 1, 1, i); __PYX_ERR(0, 985, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 985, __pyx_L3_error) } __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, 985, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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", 0); /* "asyncpg/protocol/protocol.pyx":986 * * 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":987 * 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, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":988 * 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, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":985 * 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":990 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("pause_writing", __pyx_kwds); 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; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pause_writing", 0); /* "asyncpg/protocol/protocol.pyx":991 * * def pause_writing(self): * self.writing_allowed.clear() # <<<<<<<<<<<<<< * * def resume_writing(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":990 * 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":993 * 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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("resume_writing", __pyx_kwds); 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; size_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("resume_writing", 0); /* "asyncpg/protocol/protocol.pyx":994 * * def resume_writing(self): * self.writing_allowed.set() # <<<<<<<<<<<<<< * * @property */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":993 * 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":996 * 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__", 0); /* "asyncpg/protocol/protocol.pyx":998 * @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, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":996 * 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":1000 * 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":1002 * @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, 1002, __pyx_L1_error) __pyx_v_self->_is_ssl = __pyx_t_1; /* "asyncpg/protocol/protocol.pyx":1000 * 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__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyLong_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(*)(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_SIZE __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; } const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0); /* "(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 and _dict: */ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base._discard_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyLong_From_int32_t(__pyx_v_self->__pyx_base.backend_pid); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyLong_From_int32_t(__pyx_v_self->__pyx_base.backend_secret); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 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(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_v_self->__pyx_base.con_status); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 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(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->queries_count); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 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(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_v_self->__pyx_base.result_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 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(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->__pyx_base.state); if (unlikely(!__pyx_t_13)) __PYX_ERR(9, 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(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_v_self->__pyx_base.xact_status); if (unlikely(!__pyx_t_15)) __PYX_ERR(9, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = PyTuple_New(40); if (unlikely(!__pyx_t_16)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_2) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_3) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_4) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 8, __pyx_t_5) != (0)) __PYX_ERR(9, 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)) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 12, __pyx_t_6) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 14, __pyx_t_7) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 19, __pyx_t_8) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 22, __pyx_t_9) != (0)) __PYX_ERR(9, 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)) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 25, __pyx_t_10) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 29, __pyx_t_11) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 30, __pyx_t_12) != (0)) __PYX_ERR(9, 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)) != (0)) __PYX_ERR(9, 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)) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 33, __pyx_t_13) != (0)) __PYX_ERR(9, 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)) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_14); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 38, __pyx_t_14) != (0)) __PYX_ERR(9, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_15); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 39, __pyx_t_15) != (0)) __PYX_ERR(9, 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 and _dict: * state += (_dict,) */ __pyx_t_16 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(9, 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 and _dict: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_18 = (__pyx_v__dict != Py_None); if (__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(9, 7, __pyx_L1_error) __pyx_t_17 = __pyx_t_18; __pyx_L4_bool_binop_done:; if (__pyx_t_17) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None and _dict: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 8, __pyx_L1_error); __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(9, 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 and _dict: * 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 and _dict: # <<<<<<<<<<<<<< * 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_17 = __Pyx_PyObject_IsTrue(__pyx_mstate_global->__pyx_tuple[3]); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 11, __pyx_L1_error) __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_mstate_global->__pyx_n_u_pyx_unpickle_BaseProtocol); if (unlikely(!__pyx_t_15)) __PYX_ERR(9, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(9, 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)))) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_134522893); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_134522893); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_mstate_global->__pyx_int_134522893) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, Py_None) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_16) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 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_mstate_global->__pyx_n_u_pyx_unpickle_BaseProtocol); if (unlikely(!__pyx_t_14)) __PYX_ERR(9, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(9, 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)))) != (0)) __PYX_ERR(9, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_134522893); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_134522893); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_mstate_global->__pyx_int_134522893) != (0)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 15, __pyx_L1_error); __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(9, 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) != (0)) __PYX_ERR(9, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16) != (0)) __PYX_ERR(9, 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 16, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 16, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 16, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error) } __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(9, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(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) # <<<<<<<<<<<<<< */ __pyx_t_1 = __pyx_v___pyx_state; __Pyx_INCREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(9, 17, __pyx_L1_error) if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'"); __PYX_ERR(9, 17, __pyx_L1_error) } __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 17, __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; /* "(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_XDECREF(__pyx_t_2); __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":1006 * * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_budget,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1006, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1006, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1006, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1006, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1006, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1006, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1006, __pyx_L3_error) } __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, 1006, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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__", 0); /* "asyncpg/protocol/protocol.pyx":1007 * class Timer: * def __init__(self, budget): * self._budget = budget # <<<<<<<<<<<<<< * self._started = 0 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2, __pyx_v_budget) < (0)) __PYX_ERR(0, 1007, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1008 * def __init__(self, budget): * self._budget = budget * self._started = 0 # <<<<<<<<<<<<<< * * def __enter__(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_started, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 1008, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1006 * * 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":1010 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1010, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1010, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__enter__", 0) < (0)) __PYX_ERR(0, 1010, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 1, 1, i); __PYX_ERR(0, 1010, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1010, __pyx_L3_error) } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__enter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1010, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); /* "asyncpg/protocol/protocol.pyx":1011 * * def __enter__(self): * if self._budget is not None: # <<<<<<<<<<<<<< * self._started = time.monotonic() * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __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":1012 * def __enter__(self): * if self._budget is not None: * self._started = time.monotonic() # <<<<<<<<<<<<<< * * def __exit__(self, et, e, tb): */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_monotonic); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_started, __pyx_t_1) < (0)) __PYX_ERR(0, 1012, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":1011 * * def __enter__(self): * if self._budget is not None: # <<<<<<<<<<<<<< * self._started = time.monotonic() * */ } /* "asyncpg/protocol/protocol.pyx":1010 * 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_XDECREF(__pyx_t_5); __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":1014 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_et,&__pyx_mstate_global->__pyx_n_u_e,&__pyx_mstate_global->__pyx_n_u_tb,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1014, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1014, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1014, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1014, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1014, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__exit__", 0) < (0)) __PYX_ERR(0, 1014, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, i); __PYX_ERR(0, 1014, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1014, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1014, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1014, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1014, __pyx_L3_error) } __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, 1014, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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; PyObject *__pyx_t_6 = NULL; size_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "asyncpg/protocol/protocol.pyx":1015 * * 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_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __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":1016 * 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_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_monotonic); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); __pyx_t_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_started); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __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_t_6 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __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_mstate_global->__pyx_n_u_budget_2, __pyx_t_6) < (0)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":1015 * * def __exit__(self, et, e, tb): * if self._budget is not None: # <<<<<<<<<<<<<< * self._budget -= time.monotonic() - self._started * */ } /* "asyncpg/protocol/protocol.pyx":1014 * 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_XDECREF(__pyx_t_6); __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":1018 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1018, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1018, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_remaining_budget", 0) < (0)) __PYX_ERR(0, 1018, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_remaining_budget", 1, 1, 1, i); __PYX_ERR(0, 1018, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1018, __pyx_L3_error) } __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, 1018, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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", 0); /* "asyncpg/protocol/protocol.pyx":1019 * * 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_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":1018 * 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":1021 * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_amount,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1021, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1021, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1021, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "has_budget_greater_than", 0) < (0)) __PYX_ERR(0, 1021, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("has_budget_greater_than", 1, 2, 2, i); __PYX_ERR(0, 1021, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1021, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1021, __pyx_L3_error) } __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, 1021, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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 */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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", 0); /* "asyncpg/protocol/protocol.pyx":1022 * * 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_mstate_global->__pyx_n_u_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":1024 * 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":1022 * * def has_budget_greater_than(self, amount): * if self._budget is None: # <<<<<<<<<<<<<< * # Unlimited budget. * return True */ } /* "asyncpg/protocol/protocol.pyx":1026 * return True * else: * return self._budget > amount # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __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, 1026, __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":1021 * 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":1033 * * * 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mapping,&__pyx_mstate_global->__pyx_n_u_elems,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1033, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1033, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1033, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_create_record", 0) < (0)) __PYX_ERR(0, 1033, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_create_record", 1, 2, 2, i); __PYX_ERR(0, 1033, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1033, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1033, __pyx_L3_error) } __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, 1033, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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, 1033, __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; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int32_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_create_record", 0); /* "asyncpg/protocol/protocol.pyx":1040 * int32_t i * * if mapping is None: # <<<<<<<<<<<<<< * desc = RecordDescriptor({}, ()) * else: */ __pyx_t_1 = (__pyx_v_mapping == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":1041 * * if mapping is None: * desc = RecordDescriptor({}, ()) # <<<<<<<<<<<<<< * else: * desc = RecordDescriptor( */ __pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RecordDescriptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_empty_tuple}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__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; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_desc = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":1040 * int32_t i * * if mapping is None: # <<<<<<<<<<<<<< * desc = RecordDescriptor({}, ()) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":1043 * desc = RecordDescriptor({}, ()) * else: * desc = RecordDescriptor( # <<<<<<<<<<<<<< * mapping, tuple(mapping) if mapping else ()) * */ /*else*/ { __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RecordDescriptor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "asyncpg/protocol/protocol.pyx":1044 * else: * desc = RecordDescriptor( * mapping, tuple(mapping) if mapping else ()) # <<<<<<<<<<<<<< * * rec = desc.make_record(Record, len(elems)) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_mapping); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1044, __pyx_L1_error) if (__pyx_t_1) { __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_mapping); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; } else { __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple); __pyx_t_3 = __pyx_mstate_global->__pyx_empty_tuple; } __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_mapping, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 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(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_desc = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":1046 * mapping, tuple(mapping) if mapping else ()) * * rec = desc.make_record(Record, len(elems)) # <<<<<<<<<<<<<< * for i in range(len(elems)): * elem = elems[i] */ __pyx_t_5 = __pyx_v_desc; __Pyx_INCREF(__pyx_t_5); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Record); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_v_elems == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 1046, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyTuple_GET_SIZE(__pyx_v_elems); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1046, __pyx_L1_error) __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_record, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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_2)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_rec = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":1047 * * rec = desc.make_record(Record, 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, 1047, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyTuple_GET_SIZE(__pyx_v_elems); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1047, __pyx_L1_error) __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/protocol.pyx":1048 * rec = desc.make_record(Record, len(elems)) * for i in range(len(elems)): * elem = elems[i] # <<<<<<<<<<<<<< * cpython.Py_INCREF(elem) * recordcapi.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, 1048, __pyx_L1_error) } __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_elems, __pyx_v_i, int32_t, 1, __Pyx_PyLong_From_int32_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":1049 * for i in range(len(elems)): * elem = elems[i] * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * recordcapi.ApgRecord_SET_ITEM(rec, i, elem) * return rec */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/protocol.pyx":1050 * elem = elems[i] * cpython.Py_INCREF(elem) * recordcapi.ApgRecord_SET_ITEM(rec, i, elem) # <<<<<<<<<<<<<< * return rec */ ApgRecord_SET_ITEM(__pyx_v_rec, __pyx_v_i, __pyx_v_elem); } /* "asyncpg/protocol/protocol.pyx":1051 * cpython.Py_INCREF(elem) * recordcapi.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":1033 * * * 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_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __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)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs') */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 4, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_DataCodecConfig", 0) < (0)) __PYX_ERR(9, 4, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DataCodecConfig", 1, 3, 3, i); __PYX_ERR(9, 4, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error) } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(9, 4, __pyx_L3_error) __pyx_v___pyx_state = ((PyObject*)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DataCodecConfig", 1, 3, 3, __pyx_nargs); __PYX_ERR(9, 4, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(9, 4, __pyx_L1_error) __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 */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig", 0); /* "(tree fragment)":6 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, tuple __pyx_state): * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs') # <<<<<<<<<<<<<< * __pyx_result = DataCodecConfig.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, ((char const *)"_custom_type_codecs, _derived_type_codecs")); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 6, __pyx_L1_error) /* "(tree fragment)":7 * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs') * __pyx_result = DataCodecConfig.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v___pyx_result = __pyx_t_2; __pyx_t_2 = 0; /* "(tree fragment)":8 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs') * __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None)); if (__pyx_t_5) { /* "(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, __pyx_state: tuple): */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'"); __PYX_ERR(9, 9, __pyx_L1_error) } __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":8 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs') * __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, __pyx_state: tuple): * __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)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_DataCodecConfig", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __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, __pyx_state: tuple): # <<<<<<<<<<<<<< * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2) */ 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; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, __pyx_state: tuple): * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] # <<<<<<<<<<<<<< * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2) */ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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, __pyx_state: tuple): * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2) # <<<<<<<<<<<<<< */ __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error) /* "(tree fragment)":11 * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<< * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 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.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)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_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') */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 4, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_CoreProtocol", 0) < (0)) __PYX_ERR(9, 4, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, i); __PYX_ERR(9, 4, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error) } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(9, 4, __pyx_L3_error) __pyx_v___pyx_state = ((PyObject*)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, __pyx_nargs); __PYX_ERR(9, 4, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(9, 4, __pyx_L1_error) __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 */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol", 0); /* "(tree fragment)":6 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state): * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_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_result = CoreProtocol.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, ((char const *)"_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")); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 6, __pyx_L1_error) /* "(tree fragment)":7 * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_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_result = CoreProtocol.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v___pyx_result = __pyx_t_2; __pyx_t_2 = 0; /* "(tree fragment)":8 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_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_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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None)); if (__pyx_t_5) { /* "(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, __pyx_state: tuple): */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'"); __PYX_ERR(9, 9, __pyx_L1_error) } __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":8 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_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_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, __pyx_state: tuple): * __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)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_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') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_CoreProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __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, __pyx_state: tuple): # <<<<<<<<<<<<<< * __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 23) */ 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; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, __pyx_state: tuple): * __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 23) */ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_discard_data = __pyx_t_2; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_skip_discard = __pyx_t_2; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->backend_pid = __pyx_t_3; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->backend_secret = __pyx_t_3; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer))))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->con_status = __pyx_t_4; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->result_execute_completed = __pyx_t_2; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->result_type = __pyx_t_5; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication))))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->state = __pyx_t_6; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 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, __pyx_state: tuple): * __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 23) # <<<<<<<<<<<<<< */ __pyx_t_8 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 23); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error) /* "(tree fragment)":11 * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<< * __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 23) */ /* 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.__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)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_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') */ /* 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(*)(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_SIZE __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(9, 4, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_BaseProtocol", 0) < (0)) __PYX_ERR(9, 4, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, i); __PYX_ERR(9, 4, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error) } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(9, 4, __pyx_L3_error) __pyx_v___pyx_state = ((PyObject*)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, __pyx_nargs); __PYX_ERR(9, 4, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(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:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(9, 4, __pyx_L1_error) __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 */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } goto __pyx_L7_cleaned_up; __pyx_L0:; for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { Py_XDECREF(values[__pyx_temp]); } __pyx_L7_cleaned_up:; __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_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol", 0); /* "(tree fragment)":6 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state): * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_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_result = BaseProtocol.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, ((char const *)"_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")); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 6, __pyx_L1_error) /* "(tree fragment)":7 * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_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_result = BaseProtocol.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v___pyx_result = __pyx_t_2; __pyx_t_2 = 0; /* "(tree fragment)":8 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_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_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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None)); if (__pyx_t_5) { /* "(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, __pyx_state: tuple): */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'"); __PYX_ERR(9, 9, __pyx_L1_error) } __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":8 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_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_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, __pyx_state: tuple): * __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)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_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') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_BaseProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __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, __pyx_state: tuple): # <<<<<<<<<<<<<< * __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 40) */ 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; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, __pyx_state: tuple): * __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 40) */ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base._discard_data = __pyx_t_2; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_is_ssl = __pyx_t_2; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base._skip_discard = __pyx_t_2; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.backend_pid = __pyx_t_3; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.backend_secret = __pyx_t_3; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer))))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->closing = __pyx_t_2; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.con_status = __pyx_t_4; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->is_reading = __pyx_t_2; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->queries_count = __pyx_t_5; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.result_type = __pyx_t_6; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->return_extra = __pyx_t_2; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication))))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings))))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.state = __pyx_t_7; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState))))) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 38, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->writing_paused = __pyx_t_2; __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 39, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 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, __pyx_state: tuple): * __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 40) # <<<<<<<<<<<<<< */ __pyx_t_9 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 40); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error) /* "(tree fragment)":11 * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<< * __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_UpdateUnpickledDict(__pyx_result, __pyx_state, 40) */ /* 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.__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; } /* #### Code section: module_exttypes ### */ static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CodecMap __pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_CodecMap(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *p; PyObject *o; o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_CodecMap; p->extra_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_1__cinit__(o, __pyx_mstate_global->__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_CodecMap(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->extra_codecs); PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #endif } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CodecMap(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } if (p->extra_codecs) { e = (*v)(p->extra_codecs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_CodecMap(PyObject *o) { PyObject* tmp; struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)o; tmp = ((PyObject*)p->extra_codecs); p->extra_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_CodecMap[] = { {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_5__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_CodecMap_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CodecMap}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_CodecMap}, {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_CodecMap}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_CodecMap}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_CodecMap}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_CodecMap_spec = { "asyncpg.protocol.protocol.CodecMap", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap), 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_CodecMap_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_CodecMap = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""CodecMap", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CodecMap, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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_CodecMap, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_CodecMap, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_CodecMap, /*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_CodecMap, /*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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_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; o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; 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); PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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 PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_Codec[] = { {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ __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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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; o = __Pyx_AllocateExtensionType(t, 0); if (unlikely(!o)) return 0; 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(__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); PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"add_python_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"remove_python_codec", (PyCFunction)(void(*)(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(*)(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(*)(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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"declare_fallback_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_mstate_global->__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_mstate_global->__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(__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 (PyType_IS_GC(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) PyObject_GC_Track(o); #if !CYTHON_USE_MODULE_STATE if (likely(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, tp_dealloc, destructor)(o); else #endif __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; #if !CYTHON_USE_MODULE_STATE e = 0; if (likely(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) { traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, tp_traverse, traverseproc); if (traverse) { e = traverse(o, v, a); } } else #endif { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7asyncpg_8protocol_8protocol_ConnectionSettings); } if (e) return e; { e = __Pyx_call_type_traverse(o, 0, v, a); 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 !CYTHON_USE_MODULE_STATE if (likely(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) { inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, tp_clear, inquiry); if (clear) clear(o); } else #endif { __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 = PyObject_GenericGetAttr(o, n); if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); v = __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__getattr__(o, n); } return v; } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_ConnectionSettings[] = { {"__getattr__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__getattr__, METH_O|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ __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, /*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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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; o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; 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); PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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[] = { {"authentication_method", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_authentication_method, 0, 0, 0}, {"authorization_message", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_authorization_message, 0, 0, 0}, {"client_channel_binding", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_channel_binding, 0, 0, 0}, {"client_first_message_bare", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_first_message_bare, 0, 0, 0}, {"client_nonce", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_nonce, 0, 0, 0}, {"client_proof", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_proof, 0, 0, 0}, {"password_salt", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_password_salt, 0, 0, 0}, {"password_iterations", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_password_iterations, 0, 0, 0}, {"server_first_message", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_first_message, 0, 0, 0}, {"server_key", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_key, 0, 0, 0}, {"server_nonce", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_nonce, 0, 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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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; o = __Pyx_AllocateExtensionType(t, 0); if (unlikely(!o)) return 0; 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(__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); PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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[] = { {"backend_pid", __pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_pid, 0, 0, 0}, {"backend_secret", __pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_secret, 0, 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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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; o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; 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); PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_get_attributes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_init_types", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"attach", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"detach", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"mark_closed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"mark_unprepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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[] = { {"name", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_name, 0, 0, 0}, {"query", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_query, 0, 0, 0}, {"closed", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_closed, 0, 0, 0}, {"prepared", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_prepared, 0, 0, 0}, {"refs", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_refs, 0, 0, 0}, {"record_class", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_record_class, 0, 0, 0}, {"ignore_custom_codec", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_ignore_custom_codec, 0, 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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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(__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"get_server_pid", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"get_settings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"get_record_class", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"bind_execute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"bind_execute_many", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"bind", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"execute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"close_portal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"query", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"copy_out", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"copy_in", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"close_statement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"is_closed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"is_connected", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"abort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"close", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47close, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_request_cancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_on_timeout", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_on_waiter_completed", (PyCFunction)(void(*)(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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_get_timeout", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_is_cancelling", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_wait_for_cancellation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"data_received", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"connection_made", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"connection_lost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"pause_writing", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"resume_writing", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void(*)(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[] = { {"is_ssl", __pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_is_ssl, __pyx_setprop_7asyncpg_8protocol_8protocol_12BaseProtocol_is_ssl, 0, 0}, {"queries_count", __pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_queries_count, 0, 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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password[__pyx_mstate_global->__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 { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_6_prepare(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_7_bind_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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_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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute[__pyx_mstate_global->__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 { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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_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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many[__pyx_mstate_global->__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 { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_10_bind(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_11_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_12_close_portal(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal[__pyx_mstate_global->__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 { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_13_query(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_14_copy_out(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out[__pyx_mstate_global->__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 { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_15_copy_in(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in[__pyx_mstate_global->__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 { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_16_close_statement(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement[__pyx_mstate_global->__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 { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_17_close(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)o); } else #endif { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, 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_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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation)))) { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation]; #if CYTHON_USE_TYPE_SPECS Py_DECREF(Py_TYPE(o)); #endif memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation)); #if CYTHON_COMPILING_IN_LIMITED_API (void) PyObject_Init(o, t); #else (void) PyObject_INIT(o, t); #endif PyObject_GC_Track(o); } else #endif { o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } 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(__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 (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation)))) { __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation[__pyx_mstate_global->__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 { PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS (*tp->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif #if CYTHON_USE_TYPE_SPECS Py_DECREF(tp); #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; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } 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, __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*/ 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ 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___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 CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #if !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} }; /* #### Code section: initfunc_declarations ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ /* #### Code section: init_module ### */ static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __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_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(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); 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_CodecMap = &__pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap; __pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap.get_binary_codec_ptr = (void *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t))__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr; __pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap.set_binary_codec_ptr = (void (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *))__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_binary_codec_ptr; __pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap.get_text_codec_ptr = (void *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t))__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr; __pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap.set_text_codec_ptr = (void (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *))__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_text_codec_ptr; #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_CodecMap_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap)) __PYX_ERR(1, 17, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_CodecMap_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap = &__pyx_type_7asyncpg_8protocol_8protocol_CodecMap; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap->tp_getattro = PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap, __pyx_vtabptr_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CodecMap, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error) __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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_Codec_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec)) __PYX_ERR(1, 43, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_Codec_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec->tp_getattro = PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_vtabptr_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Codec, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error) __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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig)) __PYX_ERR(1, 509, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig->tp_getattro = PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_vtabptr_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DataCodecConfig, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error) __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_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext = __Pyx_ImportType_3_2_1(__pyx_t_1, "asyncpg.pgproto.pgproto", "CodecContext", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), #else sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__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_mstate->__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_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings)) __PYX_ERR(8, 11, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings = &__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings->tp_base = __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings); #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ConnectionSettings, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error) __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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication)) __PYX_ERR(3, 17, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication->tp_getattro = PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_vtabptr_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error) __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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol)) __PYX_ERR(15, 24, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol->tp_getattro = PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CoreProtocol, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error) __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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState)) __PYX_ERR(17, 11, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState->tp_getattro = PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_vtabptr_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PreparedStatementState, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error) __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_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol)) __PYX_ERR(0, 76, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol = &__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_base = __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_getattro = PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_vtabptr_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error) if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_BaseProtocol, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error) #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr)) __PYX_ERR(3, 188, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(3, 188, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(3, 188, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password)) __PYX_ERR(3, 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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password) < (0)) __PYX_ERR(3, 256, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password) < (0)) __PYX_ERR(3, 256, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr)) __PYX_ERR(3, 287, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(3, 287, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(3, 287, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)) __PYX_ERR(3, 313, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(3, 313, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(3, 313, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr)) __PYX_ERR(3, 327, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(3, 327, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(3, 327, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr)) __PYX_ERR(3, 336, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(3, 336, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(3, 336, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare)) __PYX_ERR(0, 139, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare) < (0)) __PYX_ERR(0, 139, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare) < (0)) __PYX_ERR(0, 139, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute) < (0)) __PYX_ERR(0, 167, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute) < (0)) __PYX_ERR(0, 167, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many)) __PYX_ERR(0, 207, __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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many) < (0)) __PYX_ERR(0, 207, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many) < (0)) __PYX_ERR(0, 207, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr)) __PYX_ERR(0, 228, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr) < (0)) __PYX_ERR(0, 228, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr) < (0)) __PYX_ERR(0, 228, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind)) __PYX_ERR(0, 268, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind) < (0)) __PYX_ERR(0, 268, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind) < (0)) __PYX_ERR(0, 268, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute)) __PYX_ERR(0, 296, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute) < (0)) __PYX_ERR(0, 296, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute) < (0)) __PYX_ERR(0, 296, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal)) __PYX_ERR(0, 325, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal) < (0)) __PYX_ERR(0, 325, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal) < (0)) __PYX_ERR(0, 325, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query)) __PYX_ERR(0, 347, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query) < (0)) __PYX_ERR(0, 347, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query) < (0)) __PYX_ERR(0, 347, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out)) __PYX_ERR(0, 371, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out) < (0)) __PYX_ERR(0, 371, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out) < (0)) __PYX_ERR(0, 371, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in)) __PYX_ERR(0, 424, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in) < (0)) __PYX_ERR(0, 424, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in) < (0)) __PYX_ERR(0, 424, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement)) __PYX_ERR(0, 562, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement) < (0)) __PYX_ERR(0, 562, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement) < (0)) __PYX_ERR(0, 562, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close)) __PYX_ERR(0, 602, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close) < (0)) __PYX_ERR(0, 602, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close) < (0)) __PYX_ERR(0, 602, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation)) __PYX_ERR(0, 744, __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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation) < (0)) __PYX_ERR(0, 744, __pyx_L1_error) #else __pyx_mstate->__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_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation) < (0)) __PYX_ERR(0, 744, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation->tp_getattro = PyObject_GenericGetAttr; } #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(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); 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_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_2_1(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API 0, 0, #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__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_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_2_1(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyLongObject), #elif CYTHON_COMPILING_IN_LIMITED_API 0, 0, #else sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyLongObject), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__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, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_2_1(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyComplexObject), #elif CYTHON_COMPILING_IN_LIMITED_API 0, 0, #else sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(PyComplexObject), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(22, 16, __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(6, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer = __Pyx_ImportType_3_2_1(__pyx_t_1, "asyncpg.pgproto.pgproto", "WriteBuffer", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), #else sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) __PYX_ERR(6, 15, __pyx_L1_error) __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer = (struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer); if (unlikely(!__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer)) __PYX_ERR(6, 15, __pyx_L1_error) __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer = __Pyx_ImportType_3_2_1(__pyx_t_1, "asyncpg.pgproto.pgproto", "ReadBuffer", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), #else sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_1(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), #endif __Pyx_ImportType_CheckSize_Warn_3_2_1); if (!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) __PYX_ERR(6, 75, __pyx_L1_error) __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer = (struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer); if (unlikely(!__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer)) __PYX_ERR(6, 75, __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(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); 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 (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); const char * __pyx_import_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_PyObject_struct___pyx_obj_7async); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(!__pyx_import_signature)) __PYX_ERR(0, 1, __pyx_L1_error) #endif const char * __pyx_import_name = __pyx_import_signature + 528; void (**const __pyx_import_pointers[])(void) = {(void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bool_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_box_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_circle_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float4_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float8_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_inet_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int2_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int4_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_line_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_binary, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_text, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_path_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_point_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_poly_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_tid_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_void_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bool_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_box_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_circle_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float4_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float8_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_inet_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int2_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int4_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_line_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_text, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_path_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_point_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_poly_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_tid_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_void_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_frb_check, (void (**)(void)) NULL}; void (**const *__pyx_import_pointer)(void) = __pyx_import_pointers; const char *__pyx_import_current_signature = __pyx_import_signature; while (*__pyx_import_pointer) { if (__Pyx_ImportFunction_3_2_1(__pyx_t_1, __pyx_import_name, *__pyx_import_pointer, __pyx_import_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) ++__pyx_import_pointer; __pyx_import_name = strchr(__pyx_import_name, '\0') + 1; __pyx_import_signature = strchr(__pyx_import_signature, '\0') + 1; if (*__pyx_import_signature != '\0') __pyx_import_current_signature = __pyx_import_signature; } __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 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}, #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING {Py_mod_gil, Py_MOD_GIL_NOT_USED}, #endif #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED}, #endif {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_USE_MODULE_STATE sizeof(__pyx_mstatetype), /* m_size */ #else (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -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 /* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif __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); } /* ModuleCreationPEP489 */ #if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { { PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think if (!module) { PyErr_Clear(); // just try the 3.8-3.12 version module = PyImport_ImportModule("_xxsubinterpreters"); if (!module) goto bad; } PyObject *current = PyObject_CallMethod(module, "get_current", NULL); Py_DECREF(module); if (!current) goto bad; if (PyTuple_Check(current)) { PyObject *new_current = PySequence_GetItem(current, 0); Py_DECREF(current); current = new_current; if (!new_current) goto bad; } long long as_c_int = PyLong_AsLongLong(current); Py_DECREF(current); return as_c_int; } bad: PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); return -1; } #endif #if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { static PY_INT64_T main_interpreter_id = -1; #if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); #elif CYTHON_COMPILING_IN_GRAAL PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); #elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); #elif CYTHON_COMPILING_IN_LIMITED_API PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); #else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); #endif if (unlikely(current_id == -1)) { return -1; } if (main_interpreter_id == -1) { main_interpreter_id = current_id; return 0; } else if (unlikely(main_interpreter_id != current_id)) { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #endif 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) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } 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 !CYTHON_USE_MODULE_STATE if (__Pyx_check_single_interpreter()) return NULL; #endif 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; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; 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 { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; size_t __pyx_t_10; static Py_UCS4 __pyx_t_11[5]; 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; PyObject *__pyx_t_18 = NULL; 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; } #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_t_1 = __pyx_pyinit_module; Py_INCREF(__pyx_t_1); #else __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #if CYTHON_USE_MODULE_STATE { int add_module_result = __Pyx_State_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 = __pyx_t_1; #endif #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED); #endif __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_mstate->__pyx_d); __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /* ImportRefnannyAPI */ #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("PyInit_protocol", 0); __Pyx_init_runtime_version(); 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) __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Library function declarations ---*/ /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error) if (__pyx_module_is_main_asyncpg__protocol__protocol) { if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) } { 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) } } /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(__pyx_mstate); (void)__Pyx_modinit_variable_export_code(__pyx_mstate); (void)__Pyx_modinit_function_export_code(__pyx_mstate); if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(__pyx_mstate); if (unlikely((__Pyx_modinit_function_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ /* "asyncpg/protocol/protocol.pyx":13 * cimport cpython * * import asyncio # <<<<<<<<<<<<<< * import builtins * import codecs */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncio, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_builtins, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_codecs, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_socket, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_time, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_weakref, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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 */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_base}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg_exceptions, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) } __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_base}; __pyx_t_3 = 0; { __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); switch (__pyx_t_3) { case 0: if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_apg_exc_base, __pyx_t_4) < (0)) __PYX_ERR(0, 43, __pyx_L1_error) break; default:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_compat}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) } __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_compat}; __pyx_t_3 = 0; { __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) } __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types}; __pyx_t_3 = 0; { __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); switch (__pyx_t_3) { case 0: if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_apg_types, __pyx_t_4) < (0)) __PYX_ERR(0, 45, __pyx_L1_error) break; default:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) } __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_3 = 0; { __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); switch (__pyx_t_3) { case 0: if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_apg_exc, __pyx_t_4) < (0)) __PYX_ERR(0, 46, __pyx_L1_error) break; default:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":49 * * from asyncpg.pgproto cimport hton * from asyncpg.protocol.record import Record, RecordDescriptor # <<<<<<<<<<<<<< * * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Record,__pyx_mstate_global->__pyx_n_u_RecordDescriptor}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg_protocol_record, __pyx_imported_names, 2, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) } __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Record,__pyx_mstate_global->__pyx_n_u_RecordDescriptor}; for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) { __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":116 * DEF ANYCOMPATIBLERANGEOID = 5080 * * ARRAY_TYPES = {_TEXTOID, _OIDOID} # <<<<<<<<<<<<<< * * BUILTIN_TYPE_OID_MAP = { */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PySet_Add(__pyx_t_2, __pyx_mstate_global->__pyx_int_1009) < (0)) __PYX_ERR(23, 116, __pyx_L1_error) if (PySet_Add(__pyx_t_2, __pyx_mstate_global->__pyx_int_1028) < (0)) __PYX_ERR(23, 116, __pyx_L1_error) if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ARRAY_TYPES, __pyx_t_2) < (0)) __PYX_ERR(23, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "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_mstate_global->__pyx_int_702, __pyx_mstate_global->__pyx_n_u_abstime) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1033, __pyx_mstate_global->__pyx_n_u_aclitem) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2277, __pyx_mstate_global->__pyx_n_u_anyarray) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5078, __pyx_mstate_global->__pyx_n_u_anycompatiblearray) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4538, __pyx_mstate_global->__pyx_n_u_anycompatiblemultirange) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5079, __pyx_mstate_global->__pyx_n_u_anycompatiblenonarray) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5077, __pyx_mstate_global->__pyx_n_u_anycompatible) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5080, __pyx_mstate_global->__pyx_n_u_anycompatiblerange) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2283, __pyx_mstate_global->__pyx_n_u_anyelement) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3500, __pyx_mstate_global->__pyx_n_u_anyenum) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4537, __pyx_mstate_global->__pyx_n_u_anymultirange) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2776, __pyx_mstate_global->__pyx_n_u_anynonarray) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2276, __pyx_mstate_global->__pyx_n_u_any) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3831, __pyx_mstate_global->__pyx_n_u_anyrange) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1560, __pyx_mstate_global->__pyx_n_u_bit) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_16, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_603, __pyx_mstate_global->__pyx_n_u_box) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1042, __pyx_mstate_global->__pyx_n_u_bpchar) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_17, __pyx_mstate_global->__pyx_n_u_bytea) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_18, __pyx_mstate_global->__pyx_n_u_char) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_29, __pyx_mstate_global->__pyx_n_u_cid) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_650, __pyx_mstate_global->__pyx_n_u_cidr) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_718, __pyx_mstate_global->__pyx_n_u_circle) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2275, __pyx_mstate_global->__pyx_n_u_cstring) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1082, __pyx_mstate_global->__pyx_n_u_date) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3838, __pyx_mstate_global->__pyx_n_u_event_trigger) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3115, __pyx_mstate_global->__pyx_n_u_fdw_handler) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_700, __pyx_mstate_global->__pyx_n_u_float4) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_701, __pyx_mstate_global->__pyx_n_u_float8) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3642, __pyx_mstate_global->__pyx_n_u_gtsvector) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_325, __pyx_mstate_global->__pyx_n_u_index_am_handler) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_869, __pyx_mstate_global->__pyx_n_u_inet) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_21, __pyx_mstate_global->__pyx_n_u_int2) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_23, __pyx_mstate_global->__pyx_n_u_int4) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_20, __pyx_mstate_global->__pyx_n_u_int8) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2281, __pyx_mstate_global->__pyx_n_u_internal) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1186, __pyx_mstate_global->__pyx_n_u_interval) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3802, __pyx_mstate_global->__pyx_n_u_jsonb) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_114, __pyx_mstate_global->__pyx_n_u_json) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4072, __pyx_mstate_global->__pyx_n_u_jsonpath) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2280, __pyx_mstate_global->__pyx_n_u_language_handler) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_628, __pyx_mstate_global->__pyx_n_u_line) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_601, __pyx_mstate_global->__pyx_n_u_lseg) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_774, __pyx_mstate_global->__pyx_n_u_macaddr8) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_829, __pyx_mstate_global->__pyx_n_u_macaddr) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_790, __pyx_mstate_global->__pyx_n_u_money) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_19, __pyx_mstate_global->__pyx_n_u_name) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1700, __pyx_mstate_global->__pyx_n_u_numeric) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_26, __pyx_mstate_global->__pyx_n_u_oid) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2282, __pyx_mstate_global->__pyx_n_u_opaque) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_602, __pyx_mstate_global->__pyx_n_u_path) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4600, __pyx_mstate_global->__pyx_n_u_pg_brin_bloom_summary) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4601, __pyx_mstate_global->__pyx_n_u_pg_brin_minmax_multi_summary) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_32, __pyx_mstate_global->__pyx_n_u_pg_ddl_command) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3402, __pyx_mstate_global->__pyx_n_u_pg_dependencies) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3220, __pyx_mstate_global->__pyx_n_u_pg_lsn) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5017, __pyx_mstate_global->__pyx_n_u_pg_mcv_list) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3361, __pyx_mstate_global->__pyx_n_u_pg_ndistinct) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_194, __pyx_mstate_global->__pyx_n_u_pg_node_tree) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5038, __pyx_mstate_global->__pyx_n_u_pg_snapshot) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_600, __pyx_mstate_global->__pyx_n_u_point) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_604, __pyx_mstate_global->__pyx_n_u_polygon) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2249, __pyx_mstate_global->__pyx_n_u_record) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1790, __pyx_mstate_global->__pyx_n_u_refcursor) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2205, __pyx_mstate_global->__pyx_n_u_regclass) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4191, __pyx_mstate_global->__pyx_n_u_regcollation) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3734, __pyx_mstate_global->__pyx_n_u_regconfig) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3769, __pyx_mstate_global->__pyx_n_u_regdictionary) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4089, __pyx_mstate_global->__pyx_n_u_regnamespace) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2204, __pyx_mstate_global->__pyx_n_u_regoperator) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2203, __pyx_mstate_global->__pyx_n_u_regoper) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2202, __pyx_mstate_global->__pyx_n_u_regprocedure) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_24, __pyx_mstate_global->__pyx_n_u_regproc) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4096, __pyx_mstate_global->__pyx_n_u_regrole) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2206, __pyx_mstate_global->__pyx_n_u_regtype) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_703, __pyx_mstate_global->__pyx_n_u_reltime) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_210, __pyx_mstate_global->__pyx_n_u_smgr) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_269, __pyx_mstate_global->__pyx_n_u_table_am_handler) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_25, __pyx_mstate_global->__pyx_n_u_text) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_27, __pyx_mstate_global->__pyx_n_u_tid) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1083, __pyx_mstate_global->__pyx_n_u_time) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1114, __pyx_mstate_global->__pyx_n_u_timestamp) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1184, __pyx_mstate_global->__pyx_n_u_timestamptz) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1266, __pyx_mstate_global->__pyx_n_u_timetz) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_704, __pyx_mstate_global->__pyx_n_u_tinterval) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2279, __pyx_mstate_global->__pyx_n_u_trigger) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3310, __pyx_mstate_global->__pyx_n_u_tsm_handler) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3615, __pyx_mstate_global->__pyx_n_u_tsquery) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3614, __pyx_mstate_global->__pyx_n_u_tsvector) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2970, __pyx_mstate_global->__pyx_n_u_txid_snapshot) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_705, __pyx_mstate_global->__pyx_n_u_unknown) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2950, __pyx_mstate_global->__pyx_n_u_uuid) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1562, __pyx_mstate_global->__pyx_n_u_varbit) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1043, __pyx_mstate_global->__pyx_n_u_varchar) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2278, __pyx_mstate_global->__pyx_n_u_void) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5069, __pyx_mstate_global->__pyx_n_u_xid8) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_28, __pyx_mstate_global->__pyx_n_u_xid) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_142, __pyx_mstate_global->__pyx_n_u_xml) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1028, __pyx_mstate_global->__pyx_kp_u_oid_2) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1009, __pyx_mstate_global->__pyx_kp_u_text_2) < (0)) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_5, &__pyx_t_3, &__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_4); __pyx_t_4 = 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_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_int2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_smallint, __pyx_t_4) < 0))) __PYX_ERR(23, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__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_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_int, __pyx_t_2) < 0))) __PYX_ERR(23, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_int4); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_integer, __pyx_t_4) < 0))) __PYX_ERR(23, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__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_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_bigint, __pyx_t_2) < 0))) __PYX_ERR(23, 232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_numeric); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_decimal, __pyx_t_4) < 0))) __PYX_ERR(23, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__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_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_real, __pyx_t_2) < 0))) __PYX_ERR(23, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_float8); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_kp_u_double_precision, __pyx_t_4) < 0))) __PYX_ERR(23, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__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_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_timestamp_with_timezone, __pyx_t_2) < 0))) __PYX_ERR(23, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_kp_u_timestamp_without_timezone, __pyx_t_4) < 0))) __PYX_ERR(23, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__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_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_time_with_timezone, __pyx_t_2) < 0))) __PYX_ERR(23, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_kp_u_time_without_timezone, __pyx_t_4) < 0))) __PYX_ERR(23, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__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_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_char, __pyx_t_2) < 0))) __PYX_ERR(23, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_bpchar); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_character, __pyx_t_4) < 0))) __PYX_ERR(23, 259, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__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_4); __pyx_t_4 = 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_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_character_varying, __pyx_t_2) < 0))) __PYX_ERR(23, 262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_varbit); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_kp_u_bit_varying, __pyx_t_4) < 0))) __PYX_ERR(23, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/encodings.pyx":14 * * ENCODINGS_MAP = { * 'abc': 'cp1258', # <<<<<<<<<<<<<< * 'alt': 'cp866', * 'euc_cn': 'euccn', */ __pyx_t_4 = __Pyx_PyDict_NewPresized(45); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_abc, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_alt, __pyx_mstate_global->__pyx_n_u_cp866) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_euc_cn, __pyx_mstate_global->__pyx_n_u_euccn) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_euc_jp, __pyx_mstate_global->__pyx_n_u_eucjp) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_euc_kr, __pyx_mstate_global->__pyx_n_u_euckr) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_koi8r, __pyx_mstate_global->__pyx_n_u_koi8_r) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_koi8u, __pyx_mstate_global->__pyx_n_u_koi8_u) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shift_jis_2004, __pyx_mstate_global->__pyx_n_u_euc_jis_2004) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sjis, __pyx_mstate_global->__pyx_n_u_shift_jis) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sql_ascii, __pyx_mstate_global->__pyx_n_u_ascii) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vscii, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tcvn, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tcvn5712, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_unicode, __pyx_mstate_global->__pyx_n_u_utf_8_2) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win, __pyx_mstate_global->__pyx_n_u_cp1521) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1250, __pyx_mstate_global->__pyx_n_u_cp1250) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1251, __pyx_mstate_global->__pyx_n_u_cp1251) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1252, __pyx_mstate_global->__pyx_n_u_cp1252) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1253, __pyx_mstate_global->__pyx_n_u_cp1253) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1254, __pyx_mstate_global->__pyx_n_u_cp1254) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1255, __pyx_mstate_global->__pyx_n_u_cp1255) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1256, __pyx_mstate_global->__pyx_n_u_cp1256) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1257, __pyx_mstate_global->__pyx_n_u_cp1257) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1258, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win866, __pyx_mstate_global->__pyx_n_u_cp866) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win874, __pyx_mstate_global->__pyx_n_u_cp874) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win932, __pyx_mstate_global->__pyx_n_u_cp932) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win936, __pyx_mstate_global->__pyx_n_u_cp936) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win949, __pyx_mstate_global->__pyx_n_u_cp949) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win950, __pyx_mstate_global->__pyx_n_u_cp950) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1250, __pyx_mstate_global->__pyx_n_u_cp1250) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1251, __pyx_mstate_global->__pyx_n_u_cp1251) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1252, __pyx_mstate_global->__pyx_n_u_cp1252) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1253, __pyx_mstate_global->__pyx_n_u_cp1253) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1254, __pyx_mstate_global->__pyx_n_u_cp1254) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1255, __pyx_mstate_global->__pyx_n_u_cp1255) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1256, __pyx_mstate_global->__pyx_n_u_cp1256) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1257, __pyx_mstate_global->__pyx_n_u_cp1257) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1258, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows866, __pyx_mstate_global->__pyx_n_u_cp866) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows874, __pyx_mstate_global->__pyx_n_u_cp874) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows932, __pyx_mstate_global->__pyx_n_u_cp932) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows936, __pyx_mstate_global->__pyx_n_u_cp936) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows949, __pyx_mstate_global->__pyx_n_u_cp949) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows950, __pyx_mstate_global->__pyx_n_u_cp950) < (0)) __PYX_ERR(7, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ENCODINGS_MAP, __pyx_t_4) < (0)) __PYX_ERR(7, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/settings.pyx":8 * * * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 8, __pyx_L1_error) } __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_5 = 0; { __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_5], __pyx_t_2) < (0)) __PYX_ERR(8, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/settings.pyx":32 * return self._is_utf8 * * cpdef get_text_codec(self): # <<<<<<<<<<<<<< * return self._codec * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_get_text_code, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_get_text_codec, __pyx_t_4) < (0)) __PYX_ERR(8, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/settings.pyx":35 * return self._codec * * cpdef inline register_data_types(self, types): # <<<<<<<<<<<<<< * self._data_codecs.add_types(types) * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_register_data, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_register_data_types, __pyx_t_4) < (0)) __PYX_ERR(8, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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): */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_add_python_co, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_add_python_codec, __pyx_t_4) < (0)) __PYX_ERR(8, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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) * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_remove_python, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_remove_python_codec, __pyx_t_4) < (0)) __PYX_ERR(8, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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() * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_clear_type_ca, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_clear_type_cache, __pyx_t_4) < (0)) __PYX_ERR(8, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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: */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_set_builtin_t, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_set_builtin_type_codec, __pyx_t_4) < (0)) __PYX_ERR(8, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "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_mstate_global->__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_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "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_2 = PyTuple_Pack(2, __pyx_t_4, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_get_data_code, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_get_data_codec, __pyx_t_4) < (0)) __PYX_ERR(8, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings___reduce_cyth, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings___setstate_cy, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":8 * * * from collections.abc import Mapping as MappingABC # <<<<<<<<<<<<<< * * import asyncpg */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Mapping}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) } __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Mapping}; __pyx_t_5 = 0; { __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); switch (__pyx_t_5) { case 0: if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MappingABC, __pyx_t_2) < (0)) __PYX_ERR(1, 8, __pyx_L1_error) break; default:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":10 * from collections.abc import Mapping as MappingABC * * import asyncpg # <<<<<<<<<<<<<< * from asyncpg import exceptions * */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_t_4) < (0)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":11 * * import asyncpg * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) } __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_5 = 0; { __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_5], __pyx_t_2) < (0)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_8CodecMap_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CodecMap___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_8CodecMap_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CodecMap___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":40 * * * codec_map = CodecMap() # <<<<<<<<<<<<<< * * */ __pyx_t_2 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_4); } if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_codec_map, ((PyObject *)__pyx_t_4)) < (0)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Codec___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Codec___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":517 * self._custom_type_codecs = {} * * def add_types(self, types): # <<<<<<<<<<<<<< * cdef: * Codec elem_codec */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_add_types, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_add_types, __pyx_t_4) < (0)) __PYX_ERR(1, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":647 * self.declare_fallback_codec(oid, name, schema) * * def add_python_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * typeinfos, encoder, decoder, format, xformat): * cdef: */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_add_python_codec, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_add_python_codec, __pyx_t_4) < (0)) __PYX_ERR(1, 647, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":692 * 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_remove_python_co, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_remove_python_codec, __pyx_t_4) < (0)) __PYX_ERR(1, 692, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":698 * * def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, * alias_to, format=PG_FORMAT_ANY): # <<<<<<<<<<<<<< * cdef: * Codec codec */ __pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_mstate_global->__pyx_k__4 = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":697 * self.clear_type_cache() * * def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format=PG_FORMAT_ANY): * cdef: */ __pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig__set_builtin_typ, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_set_builtin_type_codec_2, __pyx_t_4) < (0)) __PYX_ERR(1, 697, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":747 * * 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_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_mstate_global->__pyx_k__5 = __pyx_t_4; __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":746 * 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_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_set_builtin_type, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_set_builtin_type_codec, __pyx_t_4) < (0)) __PYX_ERR(1, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":752 * self.clear_type_cache() * * def clear_type_cache(self): # <<<<<<<<<<<<<< * self._derived_type_codecs.clear() * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_clear_type_cache, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_clear_type_cache, __pyx_t_4) < (0)) __PYX_ERR(1, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":755 * self._derived_type_codecs.clear() * * def declare_fallback_codec(self, uint32_t oid, str name, str schema): # <<<<<<<<<<<<<< * cdef Codec codec * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_declare_fallback, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_t_4) < (0)) __PYX_ERR(1, 755, __pyx_L1_error) __Pyx_DECREF(__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_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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) */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig___setstate_cytho, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":831 * cdef inline Codec get_core_codec( * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): # <<<<<<<<<<<<<< * cdef: * void *ptr = NULL */ __pyx_mstate_global->__pyx_k__7 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/codecs/base.pyx":850 * 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_mstate_global->__pyx_k__8 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/codecs/base.pyx":876 * decode_func decode, * ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): # <<<<<<<<<<<<<< * * if oid > MAXSUPPORTEDOID: */ __pyx_mstate_global->__pyx_k__9 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/codecs/pgproto.pyx":484 * * * init_all_pgproto_codecs() # <<<<<<<<<<<<<< */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_init_all_pgproto_codecs(); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":8 * * * from collections.abc import (Iterable as IterableABC, # <<<<<<<<<<<<<< * Mapping as MappingABC, * Sized as SizedABC) */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Iterable,__pyx_mstate_global->__pyx_n_u_Mapping,__pyx_mstate_global->__pyx_n_u_Sized}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error) } __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Iterable,__pyx_mstate_global->__pyx_n_u_Mapping,__pyx_mstate_global->__pyx_n_u_Sized}; for (__pyx_t_5=0; __pyx_t_5 < 3; __pyx_t_5++) { __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); switch (__pyx_t_5) { case 0: if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_IterableABC, __pyx_t_2) < (0)) __PYX_ERR(2, 8, __pyx_L1_error) break; case 1: if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MappingABC, __pyx_t_2) < (0)) __PYX_ERR(2, 9, __pyx_L1_error) break; case 2: if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SizedABC, __pyx_t_2) < (0)) __PYX_ERR(2, 10, __pyx_L1_error) break; default:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":12 * Sized as SizedABC) * * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_5 = 0; { __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_5], __pyx_t_2) < (0)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":18 * * # "NULL" * cdef Py_UCS4 *APG_NULL = [0x004E, 0x0055, 0x004C, 0x004C, 0x0000] # <<<<<<<<<<<<<< * * */ __pyx_t_11[0] = 0x004E; __pyx_t_11[1] = 0x0055; __pyx_t_11[2] = 0x004C; __pyx_t_11[3] = 0x004C; __pyx_t_11[4] = 0x0000; __pyx_v_7asyncpg_8protocol_8protocol_APG_NULL = __pyx_t_11; /* "asyncpg/protocol/codecs/array.pyx":875 * PG_FORMAT_BINARY) * * init_array_codecs() # <<<<<<<<<<<<<< */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_init_array_codecs(); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/range.pyx":8 * * * from asyncpg import types as apg_types # <<<<<<<<<<<<<< * * from collections.abc import Sequence as SequenceABC */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 8, __pyx_L1_error) } __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types}; __pyx_t_5 = 0; { __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); switch (__pyx_t_5) { case 0: if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_apg_types, __pyx_t_2) < (0)) __PYX_ERR(12, 8, __pyx_L1_error) break; default:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Sequence}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 10, __pyx_L1_error) } __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Sequence}; __pyx_t_5 = 0; { __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); switch (__pyx_t_5) { case 0: if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SequenceABC, __pyx_t_2) < (0)) __PYX_ERR(12, 10, __pyx_L1_error) break; default:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/record.pyx":8 * * * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 8, __pyx_L1_error) } __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_5 = 0; { __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_5], __pyx_t_2) < (0)) __PYX_ERR(13, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/record.pyx":71 * PG_FORMAT_BINARY) * * init_record_codecs() # <<<<<<<<<<<<<< */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_init_record_codecs(); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":8 * * * import hashlib # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_hashlib, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 8, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_hashlib, __pyx_t_4) < (0)) __PYX_ERR(15, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":8 * * * import base64 # <<<<<<<<<<<<<< * import hashlib * import hmac */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_base64, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_base64, __pyx_t_4) < (0)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":9 * * import base64 * import hashlib # <<<<<<<<<<<<<< * import hmac * import re */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_hashlib, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_hashlib, __pyx_t_4) < (0)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":10 * import base64 * import hashlib * import hmac # <<<<<<<<<<<<<< * import re * import secrets */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_hmac, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_hmac, __pyx_t_4) < (0)) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":11 * import hashlib * import hmac * import re # <<<<<<<<<<<<<< * import secrets * import stringprep */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_re, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 11, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_re, __pyx_t_4) < (0)) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":12 * import hmac * import re * import secrets # <<<<<<<<<<<<<< * import stringprep * import unicodedata */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_secrets, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_secrets, __pyx_t_4) < (0)) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":13 * import re * import secrets * import stringprep # <<<<<<<<<<<<<< * import unicodedata * */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_stringprep, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_stringprep, __pyx_t_4) < (0)) __PYX_ERR(3, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":14 * import secrets * import stringprep * import unicodedata # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_unicodedata, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 14, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_unicodedata, __pyx_t_4) < (0)) __PYX_ERR(3, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_kp_b_SCRAM_SHA_256); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_AUTHENTICATION_METHODS, __pyx_t_4) < (0)) __PYX_ERR(3, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "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(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_DEFAULT_CLIENT_NONCE_BYTES, __pyx_mstate_global->__pyx_int_24) < (0)) __PYX_ERR(3, 74, __pyx_L1_error) /* "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_4, __pyx_mstate_global->__pyx_n_u_hashlib); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sha256); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_DIGEST, __pyx_t_2) < (0)) __PYX_ERR(3, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "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 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_client_channel_binding, __pyx_mstate_global->__pyx_n_u_server_nonce); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_REQUIREMENTS_CLIENT_FINAL_MESSAG, __pyx_t_2) < (0)) __PYX_ERR(3, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "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 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_n_u_password_iterations, __pyx_mstate_global->__pyx_n_u_password_salt, __pyx_mstate_global->__pyx_n_u_server_first_message, __pyx_mstate_global->__pyx_n_u_server_nonce); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_REQUIREMENTS_CLIENT_PROOF, __pyx_t_2) < (0)) __PYX_ERR(3, 78, __pyx_L1_error) __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_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_a1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c12); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 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_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c21_c22); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 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_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c3); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __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_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c4); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __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_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c5); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __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_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c6); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __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_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c7); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __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_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c8); if (unlikely(!__pyx_t_17)) __PYX_ERR(3, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __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_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c9); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __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_Pack(10, __pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_SASLPREP_PROHIBITED, __pyx_t_2) < (0)) __PYX_ERR(3, 80, __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_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 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_mstate_global->__pyx_n_u_SCRAMAuthentication___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":15 * * 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(15, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_KERBEROS); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_n_u_kerberosv5) < (0)) __PYX_ERR(15, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "asyncpg/protocol/coreproto.pyx":16 * AUTH_METHOD_NAME = { * AUTH_REQUIRED_KERBEROS: 'kerberosv5', * AUTH_REQUIRED_PASSWORD: 'password', # <<<<<<<<<<<<<< * AUTH_REQUIRED_PASSWORDMD5: 'md5', * AUTH_REQUIRED_GSS: 'gss', */ __pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORD); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_n_u_password) < (0)) __PYX_ERR(15, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 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_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORDMD5); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_n_u_md5) < (0)) __PYX_ERR(15, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 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_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_n_u_gss) < (0)) __PYX_ERR(15, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 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_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SASL); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_kp_u_scram_sha_256) < (0)) __PYX_ERR(15, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; /* "asyncpg/protocol/coreproto.pyx":20 * AUTH_REQUIRED_GSS: 'gss', * AUTH_REQUIRED_SASL: 'scram-sha-256', * AUTH_REQUIRED_SSPI: 'sspi', # <<<<<<<<<<<<<< * } * */ __pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SSPI); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_n_u_sspi) < (0)) __PYX_ERR(15, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AUTH_METHOD_NAME, __pyx_t_2) < (0)) __PYX_ERR(15, 14, __pyx_L1_error) __Pyx_DECREF(__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_mstate_global->__pyx_n_u_CoreProtocol_is_in_transaction, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_mstate_global->__pyx_n_u_is_in_transaction, __pyx_t_2) < (0)) __PYX_ERR(15, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(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_mstate_global->__pyx_n_u_CoreProtocol___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoreProtocol___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1232 * * * SYNC_MESSAGE = bytes(WriteBuffer.new_message(b'S').end_message()) # <<<<<<<<<<<<<< * FLUSH_MESSAGE = bytes(WriteBuffer.new_message(b'H').end_message()) */ __pyx_t_18 = NULL; __pyx_t_17 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('S')); if (unlikely(!__pyx_t_17)) __PYX_ERR(15, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_16 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_17)->__pyx_vtab)->end_message(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_17)); if (unlikely(!__pyx_t_16)) __PYX_ERR(15, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_16}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE, __pyx_t_2) < (0)) __PYX_ERR(15, 1232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1233 * * SYNC_MESSAGE = bytes(WriteBuffer.new_message(b'S').end_message()) * FLUSH_MESSAGE = bytes(WriteBuffer.new_message(b'H').end_message()) # <<<<<<<<<<<<<< */ __pyx_t_16 = NULL; __pyx_t_18 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('H')); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_17 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_18)->__pyx_vtab)->end_message(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_18)); if (unlikely(!__pyx_t_17)) __PYX_ERR(15, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_17}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FLUSH_MESSAGE, __pyx_t_2) < (0)) __PYX_ERR(15, 1233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":8 * * * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 8, __pyx_L1_error) } __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions}; __pyx_t_5 = 0; { __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_17)) __PYX_ERR(17, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_5], __pyx_t_17) < (0)) __PYX_ERR(17, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":35 * self.ignore_custom_codec = ignore_custom_codec * * def _get_parameters(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState__get_para, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_get_parameters, __pyx_t_2) < (0)) __PYX_ERR(17, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":49 * return tuple(result) * * def _get_attributes(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState__get_attr, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_get_attributes, __pyx_t_2) < (0)) __PYX_ERR(17, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":73 * return tuple(result) * * def _init_types(self): # <<<<<<<<<<<<<< * cdef: * Codec codec */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState__init_typ, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_init_types, __pyx_t_2) < (0)) __PYX_ERR(17, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":92 * return missing * * cpdef _init_codecs(self): # <<<<<<<<<<<<<< * self._ensure_args_encoder() * self._ensure_rows_decoder() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState__init_cod, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_init_codecs, __pyx_t_2) < (0)) __PYX_ERR(17, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":96 * self._ensure_rows_decoder() * * def attach(self): # <<<<<<<<<<<<<< * self.refs += 1 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState_attach, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_attach, __pyx_t_2) < (0)) __PYX_ERR(17, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":99 * self.refs += 1 * * def detach(self): # <<<<<<<<<<<<<< * self.refs -= 1 * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState_detach, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_detach, __pyx_t_2) < (0)) __PYX_ERR(17, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":102 * self.refs -= 1 * * def mark_closed(self): # <<<<<<<<<<<<<< * self.closed = True * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState_mark_clos, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_mark_closed, __pyx_t_2) < (0)) __PYX_ERR(17, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":105 * self.closed = True * * def mark_unprepared(self): # <<<<<<<<<<<<<< * if self.name: * raise exceptions.InternalClientError( */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState_mark_unpr, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_mark_unprepared, __pyx_t_2) < (0)) __PYX_ERR(17, 105, __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_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState___reduce, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 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_22PreparedStatementState_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState___setstat, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":73 * * * NO_TIMEOUT = object() # <<<<<<<<<<<<<< * * */ __pyx_t_17 = NULL; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_17, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_object, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NO_TIMEOUT, __pyx_t_2) < (0)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":111 * self.create_future = self._create_future_fallback * * def set_connection(self, connection): # <<<<<<<<<<<<<< * self.conref = weakref.ref(connection) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_set_connection, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_set_connection, __pyx_t_2) < (0)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":120 * return None * * def get_server_pid(self): # <<<<<<<<<<<<<< * return self.backend_pid * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_get_server_pid, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_get_server_pid, __pyx_t_2) < (0)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":123 * return self.backend_pid * * def get_settings(self): # <<<<<<<<<<<<<< * return self.settings * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_get_settings, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_get_settings, __pyx_t_2) < (0)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":126 * return self.settings * * def get_record_class(self): # <<<<<<<<<<<<<< * return self.record_class * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_get_record_class, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_get_record_class, __pyx_t_2) < (0)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":139 * self.transport.pause_reading() * * async def prepare(self, stmt_name, query, timeout, # <<<<<<<<<<<<<< * *, * PreparedStatementState state=None, */ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "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_2, __pyx_mstate_global->__pyx_n_u_state, Py_None) < (0)) __PYX_ERR(0, 139, __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_2, __pyx_mstate_global->__pyx_n_u_ignore_custom_codec, Py_False) < (0)) __PYX_ERR(0, 139, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":139 * self.transport.pause_reading() * * async def prepare(self, stmt_name, query, timeout, # <<<<<<<<<<<<<< * *, * PreparedStatementState state=None, */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_prepare, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_17, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_prepare, __pyx_t_17) < (0)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":167 * return await waiter * * async def bind_execute( # <<<<<<<<<<<<<< * self, * state: PreparedStatementState, */ __pyx_t_17 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_state, __pyx_mstate_global->__pyx_n_u_PreparedStatementState) < (0)) __PYX_ERR(0, 167, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_portal_name, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 167, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_limit, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(0, 167, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_return_extra, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 167, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind_execute, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_17); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_bind_execute, __pyx_t_2) < (0)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":207 * return await waiter * * async def bind_execute_many( # <<<<<<<<<<<<<< * self, * state: PreparedStatementState, */ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_state, __pyx_mstate_global->__pyx_n_u_PreparedStatementState) < (0)) __PYX_ERR(0, 207, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_portal_name, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 207, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return_rows, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind_execute_many, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_17, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_bind_execute_many, __pyx_t_17) < (0)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":268 * return await waiter * * async def bind(self, PreparedStatementState state, args, # <<<<<<<<<<<<<< * str portal_name, timeout): * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_bind, __pyx_t_17) < (0)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":296 * return await waiter * * async def execute(self, PreparedStatementState state, # <<<<<<<<<<<<<< * str portal_name, int limit, return_extra, * timeout): */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_execute, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_execute, __pyx_t_17) < (0)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":325 * return await waiter * * async def close_portal(self, str portal_name, timeout): # <<<<<<<<<<<<<< * * if self.cancel_waiter is not None: */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close_portal, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_close_portal, __pyx_t_17) < (0)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":347 * return await waiter * * async def query(self, query, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_29query, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_query, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_query, __pyx_t_17) < (0)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":371 * return await waiter * * async def copy_out(self, copy_stmt, sink, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_copy_out, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_copy_out, __pyx_t_17) < (0)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":424 * return status_msg * * async def copy_in(self, copy_stmt, reader, data, # <<<<<<<<<<<<<< * records, PreparedStatementState record_stmt, timeout): * cdef: */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_copy_in, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_copy_in, __pyx_t_17) < (0)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":562 * return status_msg * * async def close_statement(self, PreparedStatementState state, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close_statement, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_close_statement, __pyx_t_17) < (0)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":587 * return await waiter * * def is_closed(self): # <<<<<<<<<<<<<< * return self.closing * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_is_closed, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_is_closed, __pyx_t_17) < (0)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":590 * return self.closing * * def is_connected(self): # <<<<<<<<<<<<<< * return not self.closing and self.con_status == CONNECTION_OK * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_is_connected, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_is_connected, __pyx_t_17) < (0)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":593 * return not self.closing and self.con_status == CONNECTION_OK * * def abort(self): # <<<<<<<<<<<<<< * if self.closing: * return */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_abort, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_abort, __pyx_t_17) < (0)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":602 * self.transport = None * * async def close(self, timeout): # <<<<<<<<<<<<<< * if self.closing: * return */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_47close, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_close, __pyx_t_17) < (0)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":642 * self.transport.abort() * * def _request_cancel(self): # <<<<<<<<<<<<<< * self.cancel_waiter = self.create_future() * self.cancel_sent_waiter = self.create_future() */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__request_cancel, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_t_17) < (0)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":669 * 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_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__on_timeout, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_on_timeout, __pyx_t_17) < (0)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":677 * self.waiter.set_exception(asyncio.TimeoutError()) * * def _on_waiter_completed(self, fut): # <<<<<<<<<<<<<< * if self.timeout_handle: * self.timeout_handle.cancel() */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__on_waiter_complete, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_on_waiter_completed, __pyx_t_17) < (0)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":686 * self._request_cancel() * * def _create_future_fallback(self): # <<<<<<<<<<<<<< * return asyncio.Future(loop=self.loop) * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__create_future_fall, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_create_future_fallback, __pyx_t_17) < (0)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":702 * self.settings.add_setting(name, val) * * def _get_timeout(self, timeout): # <<<<<<<<<<<<<< * if timeout is not None: * try: */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__get_timeout, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_get_timeout, __pyx_t_17) < (0)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":738 * 'cannot perform operation: another operation is in progress') * * def _is_cancelling(self): # <<<<<<<<<<<<<< * return ( * self.cancel_waiter is not None or */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__is_cancelling, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_is_cancelling, __pyx_t_17) < (0)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":744 * ) * * async def _wait_for_cancellation(self): # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol__wait_for_cancellat, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_wait_for_cancellation, __pyx_t_17) < (0)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":963 * # asyncio callbacks: * * def data_received(self, data): # <<<<<<<<<<<<<< * self.buffer.feed_data(data) * self._read_server_messages() */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_data_received, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_data_received, __pyx_t_17) < (0)) __PYX_ERR(0, 963, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":967 * self._read_server_messages() * * def connection_made(self, transport): # <<<<<<<<<<<<<< * self.transport = transport * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_connection_made, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_connection_made, __pyx_t_17) < (0)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":985 * self._on_error(ex) * * def connection_lost(self, exc): # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_connection_lost, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_connection_lost, __pyx_t_17) < (0)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":990 * self._on_connection_lost(exc) * * def pause_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.clear() * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_pause_writing, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_pause_writing, __pyx_t_17) < (0)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":993 * self.writing_allowed.clear() * * def resume_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.set() * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_resume_writing, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_resume_writing, __pyx_t_17) < (0)) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_17)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_17) < (0)) __PYX_ERR(9, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 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) */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_17)) __PYX_ERR(9, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_17) < (0)) __PYX_ERR(9, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":1005 * * * class Timer: # <<<<<<<<<<<<<< * def __init__(self, budget): * self._budget = budget */ __pyx_t_17 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Timer, __pyx_mstate_global->__pyx_n_u_Timer, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, (PyObject *) NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); /* "asyncpg/protocol/protocol.pyx":1006 * * class Timer: * def __init__(self, budget): # <<<<<<<<<<<<<< * self._budget = budget * self._started = 0 */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Timer___init, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < (0)) __PYX_ERR(0, 1006, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":1010 * self._started = 0 * * def __enter__(self): # <<<<<<<<<<<<<< * if self._budget is not None: * self._started = time.monotonic() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_3__enter__, 0, __pyx_mstate_global->__pyx_n_u_Timer___enter, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_2) < (0)) __PYX_ERR(0, 1010, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":1014 * self._started = time.monotonic() * * def __exit__(self, et, e, tb): # <<<<<<<<<<<<<< * if self._budget is not None: * self._budget -= time.monotonic() - self._started */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_5__exit__, 0, __pyx_mstate_global->__pyx_n_u_Timer___exit, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_2) < (0)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":1018 * self._budget -= time.monotonic() - self._started * * def get_remaining_budget(self): # <<<<<<<<<<<<<< * return self._budget * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget, 0, __pyx_mstate_global->__pyx_n_u_Timer_get_remaining_budget, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_t_2) < (0)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":1021 * return self._budget * * def has_budget_greater_than(self, amount): # <<<<<<<<<<<<<< * if self._budget is None: * # Unlimited budget. */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than, 0, __pyx_mstate_global->__pyx_n_u_Timer_has_budget_greater_than, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_has_budget_greater_than, __pyx_t_2) < (0)) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":1005 * * * class Timer: # <<<<<<<<<<<<<< * def __init__(self, budget): * self._budget = budget */ __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Timer, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_17, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Timer, __pyx_t_2) < (0)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":1029 * * * class Protocol(BaseProtocol, asyncio.Protocol): # <<<<<<<<<<<<<< * pass * */ __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_Protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol), __pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_16 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_18 = __Pyx_Py3MetaclassPrepare(__pyx_t_16, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_Protocol, __pyx_mstate_global->__pyx_n_u_Protocol, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, (PyObject *) NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (__pyx_t_2 != __pyx_t_17) { if (unlikely((PyDict_SetItemString(__pyx_t_18, "__orig_bases__", __pyx_t_17) < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_Protocol, __pyx_t_2, __pyx_t_18, NULL, 0, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Protocol, __pyx_t_17) < (0)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":1033 * * * def _create_record(object mapping, tuple elems): # <<<<<<<<<<<<<< * # Exposed only for testing purposes. * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_1_create_record, 0, __pyx_mstate_global->__pyx_n_u_create_record, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_create_record, __pyx_t_2) < (0)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs') */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_DataCodecConfig, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_DataCodecConfig, __pyx_t_2) < (0)) __PYX_ERR(9, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * cdef extern from *: # <<<<<<<<<<<<<< * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CoreProtocol, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CoreProtocol, __pyx_t_2) < (0)) __PYX_ERR(9, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":4 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_result * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_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_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_BaseProtocol, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_BaseProtocol, __pyx_t_2) < (0)) __PYX_ERR(9, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.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(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 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_4); __Pyx_XDECREF(__pyx_t_7); __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_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); if (__pyx_m) { if (__pyx_mstate->__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; #else return __pyx_m; #endif } /* #### Code section: pystring_table ### */ /* #### Code section: cached_builtins ### */ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object); if (!__pyx_builtin_object) __PYX_ERR(0, 73, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 581, __pyx_L1_error) __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(2, 379, __pyx_L1_error) __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_any); if (!__pyx_builtin_any) __PYX_ERR(3, 132, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(3, 188, __pyx_L1_error) /* Cached unbound methods */ __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get; __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type; __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values; return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "asyncpg/protocol/codecs/base.pyx":547 * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): * name = name[1:] # <<<<<<<<<<<<<< * name = '{}[]'.format(name) * */ __pyx_mstate_global->__pyx_slice[0] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(1, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); /* "(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 */ __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u_self__custom_type_codecs_is_not); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(9, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u_self__execute_iter_is_not_None_o); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(9, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); /* "asyncpg/protocol/protocol.pyx":248 * * while more: * with timer: # <<<<<<<<<<<<<< * await compat.wait_for( * self.writing_allowed.wait(), */ __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); /* "(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 */ __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u_self__execute_iter_is_not_None_o_2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(9, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); #if CYTHON_IMMORTAL_CONSTANTS { PyObject **table = __pyx_mstate->__pyx_tuple; for (Py_ssize_t i=0; i<4; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); #else Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); #endif } } #endif #if CYTHON_IMMORTAL_CONSTANTS { PyObject **table = __pyx_mstate->__pyx_slice; for (Py_ssize_t i=0; i<1; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); #else Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); #endif } } #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { const struct { const unsigned int length: 11; } index[] = {{31},{53},{34},{25},{80},{67},{4},{179},{176},{6},{25},{61},{26},{1},{0},{1},{2},{1},{1},{4},{1},{2},{3},{2},{1},{4},{1},{51},{8},{17},{21},{149},{32},{30},{34},{29},{26},{29},{57},{11},{6},{13},{48},{75},{79},{57},{58},{46},{23},{78},{64},{64},{60},{17},{11},{48},{24},{19},{18},{30},{73},{30},{7},{16},{44},{6},{45},{27},{35},{2},{40},{112},{13},{48},{51},{25},{37},{23},{48},{33},{58},{13},{61},{9},{50},{32},{34},{34},{29},{36},{53},{45},{38},{21},{67},{50},{21},{21},{13},{64},{26},{5},{38},{26},{26},{42},{48},{17},{37},{15},{48},{38},{13},{77},{448},{792},{61},{53},{113},{14},{6},{27},{18},{14},{86},{49},{65},{14},{18},{21},{23},{26},{4},{32},{42},{37},{52},{41},{40},{45},{46},{43},{35},{37},{40},{25},{26},{72},{24},{50},{30},{36},{66},{38},{29},{40},{69},{63},{5},{57},{54},{7},{11},{22},{16},{13},{9},{21},{20},{12},{30},{32},{36},{25},{27},{24},{33},{28},{35},{18},{17},{25},{30},{18},{25},{28},{28},{28},{20},{21},{26},{20},{29},{27},{25},{22},{25},{26},{20},{18},{27},{27},{14},{21},{5},{8},{26},{28},{23},{25},{27},{18},{36},{38},{35},{35},{33},{33},{38},{38},{41},{12},{30},{32},{30},{26},{6},{15},{33},{35},{39},{32},{25},{32},{38},{35},{38},{9},{13},{5},{13},{6},{11},{14},{19},{8},{11},{8},{7},{10},{2},{4},{10},{4},{8},{9},{11},{24},{13},{22},{40},{42},{38},{38},{35},{34},{29},{29},{34},{38},{8},{13},{20},{33},{25},{8},{5},{6},{16},{19},{19},{37},{39},{47},{56},{12},{15},{8},{11},{5},{8},{18},{11},{12},{5},{15},{14},{14},{26},{29},{4},{29},{14},{1},{3},{3},{5},{7},{7},{17},{16},{9},{4},{9},{5},{9},{8},{3},{6},{9},{3},{8},{13},{18},{23},{21},{18},{10},{7},{13},{11},{8},{7},{12},{9},{8},{4},{8},{5},{17},{5},{7},{18},{7},{18},{25},{23},{6},{8},{9},{11},{8},{21},{9},{1},{9},{9},{3},{5},{6},{10},{9},{8},{13},{3},{6},{6},{4},{12},{17},{34},{3},{4},{3},{6},{6},{7},{6},{8},{5},{9},{1},{9},{9},{22},{10},{6},{23},{9},{9},{4},{9},{5},{3},{4},{6},{17},{8},{5},{16},{22},{15},{18},{5},{12},{15},{5},{9},{9},{9},{6},{11},{15},{15},{16},{15},{6},{9},{3},{10},{7},{13},{10},{15},{15},{7},{25},{8},{26},{9},{10},{6},{6},{6},{6},{6},{6},{6},{6},{6},{6},{5},{5},{5},{5},{5},{5},{13},{23},{14},{10},{7},{1},{4},{8},{13},{9},{8},{4},{7},{22},{6},{7},{4},{6},{6},{8},{5},{6},{7},{4},{1},{4},{10},{10},{11},{9},{13},{5},{8},{13},{5},{6},{7},{9},{9},{2},{6},{12},{6},{6},{5},{5},{5},{13},{2},{3},{9},{10},{7},{8},{1},{6},{11},{6},{6},{3},{6},{7},{8},{3},{7},{3},{15},{14},{14},{15},{16},{20},{14},{12},{14},{12},{16},{12},{5},{3},{6},{6},{9},{23},{17},{7},{9},{4},{4},{17},{1},{19},{19},{11},{11},{12},{16},{11},{11},{11},{11},{11},{11},{11},{11},{11},{16},{4},{8},{12},{11},{8},{3},{4},{4},{4},{7},{8},{8},{14},{9},{12},{13},{17},{7},{4},{5},{8},{4},{5},{8},{10},{4},{6},{6},{5},{5},{10},{8},{16},{5},{4},{6},{4},{5},{9},{4},{7},{8},{8},{11},{7},{11},{15},{3},{7},{13},{7},{10},{5},{9},{4},{15},{10},{4},{8},{3},{7},{4},{9},{2},{8},{7},{6},{3},{9},{11},{20},{6},{5},{8},{19},{13},{4},{13},{13},{21},{28},{10},{14},{15},{6},{11},{12},{12},{11},{5},{7},{3},{11},{8},{8},{7},{11},{20},{21},{8},{14},{12},{11},{10},{27},{27},{30},{14},{12},{5},{5},{13},{18},{17},{5},{2},{6},{4},{3},{6},{12},{11},{7},{10},{17},{13},{3},{9},{8},{12},{9},{13},{19},{12},{7},{11},{7},{12},{7},{7},{7},{7},{19},{15},{6},{14},{14},{12},{11},{8},{3},{1},{6},{6},{6},{7},{4},{4},{20},{12},{15},{3},{22},{23},{14},{13},{12},{10},{10},{10},{12},{19},{8},{6},{9},{14},{4},{4},{5},{8},{4},{4},{6},{9},{4},{7},{8},{10},{5},{10},{4},{9},{3},{10},{16},{12},{11},{2},{4},{8},{8},{4},{5},{2},{3},{4},{7},{5},{9},{11},{6},{9},{8},{11},{9},{7},{11},{7},{8},{5},{13},{9},{8},{8},{7},{5},{10},{6},{7},{11},{7},{6},{5},{9},{5},{12},{4},{5},{4},{5},{6},{6},{7},{4},{5},{1},{4},{8},{22},{6},{3},{4},{7},{4},{3},{7},{7},{7},{7},{7},{7},{7},{7},{7},{6},{6},{6},{6},{6},{6},{11},{11},{11},{11},{11},{11},{11},{11},{11},{10},{10},{10},{10},{10},{10},{8},{5},{10},{15},{1},{7},{3},{4},{3},{1},{3},{10},{11},{1717},{13},{10},{2},{1},{1},{4},{0},{2},{3},{10},{2},{8},{8},{11},{2},{34},{258},{18},{29},{52},{67},{77},{152},{70},{29},{24},{30},{88},{111},{75},{12},{12},{804},{38},{96},{21},{9},{9},{15},{16},{12},{13},{18},{122},{28},{140},{113},{12},{258},{9},{21},{25},{18},{26},{17},{2},{9},{11},{366},{600},{96},{8},{2},{14},{2},{11},{2},{2},{57},{55},{110},{3},{2},{3},{3},{10},{11},{9},{4},{1},{15},{1},{1},{1},{3},{1}}; #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (8146 bytes) */ const char* const cstring = "(\265/\375`ARE\376\000\332\354\2241I\000\317\352\374_wi\255\351\267\337\227\257\351\267_\352\270\216\353\270\216\357\033\305+M\254LIM\246\244l\262\266\223\244\3235\247\337\302u\275\005Sn\204T\337\317\235\000O\360\00378\263\303\235\262\313n>?\363z\210\366\265\016\276\002\324\002\034\003|\344\264\215\255\375y\347P\337|\023\253\2658,\255\275\262\235\313X\356\377\337\272s\254\362\275\313Z\277c\305\261\2737\215\354V\022\n\222\317\243\326X\337\321\205\277\317Z\364\371\337;\303\333\302/\371OA\321\355[\2068WK*T\334z\377\025sX\334y\246\212\267\235\263h\341\207;C\250{\305\363\216C`_\242\330\251\342.\261.E>\326L^\357g\033\307wm\227_\227\341\014W\026S-]\330\245\350sXr\321gq\006\307\273\205ya\261pi\336B\016q@\327\351\245\223\345^\376\273g\331\337:\376\372z\274\375\3073Q\227<\024\363x\373\245e\020\261\316WvR3\234`-\346\023Z\350SzxPP)\230+\207\305\322y\221\000q\356\317u\246v\374}\236\341\216g\327\343\320\373>\303\353\3301\351g\373\366\372s\370\327\031\225\223\036\236\223\013\225fTih\252\317\300u\230\365\255\241\307_\027\323\365\237cX\264\341J\337\330\206\025\347K\035\352\264\276\345/G\033\372?~oE\022\367\234\216\274\261\025\037\256\220++\2650\314\263;\256\250\304J\332\3173\354/\326\254\252\342\373\325\032\353b\274\346\216e\264\252y\310?\357,\225\031\031n\035\327\262\216o\274\322\376lc]u\267\367\253\023/\356\372b+\2127\005\245\343\217u\354v\026\331\327\233\202b\247\207\207\203\212J\235\211@\352\341!\255t\250%\225|\373\305\365\236\372\031\246\362Krg_\362Q\267\271&\307\\\253\307\\\2547\255\027\356\263\3579k\006\353\312K}o\025\245\312A\251*\256\234\227K\347TS.\360\346\324y\035\221R\211\250)\327\251\342Z\255u\216\253\024(T\2553\256\364J\351\334\200\"R6\256\024\016\252\226R0\020\305\322q\245^+U-\301N\251\233\324\013{<\336~\311ZU\260\327\267\006\337z\026+\311~\276\367%\211\030\357Zr]\225\251\252\212\327\271\214y\035\306\374\n\334]d\\,\260R\254\272{\356\037\377\333q,k,\322\276\356\322\370\no\276\362ae\251VX'X\355\\\3269I\226\276\352\364\346\325\347z\303L\373\345\255*\326\353\265\242b\201""\257\227\215\312\r+\377\276\254\"&u\277\342\237='\307\237\303\254\367\255\375\352\332\261\230\375\206\236>\342\251~\266\363\377\370\265y\336{\003\356<\264#\326\270\366\360\320\210\231\327\020\213\374\244A\305\377\215\307r\326o\225\361\254\275\277\344\367;\337\331\255\272^1\355\327Z\210i\247\372\371\254\226p\270qi\303\276\336*\342\037b2\207\353\214\270\263\207\377\177\274\363xm\016\213&\021\203L\014\314\213K\213\211\205\305\024\306L\327\376\034\313\264=\313y\244\375\235i9L\243u\376C|\363\177\026\313\332\373\031i\355\017w\351\377(\223q\301\2112\235\316\343\225\311r\270\343\331\354\326k\244\313\205\013,\326\347\025;\264a\211?\326}r\304\330\206\374{<\313\242h\255\316\372\216\031\213a\210\301\005\206\245\005C\014\014\214\014\313\213L\014\314\213K\013\213\351\302\013\213\211\0147\\16^\037j\337?\211C\274\367\356diu\330s\330\305\034Z\033\216\275\227\332\206\374z2\226\3431\315y\354\347\330\337y\226c\326\005&\333\215]`b1k\275'\261\212\307%\357<\337\234Coe\335\337\230\335|\337\336u\177\227|\274__\376\303\254\303\353c7\214\335l\257\325\367\324\261\327\271\270F\307Z\177i\342\316?\3470\254\004H\362/\276^\247U\t\234\325\273o\360\372\206\\kP\351\333\217g\265\360\306>\366\326\206*\330_\026\210cW*\330\215J\307\003\250\002S8\340\312\242r>\300R8v\225\243\202\201'\025l\225\372\000\323\001_)V\t\230-\001\272\\ \t\325J\307\326\2002\236\265\327\271\2132\026d\377V\021\2547/\360\265\313\334\357.u\276\375\373\031\2543M\334\330\337""\334\350\254\274\250\357\350o\254\3220\027\311\221\305L\017\216\247\366\350xj\311gZ\217\347\351\311\305\300\304\260\264\374K\303\325\221w\331\036K\022\211D\252%\022\t\305\316\006\034\366\222\367\3575\304\262\316\244\347\242\210\263,\343\270\326\327\217b\036\253\210\265h\255\330I\316\355\367W\2272k\377\306\336\372}\373\367e\350s?\264V&+c\242x\255\276V\034\313\320\252\3104\366\233w\332\276\270\357\313\277\247\251\330\031Y\357\t\352\344\373\236eu\306\317\374h-\366\342\214\335\334\242\330\0213\037\3131\347\256\210\361Xn\274\361,\005LL\010\3746$\234\nJ\024\020\260\225\214\316\030S\246\302\257\265{\251\360\273<\020;\014\246]\213\200Vo\206\227\241G\201\227\340B\002\037\216\317\210\311O\024\203\324\363p2MF~\3274\020b\332\375\324\225BHCP\324)r\002\030\241\034\250Nww\rR\022*B7\2306\014\320\023\032\301\304gK%\2441h\216i\362z\211\271\262\325\013\365\016\360R\273\021iH\347l\200\232P\005g\002R\212\341\2368\323\345g\324\023\365H\274\031\223_\365\2550\r\234/\363&\332m\354\036\240 #\32041S\246\350\343\307d\0220\277\315\207$}AGh\310\211\032\355XR~ \357\303N\226\026@)\361\211F4Jd\\^\2137\262+\371\215x3\004F4Dd\214L/\002\242\341!\003\255+|Zx\000x\017R\030\n\001E9\305\021z\362\273(\356$1KN\034\360\224\251\230!F6\316\033\237\215\335\005\006\276\035\270sy\340\273#\250\315\224\346\234\024\314\001\"?\035'\002\021\203\222\320\304\331|\\6J|%\246S\201\350D\260q\0360Eh\010\2751MJ~\266\363t\366\260Ho\372\342G\304\253\245\255t\006\375\347\203\222\037x\0228Y\370\220\210\374\256\t\302G\344\343\007\344Q\330\211v\260\324\002\002\037\002\221\237\213\266\320\221\023\201\310o\003]a\266\314\031\233y@\344G\224\246\034\360\035\020\371\265L\010f\214O\200\217\037t$\362\023\245\033)\315\311`D\343C\006\213\251u6\260\245+\022~`O\204\267\"-\201\202h\004\021\237\310\307\317t\341\007\302\000}D;\230t\224R\000\3756`T\240\360si\371\031\371\334\036\010\236\211\247`gB9\224R*\210'Phr\211&\334\320\320\320(i\234\234\274\300\017/\013\261\216E~+K<\212Y\2475X\276\206\315i\316\275\206\265\376j\244\270j\276\207\021)\336[\n""\265\226fd\214\215\261e\377\036\205B\216\216\245\02122#\244\004+\347d\303\322\341\020\225\314,tz\314\311\344r\326c\231\030\230\027\227\026\026\223\030#\023\003\363\342\322\302b\332\031\207\373\3058\234\2778\034\277\335\233\027sY\312\330^\222%&\313\274\313\314\275\230s\337\373\277q\215\177\376Y\210\237\366\255e1\305\274\354[\370c\037\317:\351\255\266\365\331\350\275\366\265/\313\264K\373$\257\205\334Zqc/\323\330\373\357\261\367\375\352\033z\021\373\356q\274\357Qs\034\362\031\367\262\034\366\032\367\230\276\245\355\206u-\3145Y\266\326\222$\237\351\364\316\234\374\234\346\311\273=\306\342\376>k{\013Gqc\022kQ\344\271;\356<\352\306\322s\035\353\244%/\311\305\314C]n\277q\030\347\316{\347c\370\271\016o\373\"\216c\315Z\231\031\366\272c\034Y\3268\327Y\343\331-\365\255\373X\257\225e\2672\231\327j/\267\032-\266\271_\341}\326\3676\303?\375E\034G,\2067_BQJ\261\203B\323iz\211\206,\321\354Ri\337\264%\305\003Dg\202k\266\350\370\204|>@\027m\321>\021zP\r:\240\034\214\217\020\030c\363^\344N\r\240\337\313\345[\365P,>\321\316\364\321\002\005\345`\022\000\375\\-_\255\227\201\027`w\241\372@?\033#\237Qz\300\300\257\204\344g\240\300O\t\211\350\034\361Bl?7\006\256\027\2027\002\264\273`J?J\n0\"\200\010\021\001\\\256\000\001\300\220\236\236\220\377CH2$D\014\tQ\021\022\222\023\022\022\002\344\305\013\020\036\036\020\357A8\007\021E\020\025*@H\220\000\201\301@@R \340\207\367\037\234\177\354\354|\214\030\361\221J}|\200\000\306\021@\316\000V+\000 @\000\000\000z\364\364x\354\355\261b\205\207\t\023\036\"D\204\010\021r\341\"\304\202Eh\034C9\207\254\r\355\354\204X\254\320\315\r\250E\013P.\227\"\005\310\204\t\020\016\016H\245\342\341\351\250\325:f\263\016\227\253c\265\352H\245:@\220\203$9\2646ab\243\005\017\316\207\3731\305\260!\221\370l\346\200\217\2249\302\347\006\003\000\250t\326\230\240\237\007\351\301\271G\255\346a\255\307\316\216\307\353\345\221\223\343\341a\343\341q\n\225e\310f\013\241@\021*Q\"dc\023\n\235@\234\203j5\020\213\005\272\271\001\235@\247\216\027/:\312\262\303f\353\220\311:b\261\016""\035\235\216V\253\003\205\352\350\320\321\201\003\207\343\360\236#\026\343H\221\202\203\305\342\270\271\341\360\300\341a\303\205\206\206\214\236\3217f_\206\371`,\037\013\203\017\266{\021\371`>\002B\0332\263\202OH\013\265\241.3\014\362\022\301\007*yIi:p\370q\330p\332\211\200L\005b\314z5/\273\026\322\017dw\201\244w \322\022-\320rP\240\232\374\022\350\354B;\014\243\323\233(\244\t\026<\250\000\256\351a\212FL\347\202\222\002\276\020\210\304WrE\350\212)\372\010\330m4\202-u\020\272\275\235\023\250\024\214\t\213\252N\320\211\240\304\244u:\030\031\235\253\020\360\236\002L\247\010\360\004\001\331\251\240'\014~\2463\000j\200fF0\007\220\310\234\004H~\2553\264Ar\352D\242\036\213]NE3\325\035\315\320\002(\351\3241\013\244\234?\2219\000f\227\202\232`\3423\355\014\354R\025`,\3746z\037\274\t;\235\024\205W\263+7b\330z6-\036\211\335\255\325K\231z\243\236\207\005\023|-\224\005\205\260\013\221\202=S\357D\323J-$\370\271ii\344J[\0040\2456\245\224@\212\000e\321\352\201=\024\003\024\337\212\323\001\002\010\007L>L\240\367\004aB\210\261\021\343\003\002\231\010>\n\266\017\"\r\251\014*\342l\200\340\227\200\205(M\371\271\273\326\216A\014-\261\321\353\240\342k\245,i\005\004\032$\370L\320\021\032\236\031l<\016%\237)U\200\302\316\006%?\255\021\347\315[\347\214\371OFf\315\000\0315(\t\004|\337\266#Im(\251\376\002\211l\250\304\321\311#\253\034f\314\314\214\010\022@\000\000Sa\030T*\227H\205#\342\270vTGP\016\210SZh\210\304H\2143\014\031\214D\000D\002\001@\001\000\002\000\000\267\347\206\254\025P\225\354\271\247\216\340\336\351\024r\340\330*\301U-\330\266A\360}\026\254\277\345\376\253\002\235\031\331E#M{\344\023\025\330\264w\361\245\026X'\332\364&5\177\310O\340\003\377l\370\255\316\035\362\005\0251E\232jG\233\213\006;\371t\357;\023\005\000\335\037\322bS\250G\016\030\007c\354;n\221\301f\010bm\266\300\277$\267\215\274\344G%\261\013\305\337w\006{\323\302\001P[\027l\343\t0W\210i\230\311L\256j\204{!\322\232\273\300\332\tv""\212G!\r\005\031\300f'\023\356\231\010_\242\204\004\251\351\313\024\314\266\344)\022\177\321\025`\251g\000=:\225\036\250\215\220\377\232\304i\037\212\354\001\314B)\240C<\351.\2733\007\375D\342;\246P\315\230\022\341=\204\375N\246\334\257A\332\342)\233\235\004\207\242\231\266\354\314e,\344\020\350F\357\247\225\311\276\354:\200\315=\316*:p\003\227\004\276\2217\341x\262.a>0\215\244]\007\020k\223)\222\370\006\220\224\230\241\275\207m\254\244\nwX\003\036\316!' \335\360\271\223\311\266\033P\201K\253\370\0211R\244E\017\236\337\210\335>L\262pdu\336\016v\016\261v\224\315g\234`g.%~\230#)\344\0033\312\354wm\363\345\200\207\257\373\251\3265\236,\313G\370\033E\215\rF\262\303\211\365y\317\2342A\331C\264r\r\201\025r\001'1\260k\250\377(S \02609\003\007{\037Q\304\235\230b\005:\301\036\014\nn=\343\235\003\221i\200\035Vxp\311.\2257tn\256\235\312\325\273`^.\261\353\3756>\264\376l\272/&\3354d\000A\024(@:9t\276\367\204\253\032\013\177\254\2659\017\341@\354/_\017E\001\000\327\244#!\361\210\343\010\010x\220!\230\217]\n\206\010\2209\316\361\224Kv9!\327\237\277\235f\324\267\032\322T\304mx\231\245\275\217\256x\007.)1\306\271f\304\202E\036\331\345\301\004T\030D\321+\356l6q?\200\353\321\223\310XY \003\204\013y\033\366\265~\233\362\366;\367\336\213\362ET\222\236q\000\345\232\035Y\333\004E\020o\255\353\005\345\362\242\260\225Bx^\003'\300\256\330\313\355\215^\313\016aa!\272\235\0357\350\343\377:\346/\376\353\306g\323Im\302\224\201\000\255V\234u\320\223I\233U\001O\330\346I\341\271\266\265\326\331\322\327\017&.\250n/\256\321\241\006\266\247\227\223\246\265\320\376^\207\2104\340\227e\202\236-T\305\250\356\177\331\254\007\222\214\216\2130\360\374\022\336#\345\020Z\246;\004\244\025_G\333\316\374UY]RG\312vp\253\242\320\200\247\017z06o\272\231H\204\250}\20024`\222U\0234\032\216I\033\346o>AU\3176\310\221\206\210\204.\2278v\217\207\207\301R\310\202\225\320\371\354\222\031\312w^A\235\347r\306d\001\3468\1774,\310\321\210\217^\250\0005\013\353\301\272\354e\344@\244\236(H]\330\010pm@,1&\323~P\221[h)\201V\203'\342s\345\254\236p*0 \276[\t[U\3754\206\213\n\343D\264A\031r\356\016\thF\331\315\223\305\320\344\257\266\254\206\237\220K\006\224\217\262\007\352\016:]+\002A\374\201\362\361\277\240\346dZ\342\216R\264/{r\2007l1\317\030\330'U<\010n\213\314\177k$\203\240\321WF\356ew\327\261q\244\233\213Y\252N \027)\371S\215Uc\362U\356\373\311Lf\240\213\3767\004\367\237/\356HF(j*\213\"I\204\320\367\373\254\026\254\266\353\222qx\242\037\357`\n\307w\004q\341\364\244 \303E\020\267\001!\302 \220nB\275&\214=\335\275\246iE\353\201F\367+\265\007\303\2116\014\327\240\203\347\205V\020Q\272\010\217=\251\341\221i\021\210$N\272:\212\344\253\260:}\343,*\025\307]+TO\312\357\037\244\277OZ\227y\362\031~\325\251\337s7\271bf\336\375\315 \356\350%\034zR\232\272*\357\307\260~\334^\247\331\365\361\022\323\261\373\236\347\366\230\317\307\214L$~\343\020\t\357[x5^\234f|W/\261O]\345\036\3240\"\200\353b\335f\372MN\342\267e\377u\023\367\262\027f/\274\246\311\214\230\314k\266\352\220\302\016\263A\201\244\036N\207#\337\007\010B\270\304!\335\332\244\004!\304\224vD\356\222\0143\214\341\363""\343\323\254\004\032\346v8\305w\354.\366\001\256\354\257/\225\027\200\310\370\342\260\345\033\224\003\372\321\246*P}\0051\357\2117k\020\325\317v}\320'\"\014\320X+\032\026\367\277B\331\240\246\316@\355\361\223\242s\0148\031\342_\322\216\322~I4\222&\216\014\360\004z\373\020\324\2060\207;\315\221s\327\325>u\001\3636\215\252\004\254\325\031WaV\366q\016\325J\300\207al\261\201}4\2704\234(c\310A\272pI\247\206\221\272\\*\372+\226\240K\373\265\035r\323\013:i\343C\206\256l\014_\\{s\310S\262\200\244Ab&\275\370\301K\036\026(\330\362n\r\002\262B\201MF\021\203L:a!o_-\211\020\210\021nbq\324\314\263\017\342\020\334|\362Pb6U#GD\267V\037\352\332\276Eu1\372\326\256@\007\177\252h{\310\022\334\273\210\204\"\022\020\212\177\271\365\2763\020\243\014\016\335\301\021\342\376Y\001\230\305\334{\201\365\220\344l\026\202\324\240l\246R\315|\2161\353\367\227.\241K\344\255\267Wf\351g.y\274F\227\213\035]e\"\014\2665\325\217[\203\256T\"\\x\260x;\342\370\311\330v\226\327c\225r\315U`\021\231\265\267\224\022\032VDfP\212e\r\276\355\344\310\261\021\203\r\326\246\233\276\204\350\220\224[M\220 \027\310\274\027\300D\245\3107\231\347\2768&\213\022\320\225\240\303\010\210L\217\246\231\023D\3376\252AS\234\254W\373\273~V\2171\320\270\321\037q\021\232p2V\201\177,\363\3465\361\260%\202s\032X\314IY\n|\016\352\327X\017\211i\200\245\035`\036\211\025#%v\336\357\035\350\302\2744\266N\250@&M\":F\345\272_\030\366\340u\235\376[\240%I-K:\256\010I\003\024\335A\253'\2708\313\000\204\356\274d\177\276\246\332\027ARC\370\306$a\317\027\373\276\331\354\220\355\252\211}\216\251@\365\277\312h\362\302\307\353\226aKzC\346\007\326\300\315\260\307R\362sT\032Q*\355,Q\2728\t\322n1\013L\361LW\242\201\325\261\004w\302\305|(\311\315\030`\016hs\320\374E\264\006\235y\324:\010\313\2352\342s\027x\304\371\322'\233\r|2\373\017p\020\333\361B\320\372/.xp\373\355\312\313f\202\304q\353,\212j/t\356\237\300HE\267\366\326V\254 \005*T\200\217!\0055T\r\301\371\031\334\023\025\223@\220\207\021\243\326\235\034\0165t\207\344[?\374\3470\212M9a[\220\254\231""\326\034l\265y3\226J\264o\317\t\031\034L\260\254\033\016\021\226\273\006\307\217\001\213rG\251\361\003\253'\275\226\315\353<\237\273\246\017\343\013\226\313Y\365}\016\3154\271\260\244\371M1\307f\\\251\014\345*\266]\025\200\000\377\020,V\345'\375\212\023\271\336/j\326X\246y\371; \002\344\362aH\nCX\302\006\212\361\353\005B\224U\0304\003\027a)e(`\023\351 r\235\241+\013\331s\254\372F\216\276\317\260++d\216\\\347C\032\020:1T/O\320\232\007\326\312\200(\347q\373Os*:t\207\203p\236W\315\010\235C\310\325BE\360\324/\3178\346\177\002Z\344\333<\226\236\265|h\257\017-\307\257\327]\363\235\264\265~n\"\334\311<\n\231\0160{g\204\314\216#\240\243\326\235a\235<\017\003\000\320k\352}.\253*\253\334\214\305\237\315\n\005b\262 \335J\210\275)\362k\223d\234\314\207u\235Xi\207\245\345`\337\3468\025\000\276\356\247\377\336U\260+h\\\363\241\250\342\225^\302\204\031\2519\035S\301\347\331G\322\"\341\224pHT\212\235\267VV\361\220\276\"1\210()\272s\022\3743\375\306\325\316D\037v\2415\305\345\241\333\223`\344\000$q\023~\300W\177\367\266\232\264aD\237?N\030/M\037\031S\022\2462\220\221\205\322\231Oq1\\G\010e\247\006\025:\266\030\240\371en\374e\336\n\323\245\330\361`\315\356wWE9J,.\264P:M\243{9\214\262\r\371'\031\030\345\035q\303\360\260\253\310G\306Ula\270\376\374\217Q\365\230\334i\320\033p>y\260\003\000\002\354\300\251\275\226q\250\245\235\213\331(\371\362\233\013m\262+\363\035\217x\032\215=\353\034,`W\000\300+\263\022_\3658\002\322\001g3\001\242\367\026\3736\255\217\222:].9\344\263\347\323\245\307\370\320#Z\377i\244.\205}QYQY\212\002\346@\226\331\216\202\211\214bf*\311\004\313\310\347\205m\034\313\206P\251\230z\371\302\301\307\006\252f\004\233\222`r\310\334_\331\263\365\262\242\204\0033\220\256\021\353\341\245\314>\314A\177\325ev\201\257\326o\335\272\236\\\236\007\t\031\0279\306W\334\321E\302\300\027\370\365\264\rc\243e\310Uyw\355;q\241\322\027'i\2671E\016SN\332\314\362\224\035\250\323\241\247\311\212G\341\010_\324\371\210\306\212\256\331,\341\201=\004\333dPr\302\366\354\262%\372*o\342\340Uu\336\300\240Gm\330Lal\373\320\261\027\202\036:\243=\031\021J\351\300\256\017\276I\r\360*\202X\022Y\326ZIX*<\327\300\201w\022\246\211\324[\032-~]Vh\200\232r\316\375\017\034D\366 - \020-\301=\010\234W\375J\303D\305\004\304m\213%:\347\336\347H\211X\222\317O\010\361}T'\364\331\276\330\240\350\017Tv\374N\345\346\247\254\356Y\230N\023\234\"\212C.\216\270\356\213\314\216\2026\356\230\031t\212\235\031\2734\206\r\251%B\203\302\251\225q\033\3723\024\362\303K\034\202\036\371>\254\257o\2219\013\244U|u\256b\376\0161\034B\202\020\353\262\345\255\241q\214\235\2116#,\016U\305\324\262\374\374\365\334\211\014\272rM\031\205\270K\302\"\234V\320\307\371z\036)\301\242a\264D\272\263\205`\323\371\317S\001""\0301Zj=^\210q\201I\200(\343\010\214\273\217\246Z\367\327m\250\004\320\255\023H\251u\350\255\270J\2334D\357Kh`5_\006}I7\272\331\334W\t\275\n\333v;0\006\251\017\034\220qc\022\230\263\225\275\257\000\037]\222A\\E\271\260\246\324\227\030\260U\367D\200\366\234\357\227\025|Md\200b\340+\357hx\260\244\362\016\355\0045K\250\200\036i\224g\363\203A\327(\310I\334d\010\001G\303\301\250,R\365\302\004\024@N\3123\252;\022\241\334\204\310u\231\034%t1|\225\217#\247z7\206\373Z\334\010\2348\200\365\213\305\322\035\304\202&\376\215\006Tc\37797Q1\300\033]\302\244?w\022{z\202\271\260I\200\202\211\020\177\302\343\235[\267@\327b .\004\236Z@{b\205\372\0167\234\352\301\343z\344\236\342\364\263\022\254\343\027\034\036\020?>\023\001%8'\311i\345\200\021\376\202\357H@\244\\\227\357\3347}\037ex\244p\367\363\310\361S\251Kx;\317\240-\026R\026\255h\244l\23774\033Fu\"\366d\001\034Z\257\370}\365P\231N\221fIB\327P\234\376\335\356v\023K\3542\360\030\340\n\355;\265\342m/\305\373\031\315m\3113\203u\004\300I\365\n\343da3\355&\326\020\365+\021\027:}v\373Q:\033nUK\327\300~H\344\027@\032:\341!\016,\272\316\t\306h\250\244\265\314v)\366\245-\212^Fm\347\2153;\227`\n:\314\2460r\210\226\321\326\237\326\200\265\364\204\306\304\210\364\346\006\232,\333\336\332\306\007\250\340\002OB\325\277\201\274\005\235/d}\352\031\267\210\014\305\233\210\250\361\365gs\016\342\006\024]\001@\352\260&\202\341\304\202%\026\344\024\304&\025\022\340\304\034\332\217\004\2709\241P*l\370\331\375\275H^K Q\360M\025\3026\235m>\002\344\236\201\277\276~\367\213A\354\272\345\242\341\2341)\325\331^\327C\022\225\332p\302\"\034\022\374\037\240\276\311\221\252|\\SL\206Q\245\337@\332\034x\006\030\323\033)\302mbO7\030\023E\301xQTW1\2621\337dV\362E\224\311o$\235:1\\\253\261\206W\346oR\031\013KN\000\025\230\001\301\324\366\367\223\373\213%\220\320\311\177F\215\315\037\315\275\312:u\311\232#\222\237\301\0131\242\260\211\260W\007\340\210\031\351\317\016/\250\362\365k\020U\022z\006\023R^\253\253\220\374\245\360\313G\026\373dE>\337\237\347\\\004\223c\007""\246f\272<)~\031t@\271I\020C\375\263\2360,\240~\334\372\0204r\353\234d\224\016\242\307\3074r\261\276)\343\253\324+s,\305\270\221d\315\375\307\325\241\023\\~\004\317\202\347\2562\343\343\261\010\243\262[\322\224\356\277\357\354\206\022x\034\236\246\210\222\004\035@;\263^\274\346\252\313\014\236q\253\355\320` \257#\241\346\007\242\330\031\035E9T\t\004\224\241\"\2520\232\3254L\220\353\357~(\324\302H\017\257\021E\301[\356y0\021Lf\255\021\223#\274L\311j\272_]#\370lQ\266(\252\026l\321\007\334L\376\372\026\"\231\035v\205\372Gv\013K01.\002\362$?\314i\213muS\260\333N\203\244\304~\277\230\313\201KWf\337\201\365\250\210\312\371\240\341\236^\217\023Y$h\365l\307\235_\231!\257O\027>\365\030 \027?\307\302|\000\363\247\323g\214\363b\331@Y\363\257\215gF\"\201\201\0057\t\233\353\300B4\271\t\303\252\027\345\264\333\257\330\201\251/f\366+\370g\000\334nX\304\336\230\313o\360\226\227e\001\346\270\003\366\006\030\001G\031\305\245\202\206\371\3631{\027~H\260P'+\3454hk\355\267\321\016U\227_aF\367~\247\367\321\026+9Q\244\361\323\005\361\315\212\032\211\267\366\3706\2171\351\266\324\337\376a=\305\003A\356u\024\035'!\002\255q\033\014B\216Y\001\226\202\030;\232\375\0029/;@\364\331E\303.\367\225.\350%`6k\216\252\365\230B\363\010\023=%\".\220{\001\000\242\200Q\233n\340\010\307\006\270\177\257\"=\276\307\330\367\330\237J\024\350\372\304\r\206\2122\331\020\204\376\376\246Zw*0\315\346&<\333S\302\356\356\252\213M\336\003\326\037"; PyObject *data = __Pyx_DecompressString(cstring, 8146, 3); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (8462 bytes) */ const char* const cstring = "BZh91AY&SY\257\316K0\000\007\232\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\300@@@@@@@@@@@@\000@\000\340$_y\357{\355\351}>\316\276\355\306V\315;\2459\033\266\331\365\350\007G\240\\9\245\241\242\233s\272\037\026\2637\263\255\035I:r\350\364\367\267F\276\216\236T\366\257\273%%I\024;\256\034\025-\000\367\236\234S\335\202\266\366]\353\316\355\207\320\tW\000\tB\020\223510\004bdh\3114jl\001\240\232\206\023\324\321\246d\2150\214\247\242d\315L\230jc)\247\242zjzC\322\tB\000&EOL\247\240\250\365?T\375S\320\207\242hh\365\001\220\014\201\246\201\211\247\251\210\032\000\00044\323M4zF\200\224\320M!\004\230D\032\032\214'\250\006\206A\3524`\236\246\2004\364\324\3204\320\001\240\000\r\001\243@4\t5\"\020\023)\352d\364\204\3013T3PzC\365C4\321\351@h\320\365\032\007\250\000\0004\001\240h\000\332\232\000\311&\252y4\312{I\350\246\324\3315\0324\r\244\364\023\021\2625\033G\252\017\nh\014@\303jCF\206\t\201=M\036F\201<\223\t\021\010\002\032&\200A\251\240\322\237\250\323\321#G\2426\247\251\265\033S\010\323j\032=L@\001\240\r\000\r\000\001\347=\020\217\375@\204\370f\262#^\211\024p\344\355A\260w\036\253\020\026\312\020E>\340DA`\375z(B(0A\217\356Z\223\324,J/\030\264@D\004\223\371\177\032\376\347\370_\022z\301\342\236\276\022\336\264h0a\360K\220\323)\217\367\202*\2261wa\375\177\217k\320>\261\367\377\031\351\376\177\351\307\221\271\n\324\251Z\224\255\255~\357\231\366[\315\363}\017\303\371o\370\375\037G\324\376\276\257\372\3475\327\031\316t\316q\234g9\324\366\020=J\200\242\237\267\321\203\352\267\366[\271ry3\323\226_/\350\215\223,\262\316\226YIIrp\2057\321\337j>\375R\273\337\376Z\360rV\213h\"\201\024^\212\360l\232i\246\2404\325\223P\240\302\230\t\256\313?\275\321O\323\327\247__\247\247\375\362\366\361\214`\323\032c\030\306\230\316\377\013\324\367\274\2768\033\372\217\016R\224\247\304N\377\277U\030\250\260Eb\301a#\030\304Q\210\252F)\360\247\333\365w\355\344m\337\032\316s\234\351\332\020\217\274\227\253\376?\317\257Jv\371S\2255\371\346\227\275\357{\336\372p<\276\216\317f\265""\357\274nSy\277\302C\205kZ\326\266\360xx\236\337)\312\010jg'D\347=\307`:\352\301\022D` \202\013\020\210\221\177\354\021Q\214l\030\376\300fh\232H\320\371\236\022%\377\336\010\300\032\275vm\264\375`\330rM\032\364m\031\266\005\314\204X1Up4\354\270\031\362\t\231\031\031\005`\213\232\226\232)\210h\317\t\324I\364f0\330Lr\232x\366\023\362jo\3308\321\206\3425\261\223/8;\\\321\232\023\344\230\021\014|\222eQ\273\0234\212m\256\332j\236\315*o\335?\244\206\264c,\321\314\311nZb\201ry6&\306\261\026A\206I\267\266(\304\220\030\276\316+\003\037\265\201r\312\357\217\235\004\010\244M\357&@\331#0\320\363\370D\262!5\t\243\223j\r38\261rc\343j\351\372\246\224a\206\305\202\325\252\307Ae\220\370\322\311\234\030@,s\207>\024_4\231\223\0351\262\034@\230\337~\225\374\356SMF8\306\356\372\231i\314$\322\202\313\353\347v+\264\260\306\251\t&\355\307\250\275^\241\306\346\r\247\344o\354mK8\346\303\364\275b\261\276\271\310\220`\232\376\036\027,]\370\340\023\203\243\231\317\206)K\275\302\177t\3731\357>\253S\323\245\242y~\267\023u\374\365\370\264itu\372\332\275\216ASk-\016A\331Z\274\237\330\363\n-\225R|\327\274\367L\264\361\354`1i\316\027\211\030\314\215o&i]\310\316\326\033\235\345Z\016\315\254\020|\313\245R`r\267\262\224\244\377\036\331\215&\326p\177mt\262Bk\301\334z\037\255oNL\332\346n\206\234sO\037Zh\215\323\034\357&\213\232\243\177L\242\013\\\251\215\355\023\313*\3447H\351\032/\226\215\352w\301\243A\205m\315\021\254\313\227\203688\300\275g6\307sO\230\367\\\240D\344\203\346\346\035V\334\303\223\034\223\325\362\334c\252\033\335-\277\010\267\324\213\017\225\365\034\337E\375\002\334\2554x\031\230\221\301\3450\344\026u.*\346gI\346\3537o\332.\252\331tu\237{\341\313F$\036H\337:J\2171\263\207\030g\013\316\334\261\0329\\k8A\360B\322\215_6Y\276\220a\250\"\007\027)\311\016/\334\342r\031\245T\271\217A.>+\345_^\301\215E~\214%\014\016*KcX\216\371\362Vk<3\034\351\032\27592?\240,N\3507\243\241\r\312\270!\254Y\\r\321\222+\2434_ag\356i\231N:\270\205\026\244Y\315\276\016\2278\343\244_I\373F\220\026\274tg\022c\254\375""\336\004\364\315\035\265*\316\352T\214\001\340\346\034\241\r\276~\270n\r\241\327\0216vTU^\003{\200I\223\024S\204Pe\215\017\212D:\216\216`4\346d\234!\324\245}\366\356&\\R\357?\036\007\207pp\346\321\363K\370r6!\276\350\210\003\270\250!?}\016\177\031JI\t\250\263\224Y\235\t\202W\351\377HJ\211\016\214\226u3\363\355g\332\264\347P+\241\n\323\034y\252\224\372/\373/\324\242\205\362\371)VD\246\n\2074\024I\326\261\302\253\217\367\363\007\376\013\234\307D%\217_\335`\371xw\345\274\014\231\243GP_\364\2367\364\321\210\224'\350)9'_\310\236\231\326\377M\016>\352\314\006\347\325uv\\\341\\:\356\246\371y>t\276k(\257\256\224\361T\316\355n\236\325\255\317o\245D\337\027C@\347\004\266m\366\2633\366\215(+\377ru\316\t.\335i\361U7\302\362|\215\243\034\233Ec\021\214`\216\340\010\035\n\023J\244\234\241T\264\004\3147RG\022<\227y\304\017\034Z\337d=\021\231h,r\304\371\334\352\363\0325b7\000\345\034\3478Lu\372\367|R\027:\301\322u\031\244\252J\"\232\333\276l\277t\317\325\035\347\022\227\261\200\330\202]\271\224\314\314\314\314\314\314\314\314\314\314\314\315\350\315\235\005\226r\351f\347\355\300SR\246\366\363\0108\272=3[{\241\024\020\261\007L\222\n\347\214\346TW;\266D\016\352\343N\177\021\313W\365\204\037\3507\306\000\377_j=\005\324\236\236u\255[\337\266\365\356\341\236\352w\025)\252\234+Z\374N\236\357%SQ;\266\351c\241\370V\204\025p\001\201\016T\317\315\363\322\032\255y\352\252\252\225U\0203\324Ih\177\026G\023\222\277\246v\221wk\001i+d%\232S\334\246b#\244\323\267+`\266\360\024\343\000\261\223\2601\r\276\337\237\247\331\210\217o\310/\262c\032+\2156\201\315\217h`\347\017_9\3133333w\246\332\251\326\241\327\254\323N\367\242\3379\232\r\337\350\021\276\261\034U\305p\341\221\205\247\222d\363\361\034\351&\2224\311\003\004GC\205H\325\014\230\254\3240\007\275\351\343\324\251_\231\235l\226\3576:\306U\022\211Fr\025\266\027U#\215\364\233\2171R\277[\364\201\022\262\326\224\322\252a\245NX\030\311\016\244\377\211\323\331\364\022\207\326V\006\216\302\207\303>\227*\303\267o\035\366\031\263\022\034~\272\255\315\214""\324\0304\007\241\017o\375\"\030\224\025PE\"\"a\206\210\326\007V(\301\t\310UF3\017r\255\203\275\365y}\000\371\335/?\263\333G\237\343x\013\300\257\026\035'm`\361\240\320v\273*\221\2726\310\310\330\271\022\367>\002\227\241{\313\367\322\305SO\006J7\343\017\363\362&$L1\0224[\326\235\245\231j\277\252ynb \311\032\360\202Lh\2560\374\265\034\2631\262]%\214r\302f\0244Q0\342\315\267v\332\007\265\235\221_\310\331\215\226\253\033`\242e\025k1q\355\230W\226\252UJ\241\307\313V\252\356\257\341\212~z\215\255\263\315x\320[+\021wvB\322-\270$\216\223\366\206C\322\004\326$\333h\2146\027\016c-\266l\021;h\313L\263cG\210\301\235\2471\215\rL/\212t\344\234M\325\315\347\257\r\033\222\226W\305J\203R\236\006\023\235\266_\275YFZ\210S\213+\016P\031\361\314\020\276\233\372:\0047\235M\311N\364F\305X\245\305\027\254\313^\351K\240\340\255\237_z+\313\315\251\247@U2\020\231!\031\217\211\261\252\335\364fM\304\3122Y\270\261h\r\241Ed\240T\226X\034\304\244\302d\223\\\364\037\312\237\003\335Y\022\275\342\363\326\206\355\332zZGt\211:\"g\352\321\347g\244\234D@\325DW5\014T\016h\276\316\t\372FO;K\2479U\t\357\222\213L\271\211\325)\307\214Jz\267t\202\231\236-\345\305Bu\013e\272w\021\323\351\203\004T\343\231\235T\177d\263\034\262\361\363kL/\007\214\333\206\304H m=\210\353\035\222h;\276?J\266Q@\333\271\256\250\267LN\031\036\032\301\rh\236\365U\026\0246|5\272\245\234T\245\231K\251\236o\376;{R\363\374\263\302|\247\223\351\361\"\314\212\375HdX\352ffb\255`\331)\363\346\346\"M\276\355G{]\033\344P\212-N\345J\246\\\340\245\"{\001\300\r\325\227\\\205z\361H\335\332H\2043^\2102 \326L\026\250Y\341\211\325\254M\247P\241\025\375j\357\026\314\315RG\346\300\202A\222;\017J\215\251|\261C\010\225\253!\272\232f\201gJ\217@\321)\025iZ\265\227$\n\364\252\320\266S\244R\312\321^d\3628\307\364\241o*jE6i&m\332/~\325\232\270\022\314d\334\264\223qw\026\253\322s\247+\326\235\355\275\r\324\341&5BL\215\303\223\314u\321`Q\026\213\222\322\016\221h\273|\375S(Z\002x\204\334\273\031\237\231\230\256\"E\021\352+\334Cf.,8\264\235[z\230n\231\234\317\352k""\320{x\222\276v\350F\377H\227\264\307\241DQQ\375\312\021R\017\001(\360\325\371J\274\317w\221bz\264\361/\217\261\272\257\252\343\243\352\226=\355\2708S\224I\227\214\354\007>\325\231\002<\330\23565\314\274\023D\302\341\364b\n\322\333c.\351\330\333\226\254\364S1Y\3454#M]}\276\017\316$,yirm\277\265\253\300\251<;\244G=((ww\\8\0324\034\037\245zAq(\030\300\213.1\305a\023\356g\256\352\357\203\351\326\360%\243L\372+Xy\236\261kC\177\313Yh\263\233\315\372r1\320qK,\363\227\360\323\207\016\032\233\26758=\363\341\302[\232f\027\020\316\362\326\206\3627YI\344\315\216\307\327v\245p\307\244i\203\270\245\327\004\355E\3236u\016W\331\344\363\267:\220\266\353\332\252o\267 \372\030r\276\245\325`\271\314\305\306\005\037\347K&\312T\242I\344\337\001B'\013\214\334_bC-G+%\036\013\214b\264\r\232{\353\025?d\360v\3310\336\255\361\274n 5N\270\303c\221+\234\234\t \224\2101\345\266\343=\305\271:r\300\371\316\202L\027F\321\216V\\N\215\3712S\224\372\\\267\037\024\027\232\241]\225\014N\023\2416n\325\205j1\027r\271T1\276-\2617\274\342k\266+\274{ew\033\214\203_\232|\257y\375{\375D\306\037\024\021\334s|\227ED\263\035w@\035<$%%\277{\211\247T\337\201\351\267]B\307\264\355=\302w\334\262&\2742:\236\005\240\212\227\243eU\375\315S\rL\244\226wO\224G\0266S\0369\306{\237\322\203\222\n\351\030\226\371 N\004\211\232\002\272w\311\033\221C\276\352\332\352\250\215R\300\357Z\243\3164\225\023\335\232D\256\303rz\001\326\321(\307\205\316\310\034\334I\364\240M\240\316K\304\276n\010\2526\301,<\320\345\266\362\230\237\215N\0246(Sxx\264\262j\000\343\003\223\247Z\206\361\2407e:\220T\007Y\006\017!D\232\231+\241\310\371\334\261\210\211\202\343\034\274\304\024Q\272Y\261\313U\344G\300 \030b\324\262\355ui\215\0149\306{\373t\202\177/\307\323w\223\326E\307\356\n\270\351\276\2441\310\2448\207\340\002`\2679\337=\335i-\232\025\203\235\207\034\231\267\220b\233\221\360\253,\306\037. \302\007l\271\n\026\031\234\303\233g\021\332\230$\274\014\350\332\316\\`\263G\234\303cT\232Y\023\026\232a\0044}~6\344n\233\217d\025\025\234\256\030\007\275""\353\310\370r\260\321\215\010f\364W\255kLY\367\354P\26043\020j\211y\257l\332\232e\353D9\214\222\312dN`\\\220R;R\021i\030\307\201\347wxM\330\230\363#\325\017\234&\271\360\340\304\027\014\032w\336k$\034\372(\332\261\226\231Lq'\222:\356\354S\354\314\215\216\377X\302G[\231\212\004\020#\364>\031@\270\rm\0348hv\366A\246\374,\232;\264Q\274\273u\305tC\207\310\306\016\247\014\264\023\367\";i\023\367\371\323\205/\315$\353\227\320\337;\331\207\024Y\360v\005\021\3035\224\33646\"QX\252\232n\353\013\0244\326\317/=\"\310\201\374\032\221\235L~gi\312\271\336\231\214\227\330\246\376\021\220\3328Q::\005\345^\3036\317+\240W;vlw\271\357\221\203\324\335}\002\233x\266\333M_:\252\252\210\250\252\252\242*\252\252\252\252\"\242*\253\024UUUq\014\026C\004\325\303B\311\321M\214\313>zULn \\\022\022\337\310\266{\364\223:\2364Id\212X\303*\340\333\260:\245\202f&\010x\305?\242C\001\202x^/[\302\333\273\362<\177K\302\364\274\257\027\307\270\253\177\217Q#Tn\317z\335\345\351\264\263\224\001\325\337\002\362\t\222\233bI\370\324\002\200SH\032\223@\217-\250\264\223\331\364K\020<\243\334\223\223\276\367\363@\317\252\210\211\024\354\325A\022\201\225\262\025twQ.\227n\242\307\376X\334p/\024\207\034t\351\251\002L3\345\340!\271\323S\022L\312g\211\227\205\nN\273T\313\363\206\2072:\230\314\026\353\210s?\205\273\\\222\333NIO\253\225h\215A\000\330 *\364\341\215\310\001\214\016\377RI.\276h#\360\260\353_\023\037\244\302\212\206\025^\345\006)\213\374\031T\346\n\251B\364\307]\300\310e\033\316\022\2119\322\331\300\216(+d\t'%\231\246\237\003\204;NTMC\304<\003]4L\271\335\247\323\267\325\352\355\331C7PL\002$\202\252 \2119\347\030\234\\=\276,\027\016\261ka\303\236\255\231\363\260\251%=\223=\320=w\232\265\300\346#|\235\0030S\232>\3541\020\027\245\033_\232\253\222\tDRb\242\252V\356%L\020\010\202\350\226(\361\005-r\262\332]cLgD\244\323s\322\336aA\213\323}\232a$\300\311\014\222\334\264\273\313E\273\275\\\301o6)\270$u\250\230\035\264\313\202\267di\221\t$\222I$\260P\236q\230R\3633\013\022\020\032S\261\220v\335\205\007]\024aM\331""\321IeqD*\026n\251\342\217rcB\360\264&\305\000c\313\311\303\034\n\322\201\230H,C\313\221\305\235\226\034`jR\036\370\322/eh\007\323\001\336\201p\020\263m\332\274\007_I\343If\2722\216\306.\327\301\244S\241\356\220\247F\371\334`G8\205A\337\204o\230.\254\304\326\022&\t\207\245\307j\201K\305\017=+y$\210\322$\033\227r,J\265\337\255\353\242~i\035\215\215\0340\232\023|4\033g\\E\242\245\341\007$\355\326\227\353g\204%5\366\344#J\264\204j\256\274\014\2362h\216\250\221\220H\020\230\320\2304\301\276\330\272\253\014-V\256\350\245;xb`\321\216\200#\324\335\275\223\253\331,P\350\321\252\211\260\334\007\032p\246\306Jv\244\2564\251\006\351D\337\007\027\231\300\224(\221\027\275\363\313Z\364Y\007-\020\214x\305\034Z/Fa\3329\027\202\335e\206S\001!F7\017\2647\252\2226f\212\311\204\320z\240\376|\2609\001\241\277}\335h\t\025T^\342s[\nR,\253\214\266\315\nkz\032\346\322\326a$\031\320\263JFA\363\342oX\024Y\326\255i\336\"n`F\350AG\020\274\305%\312\337JOTA\317=\341GL\340\367\353c^W\337J\341\225\031\206\226\034\273\336H\303\270C\221\212\006+=\315\207\005\t\235\204\2049\020\r\244\330\031\227\270\207&\204\256\272B\263d_c\253\030\243H\340\223i\266\244\302\013\305\246\035\332\3351\226\226\311\315\213\016k\315\263\232g\016\353\274u]\266\256\350\021C\030!q\276\023\020\332ha\222G\211\220\320\352Gy;\004\373\306\331\241\2170\022UC\2636\302\002\016{\250t\311\341vX\222\333\204e\036\361.+9l\204\350\367\030\263\276=\313U\001eE\001\376\023\255];x]Z\030\353\003\322\332\036\203$\251Z}\367\276a\317$\227p\327\200\307r\033\032c\024\0048\001\244\2418*gT7\262km\226Yy\267\241-E8\261d\314\324@\3055\354&\350uQgRA\325Qm]:\234\361`B\n\253u\202\271\350\341v\256#zh\263p\345v\301CO\210!\315\215\356\r\201n\266f2\\\\]_,\202O\024\242)D\345\177 \371Vs\333JkL\001_`\277\323\240RPT\024\010&\267\334\305\265J0#~6\272\307\310\270\200\006\276\233\024$\032\362\261b\201\014>\223@\255!\n\033x\365\221;\347\342\177o\243 \3706\301\373py\227T\031\317&\332\366\250\211Hr\320\275\233\247%\316\314\360\366\317P\243\262\017cy{2\366\"\"\036\246=\257""\031v\241\004RjMg\251P/+\315\266\037\024C\241b8v\206\350b~Ve\353d2\243\361oKk\267%y\270\010_Y\241\211\211\023\036Sc\343 \220\036\272\210\370\222\214B\017`L\023\003w\255\3437~\335\207<\262DbU\377F\023\316\262`\277T\276I'\324\257}\021\035\036s,z<\245_s_,w\276\361\262\017\315\310\345\036\273\364\337K\242oX&\200v\266E\232\222N\267j\255\330\223\244\034\217&\024E\341\311^\220\224y\313 A\223@z[\022`\323\023L\022'\271`|9 7gW\212\361\006\266\354\3567P>U\035\032\246:\210Q\027=B\362\212\275\335v\234\t!\272\024\302s\243!*\000\262i\242^T).V\351R\366\237\034\2209\263R\212\262\245\267p\310bi\246\034\n\n\254`\232V\326\253\315qV\n\321\t\220\207\006f\001w/q5\302\233\264K\"\233tf\225C\244\033\033FM@\2205\007\241\245\213R7P\362\2611\256\247\014*\370#\214p\241\014\255\312\203B\241\306\272\006\302IZCt%\200\035\357)l\370h\347\241\010\244\213#\026;\357\"\006\022\350\002\007C\3279\352\213\315\367n\332L0'\255\216\220\210\261\022\272$7\242\345\222JV\313\277\360|\221\371\235\271\036\251\260\007\310\247\212\225F\367\306\273\0334U\010d'\276\256\3344m\366J9zz\271y\367>\261$g\343\020\241\033\337s\330\007\260D\310\227\342\234\320\214\344\371\021\313C>\333b\030Ss \306\275\345nH\301\003\032\215\026\222\304\207B\364\210*#.\224\217\246I\332\352\362\275\327\273\243\261\276\265\315\373+\006\372\326\2564\335\326&\024\224)n\236\323\242;\255\224\302\227`\322H\2448LgD\343Y\2568T\227\004\2608\230\366\244\244\365\274\250\253\212$\246\306h\332\026\233\257\241X\206U\"HV&\331E\220R\026\031\350W\263\262Je\265\322P\322d%\261\352\362=\332\350V<\014\356\367\032\324\300\331\207\026C\020\022\314\t$d\300\324w\355\032\214\240\325\256W\362\374\254\344hA~\006\334\250\217\237\236\262.XXo\002\234%\363\210\345\312U,\341\007c\267D\006e\334\026\\q\351\241\014\367\310\315\362\303\312\030\357*\006\317?\247S\233K\250\026\214.\337v\006\003\365\340\3277\211pu\303\2656\367R|r\273(\311J\213\211#\305\354A\305\265x\341(\nA%\231F\315\204j8\244\024\026Q\030\301\301\336\025\257]\212\010\323\036\310F$\264\020\035nF\273\351%\263\030g\243R\247t\325re:\014\025f\230\275w\376E+\365\324\0179\225r\204\0076\240\235\2066\253M\347\027\243T\007\370\010 '\347\240lo\027\270'JII\t\361\262\220|\031\001\007\211nW\004H\347B\014X\364\272\231r\320aL\020\232\350~\230\372_I\362\370\327L2\024&\273\204\241\231\363b\311\2453\273\346\334\225\241\263\346\225:\357\235\255\t\025E\027IT\215\315\025\215\263\265j\315F\254)d5V\222\372\205\251|\254\333\354w5 \"\354\3010\230\325\344\210\210D\022\311\263\340\227\300\234;\275jAI\207\020!\004\330\270\0037\205\303za\270\364\362\226\252\326j\212\024\306\022)M\362/\252!\266\2204\206.\025\276U\356t\241HS/ZV\r\331W\276\227ey\203\304\200\253\023\221&\242\010m\244\r&\317J\244IJ\243F\207\231\tCM\242/\211\254\025rK\212D\342\312\264X\340\303\226N\217\312)\002\264lBD\222?e\223$\317T\332\262\025/\300c\341t\226\202\264,\273O\264\240\372\224:\333x\234p\214uY/\006P\2508\314\274b4\374\230_A\253\trQ\2130\335\232\301\002\310\247T\03560\232\240\256A5\031\364\243\302\256\302vT\205l\304\203\256\2477x\301\342\324&%\2661\r0\013\354\313hq\240\253\214d*,\203\250\240\241""\032\253X\202\\8\205`5\366&\266\310^=\001qB\303hHJ\353(\251\217\017\026\226Wf\252\272\215^\217\0256<-\245\342h\\R\234jm\221\216\327\0069<\010\006\325\337\305\221U\341\036\347\322\372\336O\207\343|n\336\254\370\267\223B\217\244i*Q\237\026\247\014\246\210]F\302(3\373[\207\251\001\002\347c\202\342\027\rc\334\321\315\353\334'\355\250\262\231\254\210\014\344DM\273\361\021\036\305N\3360\222\025\270z\373\034=AW\024\217\005\351\243ry\244\366\211\312\245\206\307\270\370\314\323x^\344i\025\313\010\2645\256\366\311'4\335\3430\312\357\030\030n\330\300D\rV\014\220?\251\362D\031\212t\200F\234v\017\021\335\356\350/*GS\204,e\227\266\207\203?\232\372=\002L\311<\003\243\347\0077\303\013\250\262a\351\324\201\2549t\236\313\262^\337)\364w\236G\215S\263U\241\343HYF,\026\"EATETR\271\273\314\3102\324\260-\215\034\277\227\354]\314<\010\316\357\371F\207)\027Q\356W\264\0261u\027o\373\250\304\325$\371\212\214\3751\274\364/R\347n\251\351\003zbfB\014(\376h\021W\327\233\3742\275\017\313\373\317BD\344\252S\364\262R\210\202\r4PK\315\346\342eTo\217\013'\274\367;\252\n\007\351\354m\265\217\265\031\005\035\3719\036\257p0\366d\377\207Q\241\006AFo\204\276\273\315 \037\"0\014\230\260\236\016O\364\350}\000\3076\360\251\351\274\272zH\233\252n\203\325pA\351\365j/\327\242\311\250\335PP\363\241\314Ve\031U\035\366\232\376DS\351\203|\303\303\327Q\354?""\353G\273\307\207\365\367:\0217,No\247\300l\243\260\352\303\020|\2602ek0d\326\302Nt\246\030\003\014\302ln\256z\302W\001E?\242\214\237\277}e__\315\007q\220\032/\200\374\003\324o\375\013\300\236\352\237\304\010(\034\013\217s\255\275\037\356\037tQ\017\332\363\257\241U8\005;\370\3217\335\312y\033r$\337\306*\343p\315\341n\030\235\001\225\372\037\017\213\310\357*\234(oo\216\003\211_\320\2310\036\261\233\335\215\255\247\036\036\034q\020Q\351\217\346q'\314\255\214t\247\303\330eo\237\312\363\361\342;\335\342-\336\347*\034\016\337r8f/jc\3607m\331I\333QS\200\217\270R\332\355\372?$\306\317<\356o\212\217{\177\271\216\237\254oo\306\341\333\373\206/\266\251\371\013\215{\316r;\010\233\"\247u\211\333[\035^\364\273ox\242\257k`G\367<'\362\332\014\032\272\273\000\350#\231;{G\277\244\232\372\356\330<+\263\371\235\235\264m\235\255\267!\331{\223\312\177\345\334\331\333\312m\245p\277/\253\221N\256\272\273h\203\330\025W\260~f\276\254\367\014k\253*\213\374\375d2\365N\262\267W1z\232\210s,\233]\376#DR\n.`\322r\204\207\227V\227\016G`\243\001\304\016v\243Q\362M\321\235=75(\262\254ydH\364\272\177B\250\313\002\234\205\214\305\250c\342\310A\231\345\241\363\232!\221\364\217\201p&\361um\374z\036\031'\251\376\340\312\211\020U\227\252\275\247\032}\217\352w7\032\305\206G\346\354k\256\201f\316u\343W\264\267\272U\216\214\r\376\307\307Q\023\002\242m\2364\005\001\2158\315\317\212\204\303\267\031\277\220:c\013\240%\t\313\001\3406\253zT_\277\025\004\241\256\343\210\362\025\362\323\221\026m\006w&\017\036\354~\371\031\013\212\224t\331\006{2\204\325s\334\350A\3204!\341\351\334\332r\240\361\035\3530\334\354\354;,I\017~D\0273\014\352t\222s\017q\222\307\227\302\314\271\003\270\356Y\2056b\346\"l<\314d\273\306\312\364v).\3415\227Z\276\203\346a&\207\306\022t\361\220\253#\307\274NP]\334\010\305z\375\nEe\002\0102\256~\222ty\252\364\314\007\277N\311J'h\324\242j':\342\313Xe\212\255\316\346\n\213yx.\240\225p\262\365D\335\0270\367\017X\236;\307\375'\301\361\271\272\177g\277\353\367Y.\346k/\331\3114\263\214\030\301X\301\2463""\017\032M]\342\025<\222\363Y\254\3049Zb,{\252\211\026s\214\3471UUUo\025\370\2477\347]\227\312sp\345\203\241\034\301\320\337>bo\247\233\234-\377\374]\311\024\341BB\2779,\300"; PyObject *data = __Pyx_DecompressString(cstring, 8462, 2); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (8340 bytes) */ const char* const cstring = "x\332\325[\313[\024\327\266\027\005\004\305#D\214&'9)\2149\250A\024\004%$&i\2415D\344M\214\361&\225\352\252\352\246\244\273\252\251\252\346!\341$C\206=\354a\017{\330C\206\0143d\330C\377\204\374\007\367\376\326\332\273\036\375\000s\276s\316\375\276\343G\327Z\265\367\332\257\265\327s\327\366\221e\033\223\212\271\2357u\3374\024M\361\314\215\202i\353\346\220\222q|ej\315\324\327\025\177\315TP\352\356(ZF\263l\317\347\222\274\346yh\222\265\360\356\244\025\315\315\024r\246\355{\303_L9\206\251+\216e<\334\335S\314\254\231S%\256;\256\t\370%(l\033#Z\216\275l\372\276eg\030\210\000DD61I\002\321m\333\314h\034\271!*\300jo\004s\274\211\360\204\305\324\240\000{H\361!\337&I\351\022\313\245\214\005Z\005#{7sZ\2268a\006\334\314\262\236g\271_\342W\316\3628j\036\374qP\321\322dX\0327:\244x\3706\212\206r\261\306\240R\372e[\354\013UG\246\333\326h\202\315\2565\364\275)\0300\315]G]\301\016\310\020!\245,\033VP\356\276\"\335:\367+\227/\"I\260\001\304qC\031\010\246\346#XO\025\202\020\021T2\"\210O\256\276\260!\252\014v\233\354{\244\r\244\010\\\035\353\"\255\221\306\253*\246^\320MUU\014\016my\3471\213M\013\273\242\252\272e[\276\212\350\261n9A7\366\3555'\347dL\333$\005c~sh\022\304\227v!\227\"\367\223n\332#\341\210\020\nq^A\016A\333\266r\205\\Ll\210\000-\353\345;\020kdm/\177T\221g\010\313\245\252r\033ZX\345\210j\022\216\210\344\355\344\032\203j\320\027\2027Rf5\347e\274I%m\271\310\340\202\010@\332\216k\323\327\232)\245-\225$\232\"\224\004\273\312B\236\317\250\024\260c\233\207\327<\337\241\0317xY\204\t\005;d\203\260\276\rF\200:\212\006\020\232\034\354|S\334\205\235\242\260_,\216[\330\302\026\257\271\216M\373\026d\022u\236\3163\263\351aU/`\2169J\346d$\033\232M\342\037\351\274\240C\3570\024\306q\204\202H\356\244\0320\272\271\233\200\202\014\262\226UI\017O&\244\360\375x2\344=\024\340\264\254K\025\322\351c\246\201\375Q9/m\3352\214p[U\302\351\251\272\277\335\262\256^0ZT\211Q\301LO?\211\n\301\307[iHl\n\036IdK*\336\352\2265>\202\013\217\023\263\377\336\375\343T\306\t\365\275\326;\3130h\223\301\306\275\321\007\367\037P\003\231\003\nO\353)\273\333{a\233]oO\204mt6\305\335\r)\273;{\312\356\326\236<[\236\244\t\007\252\315Q\264\340(a\257!\031a\t\005\327\361B\354N.\337L\033\025\307\033\320\246\321i#\005?u\031\240\220\t\016h[\3267D\000B\367[R\306D\226\273C\260\310M\302\243L\231\037\211\003^\261\311\304\3125n\"B\335\330\030J\020_\323\341\227\350\211\030i89M\236)\237L\030\235>\235L\027\233v+b\250\025\022~\221\347\325G\311\261\320jnuv6\03607\262\"F\332\230J\220\342S\272r<\211\027\244TuD\321y\t\207p\3659k\234\216\223\003\232\177C\007\r\351ec\r\363\2429\002\214\362\nNV1t<\375\304k\254\037\3236\250\007\241\366\361rqF\275f\321\321\2068>\343$\253\316ZL\306\371\333 %\r\363\215q\233\315h+v\305\362\207`\005^\363\362&9\203\216\245\323\261\036`\321-:1\244$\210\217Ri\243E\354P\260\205'\340\030\333647\316\303\340\024D\254\332\212\035\207\204G\373\274\340\202\035}\262XN,\317*\211\3723\214\234\t\2156b\307\337\230\205\022Y\237I\311\375\250\023\255U\373\2674\367\323\267'\352\235\023\3450r\257x\221\234\361\272\026u\233\215\226\302\213\013\277\356\360\006x\302\316J\333\010\363C\311\035}I\2423\375\254E\232\202\346N:\361X]\235\233\371>\261\264\224x\241\256\274XH.'VW\276I\316\255\314L%Vf\346\347\324g\311\225o\346\247\271T\342\352\\\342Y2A\356gF&\034\211`S\037\255\316\314\256\314\314qGL\246>K,\324\025\"\343\3442\030\201\340\273D\034\037\016\363X\235\277\202\251jC-\342\006\216\016\216\251\257\213\327\3244\034hJ\323\327\353i2\246\257\312\030\242\276\302B\260\026\036M\327W\321\207\260VMP.6L%Q\316\232\330\331z\002\271\341\262\343\372:j\251B\247\324\370G\226:\022-\005a\252+\201\3675\232\n\2020\374\330\n\225\334E]-\237\3426\227\310\210\277EE\030\223\325\327\205g\303*\250\216\255\313!mm\250\313\357\250\226\335\\\326\310a\316\307\341\024LJK\353jZ\255\231\2666\036\0377U\n}P\363\226\321\242JD\244u\025$\022|\336\335T\032\034\215\324U\3445\204f\352\026)h\203\004\311c""\215\2722\016H\352J(p\312\265\356\000\323S#\216N\t\2111\r\376\3428\305\n\275\014~\240\341\316\024E\230\333>\177!\347\3073-\037\300f\375\212\3254\351\026\327\035\323\2445}0\277iD\035s\216\237\334\266<\361Q\264\371k|sI\253\221Z\320\2340lHE_J\363\242Z\027|h\"\321\021g\273\362\240C\323\327\314\026$$\026,\200\307\365\301\246\004\274>\226 \370\264$\272\3418\246%U\316\3314\3376a\222\000\371Q?v>3\345\270\241\220\304\361V\314tO\264\244u\365\020q\032\206\362(M\354h\362qbuvE\235\232\235\201wP\347\346\347\246\222\352\243\027+\311\345\351\231'\311\345\225i,P\212\234\235\2662\r\257\315\263i&h\232P\023Ik\0164\2225\356}\253z\336\211\306\212F\211h\254\027\027F\"\267\322\272\373\026\233\331Hr\374:XW\222sS\363\3233sO\226\311S&7\241\332\217gW\227\311\375\"\273{\222|\314\316mfaai~e^]\231Z\230\201\276\273iM7\2715\277\331ZV\030\005Q$\375t\350\257\037M\005\031#4\237\356wH\200\212\271\304\334\343\247Ss\350x\346Yr~ueN\313\231\364[\301<\347\314\214\343[\330\242y\327@\322dL[\272?_\360!\333\246\261\014\206\345\264)\342\033\217)oSx\342E\236\255/\007N\204\221\326\245\315\242r,]\223\304\034GIz\032E\236'QE\367X\216\243\342\203tq4z\"\t\213\3301\024\230\013\030uL\245a\236PI\237+\244K:\211\"\372\234\021ht\000y?\300\251\235m\374h\003\3259\030\260%3\275\224\\\\\235YJ>\203v/\007Z\376xf.1\033\310]+\002\310\340\374\343\245\371\331\331G\211\251\247\374\331h\211\335\257xNsr\237\367\035\227B\352\205\245\344\0025\370f\346\321\314Jr\232\277\322\326G\331-\212\232\245\2415Q\223(\264$\343\314A\335v\334\341/\262\016Bh\357\313a\212\213\267\363nKr\233\362\235,\222\032\225\016\013\266\260\242\346v/\346\246\002\00658\340e\371\211#\200P\256e\272\361\303\017z\361\235|\024F\323\210\320e\030\326\351\344l\342\305\212\2106y\267\010\027\017,\324$\365V\325\360u\233>\353\004o\342#\217x\023\261\020\245\353Pl\230\033\003\005\242fM\363\344\273*/5\250t\251\2014|5\312`\204\375xl\362wu\236\307*\242\247)\354\006\261H\313\252\232ji)\235CT-\345Qx\254\351\364\0310G\006\226?\276\350\322P6Z\344\320\002\323\301\260\252\212\000Z\000\276\032C""w\371\004\342;Z\326\327rN\301\306\2724\233\\-\300\016\375Q\232\016Hq7\230\007\253V\377\322T\035\345\251u\305\266c7\323\006d\362P\2010\244\260\000u\235\304\232\212\242|\006\373\241K\240\322A\007\341b\245.\355A\232 \377\350E4\246\207*\007\342\205{\272e\361\351\236\345H\200\320\330\2050X6\372\021\307~\301u*:\013\313\363\355\212\240$\272\357$\221\246\n\021 \013\023DF\221\216\355\003\350\021\202\tc\036|\334H'\273\365\231\254*2Yl\003\247/j*u\177L|\307\004\"\316OS\252\305\213\247\337\375\261\350\366\024c\304\rB\342\220\277\034\244\254\014\376,\333\027\007\214\224\276\304S\230\246t\246\251\240I7S\226\237r\234l\312\331N\345\351\300F\312\274\000\342\354@za\217\014\203F\017\207<\233\036\336\340\n/u\221(\253!\267\345\331\263(\315\222\006\311\217\020\001(\270t\326II!ff\350A\264\256\202\2002\004\225\246\023\236!\351k\005{]\267\014\374\271\272\345\"\014QE\372B\036\211\024J\245wH\\!\317!Jc\234\"\362y\352\0231cV%\306\320\335*Q\032|\237\300+4R\304t\272IZ\311^$\236\3655$z\274g\374\000{\363\002\301~I\304w\205\017\204De\3455\326\030\212\314U\227\213\017\022g\322.\226s5h\210w^\004\311\234'\224/<\020\322\351\036Q\360\325\206\022\037\304Ma\316E\371}\224\0135\344\240\ri\247\3144%\210d\344\213\254\226K\031\332\227A\326\031\300c(\350\003\027]\017\023\223\327\363#\243\343w\3719\302\317Q~\336\343\347\030?\307\371y\237\237\017\3709\201\347\370(\350'\356\243x\342\001\350>\2737J\017\274~6\366\031\036\350\263\356\000\243\365qFP,\024Y\017-\262.\316\372\014\31258\337\200\036\324\345\317a\022B\010)\037Gn\246n\301\313\265\016n\205\032He\240\263z\021\234\320\323\312\252\252A\361\203\000\206\225\241s\016\030~]e\353o\262M\013\367\2331\272\320,\312\304Q\"\241a\031I+\333 z\341\007M5\200\\e\346\362\376\216\320H\251\227\241C$\003\315\007\\\010\336\n\272\252\333\364|\2054f\364\356\3351\306\363\364\\w\361\344J~\307+\305\327P\n+\223AH\273M*\036hyd\\\0033#\335m:\255\345\254\354N\332\330\n\014\001\337\254\031\343\347D:\347\213\325\211\247\007\372\202\255\323\323\227\206\211=o]HZ\237i\322\033\\\235\013\017k\247""\235\206\270\264\361\214\243\225\237\257?\352\210\237n\324g\254\361\2630\225^\302\031aW\351]\304T\010\023\234B>\203\261\370\352\030\236Y+\225\361\275M\350\231\343\036\023NP1\217\024|\245@\301\032\332\255\231\333BV\326`\353\327r\220&(-\013#O\331\202\250Z\031\233UM\\Z\340\231\302p\301\201\255Y\260\351t=\201\262\030\262e\004Um$DS\021\252\217\214F\370\350\010~\261\367{\021:\026\241\343\021z?B\037D\350D\204~\026\242F4\2461\312W\311T-\027\010\006\214\256\037\304e\361\324!\226#\020FI\025\330\201?\364\340cJ>\206\362\315\014u \3229\206\233\010\273\352N)\303\363\251\370\221\024\223\004\021CS\"oy\254E\344W\350\347\211\013\232\216\373\312sl\372\245\350\001S\274\266.S\304\315\361u\254j\335\261&T\227\237\005z2ZXwS\236\273I\252\031X\313,\"\241\202\2261\003\006@\271-\237|O\326q\326\013y\372\254M\237M]~\220a\316zf\006R@\241\240\004\023\252J\342L\317\365\300\312\345D\202\032K\177\032\362\234\2341./\365\250\024\242h\302\201\252\362C\022\020\376\320J\3206w\360@0d[z\216\344L\315\271\016\231\021\3272\251E\030\342\321\262TU>\315\255\360\261\355\207\211\201\355\301\354\200\331Y\217\315\217\245\213Ks\010\237\350h\230\317\345cg\307\255\216\213\235\274\206\364 O\221_\220d\004P\215\356\316\206EtG\2266G\2344\322} \254\256\356\330\021\021g\nR\243\246\300\352\234\352\025\340\204\335\235\2400g\3319m[\2541V\207\320N\313:\324\3240\262A\324Bof\036.\004\246\026\234\301+V\211gN\337T\351.\024P\004\032\010\374m\235q\272O\353\273\246\t\334\263\265\274\267\346\370\210#m<\262;\031\210\224\223\217]'\t>\227\345\3451\201\334\306\360\376\227J\030\337\326\206S\307\230rk\2032l\237\225\226\021i\020\330\242\005\222Z\212\207\326\2612\361\026\336*\003.m\031\241\354P\030\203\000Y\372:\004#~\330\332P\025?\030k\250j8\331\021\265\233\302\030\340\337FA\313\n\371\341\263^\226*~\200\367)\232D\335\0133\246\276\004R\301n\3275\305\325/\227\377\357\207.t\"\356\005$Na\212@\275\350F`S\n\035\026\300T\001M\343\017\021\253\347\240\373\214\354-C\301\034\263\227qZ\034\020r\364\026e=;-\0166Q\304\356;\217\370\0228\335\007\227\200\314""\013P\332<\t0<-\t~%K\200Ya\362\305\007\000\322\226\026\247h\r\337R\304\326\312\023s\251\010\365\347\347\256\211\260\311\026\236T\342\256\263\345\221\313wa@\010\367\020\352i\010>\351\354\312\243\320z\315#\356\372\036]\024\361 \373\322\213\362\255\301@\ne\031\337\277\225x\340^\351\030\242\345\341\3361g\227\365\247\372\036\373\375 \307\340&Bz<\366\361\264^`\362\312'\r\345\350\353N\336\217\235~\250-NB\302\271\255it\037p\315J\373\024\030\205\010GH0\222\353\036\225f\241\300\036\214\0339\034/\227qi\014\372\241\327\r\344\374\224\234\322\335\025y\177\205\224\212\016\013\030\320\377\330_\340n\301O\253\023\205\202e\3607_\361\341wS\243\304wS\344\227\233\030f\223\366l\213\374N\370\301\261\345\227G\341\231\2664o\013\271\361\226\251!6\006p\315-\313\306\037%<\002\214\0100*\300=\001\306\004\030\027\340\276\000\017\004\230\000@\316C\317\007D\207\254\207\237T\202\274\207\236\334\267\001\205\224\303Ht$BG#\364^\204\216E\350x\204\336\217\320\007\021:!Q1\025\306\036\004\355\305\224\004\026\324\212\2511Fs\022\207!dZL~PL\343IK\243\312\273`\333\333\"\346\207h\340ob;\227\335ym\345\305I\232\362\324\334Yx25\277\360\342\334\377^8wjag^\334\257\277u\003\222W\320\351\n79\017\004\020\352\003yf\243>\310g\330\273EH\340l\3706\326\255!%\352f\210/\245(\267\270P\365\350.\206\212\342\233\377\256\221\376\231\266\317\211A\217\304\315\316\272I\336<\365'\377\375'&\355\237\324\362\361R0\337\177y\216\177r\234\370>\335<\205l\211\002'6\217*\035\233P\305)h\262'\217\240N\321YV\204o\207(\035]\005/t\204\024\341|\224$\337\310\242\264\300U\266e\247D\376\032\324\213<6x\023\327\333\2037NhB\334\037\215\341c1|""\"\206\213\274\245\365\273\034\237\023\217\200$H@\202w>\271\npd\013\001.C\356\240'qn\330XJ\222p*\336[,<\r\213(L\215^\262;\001.\362W\211\303\334\207h\316l\201\313\265\204N'N\022/h\244\363_\307)\217y\223\215\nq>\027\342\214&7\020\340d\366C\371 \021\022'8B\204B|;DY\204\344\013\213P\210\263\010\3117\026\233f\274^\204d\275\024!\371&EH\276\261\010\2058D(\302\307b\370D\014\027\"\323\372\275N\204$I(B\362\235E(\300I\204$\036\010\213\354\251A\204\202\376C\021\222\255\342\"\024\024\261\010\205/\020!\211\263\010\0058v%Dsf\013\274I\204b$\361\202\026\"\024\243<\346\255N\204$A!\316h\026!\211\263\010\005\233\351\246D^\305_\311n/\177\223\240\377Y\262,\356\226\301\255]\273vj\010\366\260M\1778\204?\353\341\215\3771>\2759\364Uy\244\372\376\301\310\301\267\207\332\376\300\233{c\265[\237\376\326Vk\277U\031\250\334\257\366\355'~K\324\356\216\324\272z\216z\256\227\023\345\027\225W\007=\207\211\332'w*\033\\\370ai\021\024#\243\177t\235\272\360A\351a\245\255\322W\353\031(\343\201\2327]\347\367\037\024?..\326z\256\034]\271Y\351{\323s\245\270A\245\223\305\305\342\253r[\255\347j\351By\261\254\275\351\271zt\365ve\245\332W\275u\220x\323\325\263\377mQ\253\365\\\334\177]\272TJ\324z?*\371\345\311\312be\375\240\357\r^~\255h\225\327@A\260W\232*m\324z\201\367\027g\313\035e\214\325W\274Rj#p\265\324G\340\375\322\210|{\323\323{\324\033\254\203Go\243\331\214\355o\320X[E\035\rz?\300\200}WKg\320\212\3607\374\350y\247x\2534_\031\241\251l\224/`*\032\320\243\217\306\252\211*q\200xA\313\226\220Jd\277hx\364\301\335j\033\346\210\332\375\331R[\254\362\002\025=-\n^\016cU\033Q\001X\220.Q\317\373\317J\361\016{\213\027K[ep\007k\271V\036\020\345[E\243t\243\374qy\245\362\321\301\331\003\321\363\371\375{\373\257\210\023 T\312\030\366\217\316S\335= \366\212\003\177\364\234\272p\211f6y0P\353\305nV/\034,\036h\177\364\236\272\320w\324{\003\373x\271\222\256~s\220\250\335\034\255\016\020s\247K\347\312\003\345\361\n8vq\177#\352\314/\202\273\227\212#o\272\372\212\274\302d\261\237v\034E\305\004!\357\024\007\010\025}t\227?\252\266U""\373\210\335\233\305eL\256\367\335\342\253#\005l\254\365O\036\014\036\366\035b\260K\305\261\342VI\303\236\177Va\326\017\322\276\274Wz\277m\243\003\003\374X\006\32521\277\2778_~P\371\004\014\356\355?\352\277^\236*K\366\037\365| \270\374\244\370e\271\257\274\013\361\276\320_\234\302N7\3421Y{t8\370{_\255\037\312H\334\276\260\377\354\350=HR\365\275\203[\320\301\221\317\017&\017\261\340?\376\322\320oS\347-\013\232\207\271W\035\t\207!\375\377\254\372\355\201V\373t\274\272X\373\2246\210\036b\221\023\305\007\245\001b_/qe\003\273z\2116\346}\024\366\276_\372\004\032\322V\273\324\317{\013\254\377rM\031,oT.V7h\237\374\243K\237\220\316K\255\371\000\\j\013\361\307\304\337?\336\241Y<.\016\220\360\\\243m%M\367\213\223\245\305\222Y\376\252:x\320\307\032\177\2518\n;\202\345\\..a\026\220t\2056\250<\022C.\356\273\305>\364\004U\371\004s8\215u\215\274a\275\201\366\237.\r\320\376B\236a\277\372\372\261\226]n\325\377\327\322\030/\242\367Jq\263\364\034\006c\361M\357\207\245\225\362\373\225\221\243\241\257\240_X\370\347%\035\n\337?P\356?\372\344\013(\312\325O+\243\225\305\243\341\257\017\333\210\370E9\005-\372\240\272X\325\336\220\310\301\374A\374`\265j\357\001\255]\375\260\364]y\242\362\005x\322G\252\362\r\3311\260\237g\261A\274\274ut}\002F\352\3527\277\267\375\016\253\3671\346E\266\013\235\025\277-i\005\323\222\325w\253\033\277I\2135r\324\377w\351\n\256\227\247!\3357\253\367\017\372\"\317L\372\374\2160\313Ox\372\177\326\010\327\204\325-\335$\213_\353\275\\\\-\r\226/\2273\230\323@\235\261\245\216I/5\036\364\2320\217=\3733A-\374x\200d\300\250\276\200@\3728\351\016{\244\315\221\270\260\364a\005$\255bU_\037\366\005\325}4\205\235\322E(t\233p9WJ\035\245\305\332\305Kd\230J\023P\225\213\357\024\257\027\327\260\025\357\226\331\030\237/\215\220q\251}p\255<\\\205\017\353\246\302n\370\225.\212!\022dC\276\2438\241\267\370\227\222\0264H\020r\216\214\204\030y\016\006N\314\275\324\306\353\205[%g\0176_\370\233\210w\244\213\356.\365c>\275WK\355\245\231\262\212 \341\007!\034\367\021\317$a-\247\341\227\376\007;\025X\232\223\232\276$\017w\250\235\320\274\203c(\341\227\345\346\257\224\377&C\264k\345\353e\273\212\240\352/\373F\361\016\305(\"`\320h\326\275G\027\3114\267\223\237\355-v\034]&\033\321\373\327\322\010\274\325\205\276b'\374\204$GlDAC_\361\254\\\275`C\030\373\200\317\202\021\ny?\030*\371\370\210^\377\032\204\206\220J\3661\202u\357Un\321\304\316\357\217\204\214\256\217\03117\0313\262\264\223\304n\027=r3\227\212\237q\344\007=\303B\253\035\325U\0042\221\031|\257\326\257\220S\016\300\345\277\205Z\311F\263\243\272\030\247\216\005\206Z\3552T\252\\\250|[\315B\017\006\357V\273\311\362\324\006\357U\307\033c\306\320\203>>\314\374\216\016/\0237\310S\215\004\010\305\014\355\330\256\236\352\024k\355\227_\325\276\372ZT=\244\211U\306\311~\013E\355\345\302\366\243\353\343\"\244\354\016b=\2632\"U\034\246[\364\274\005m\"g8V\336(/R\300~n\377\323\"#\244,i8\3526\230\357\216\277\354\257\034\365\261%\032\257\256\034}\266p\264\260r\264b\035Y\271\243\334\336\037\247N\375\243\355\321i\200G\247g\t\314\236^ \260p\372'\002?\235N\021H\235\366\010x\247\267\010l\235\376\372\014\300\327g\246\tL\237Y$\260xf\225\300\352\231\024\201\324\2314\201\364\231\r\002\033g\n\004\ng~%\360\353\231\251v\200\251\366Y\002\263\355\013\004\026\332\327\t\254""\267;\004\234\366\251\016\"\351xB\340I\307\013\002/:~$\360c\307\006\201\215\216\002\201B\307T'Qv>!\360\244s\236\300|\3472\201\345\316\227\004^v\252\004\324\316u\002\353\235\016\001\2473\337Ykgy*>.\r\301|\266\237\375ms\377y1\311\212\327\205x\265\326\3052\207\255\246:\250\321\305\243\213\";\031\204,<\371\035RZW\362vno\035m\355b\354_\332\3529\375\003\201\037\002\206g\tdO\347\t\344O'\210c\2113I\002\3113s\004\346\316,\021X:\223!\2209\263N`\375\314.\201\335\200\3053\304\306\231\366g\004\236\265\377@\340\207\366\237\010\374\324\300\351m\002\333\355\277\020\370\245}\226\230:\333\261@`\241\343%\201\227\035*\001\265\303\"`u\344\010\344:^\023x\335\361\017\002\377\350xJL}\032\260\377;\002\337u\376@\340\207\316W\004^u\332\004\354\316=\002{\235\211\263\264\260\263\337\022\370\366\354\034\201\271\263\026\001\353l\216@\356l\242\213H\272\222\004\222]\317\t<\357zI\340e\227C\300\351\362\010x]\211n\242\354N\022Hv\257\020X\351\376\236\300\367\335?\023\370\271\333 `t;\004\234n\217\200\327\275K`\267\373W\002\277v?=Gk87O`\376\334\317\004~>g\0200\316\345\t\344\317\371\004\374s{\004\366\316%\316\323\260\347\227\010,\235\377\216\300w\347\237\237\377\017\312\325`\331\207\031\370\347\373\277[m\207\017y~\360\364p\353w\355M}\311\006\333\302s\007\003\245>$\377\027{\337\\~\267v\261\267\366\356\225\312@\360\216\277\375\001\004\353mo\332a\311\217\224\273\325\363\007\237\037\256\037-.\325\332/\025\277*\337\240\200\232F\373\205s\202\256\221j\337\321\350\364\341\334\321\322r\255\035\206\375\230\206_\224\266\331yG\r)\026\372\365\300\376=!\233!\255\351\350\372m\233\222U^\007\345\335\355\010\177%N\016{\025\016\343\213\362\036\\\010\314\337\365\375,\273\376{0\336\033\265\366\256\375\216\375Ud\236\367\212\032E\0322b\251]|\017A\315@\355\035\312@\314\312=X{\032\315\036\032\262\037\016\345\037\016\271\017\335\2077^\3764\364\343\2477\207\206\274\020\335\0140\372O\254z\303\235=\303\314\345\214q\367\377\000>\275}\005"; PyObject *data = __Pyx_DecompressString(cstring, 8340, 1); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif #else /* compression: none (21313 bytes) */ const char* const bytes = "Bind: expected a sequence, got Check the query against the passed list of arguments.Consider declaring an explicit composite type and using it to cast the argument.GSSAPI/SSPI authentication is only supported for TCP/IP connectionsNoneNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False. 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. (OID OID value too large: {!r}PostgreSQL does not implement anonymous composite type input.TimoutError was not raised ., @/'{}'$: ... (?{}[])a sized iterable container expected (got type {!r})add_notealready connectedarray length overflowasyncpg.Protocol has no reference to its Connection object and yet a cancellation was requested. Please report this at github.com/magicstack/asyncpg.asyncpg/protocol/codecs/base.pyxasyncpg/protocol/coreproto.pyxasyncpg/protocol/prepared_stmt.pyxasyncpg/protocol/protocol.pyxasyncpg/protocol/scram.pyxasyncpg/protocol/settings.pyxbase_codec is mutually exclusive with c_encoder/c_decoderbit varying bytescannot alias cannot close prepared statement; refs == {} != 0cannot decode type \"{}\".\"{}\": text encoding of range types is not supportedcannot decode type \"{}\".\"{}\": text encoding of composite types is not supportedcannot perform operation: another operation is cancellingcannot perform operation: another operation is in progresscannot perform operation: connection is closedcannot process message cannot register core codec for OID {}: it is greater than MAXSUPPORTEDOID ({})cannot switch to \"idle\" state; protocol is in the \"failed\" statecannot switch to state {}; another operation ({}) is in progresscannot switch to state {}; protocol is in the \"failed\" statecharacter varying codec for co""nnection was closed in the middle of operationcould not get iterationscould not get noncecould not get saltcould not get server signaturecould not verify server signature for SCRAM authentciation: scram-sha-256_decode_row: statement is Nonedisabledouble precisionduplicate GSSAPI/SSPI authentication requestenableexpected 0, 1 or 2 elements in range (got {}): expected a sequence, got expected a sequence (got type {!r})gcgot result for unknown protocol state {}gssapi module not found; please install asyncpg[gssauth] to use asyncpg with Kerberos/GSSAPI/SSPI authentication in element #inconsistent sub-array dimensions at position {}input of anonymous composite types is not supportedinvalid array element: {}invalid array element at index {}: {}invalid data format: {}invalid `format` argument, expected {}, got {!r}invalid input for query argument invalid input in executemany() argument sequence element #invalid nonceinvalid timeout value: expected non-negative float (got {!r})isenabledlist, tuple or Range object expected (got type {})malformed array literal {!r}: {}missing ']' after array dimensionsmissing '=' after array dimensionsmissing array dimension valuemissing codec information for OID {}named prepared statements cannot be marked unpreparedno binary format encoder for type {} (OID {})no codec for composite attribute type no decoder for OID {}no decoder for composite type element in position {} of type OID {}no default __reduce__ due to non-trivial __cinit__no encoder for OID {}non-homogeneous arraynot connectednumber of array dimensions ({}) exceed the maximum expected ({}) of executemany() sequenceoid[]_on_result__prepare: statement is None_on_result: waiter is None_on_result: waiter is done_parse_data_msgs: first message is not \"D\"_parse_data_msgs: result is not a list, but {!r}pg_contrib.hstore: protocol is in an unexpected state query argument {!r} is not a valid element of composite type {}reader is not an asynchronous iterablescram-sha-256self._custom_type_""codecs is not None or self._derived_type_codecs is not Noneself._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 Noneself._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 Nonesize of encoded multirange datum exceeds the maximum allowed specified array dimensions do not match array contentsspilib module not found; please install asyncpg[gssauth] to use asyncpg with Kerberos/GSSAPI/SSPI authenticationtext[]'text', 'binary' or 'tuple''text' or 'binary'text or binarythe number of columns in the result row ({}) is different from what was described ({})the number of query arguments cannot exceed 32767the server expects {x} argument{s} for this query, {y} {w} passed: there is no time with timezonetime without timezonetimestamp with timezonetimestamp without timezone to too many elements in array valuetoo many elements in composite type recordtoo many elemen""ts in multirange value{} type does not support the 'tuple' exchange formattype record missing base type for domain type record missing base type for range type record missing base type for multirange type record missing field types for composite unexpected NULL element in multirange valueunexpected array dimension size: {}unexpected array dimensions value: {}unexpected character {!r} at position {}unexpected codec type: {}unexpected data format: {}unexpected data type of composite type attribute {}: {!r}, expected {!r}unexpected end of stringunexpected error while performing authentication: unexpected exchange format: {}unexpected multirange size value: {}unexpected number of attributes of composite type: {}, expected {}unexpected trailing {} bytes in bufferunhandled standard data type unknown error in protocol implementationunsupported SASL Authentication methods requested by the server: {!r}unsupported authentication method requested by the server: {!r}utf-8waiter is not done while handling critical protocol erroryou need values from server to generate a client proofAF_UNIXARRAY_TYPESAUTHENTICATION_METHODSAUTH_METHOD_NAMEAsyncIterableAttributeBUILTIN_TYPE_NAME_MAPBUILTIN_TYPE_OID_MAPBaseProtocolBaseProtocol.__reduce_cython__BaseProtocol.__setstate_cython__BaseProtocol._create_future_fallbackBaseProtocol._get_timeoutBaseProtocol._is_cancellingBaseProtocol._on_timeoutBaseProtocol._on_waiter_completedBaseProtocol._request_cancelBaseProtocol._wait_for_cancellationBaseProtocol.abortBaseProtocol.bindBaseProtocol.bind_executeBaseProtocol.bind_execute_manyBaseProtocol.closeBaseProtocol.close_portalBaseProtocol.close_statementBaseProtocol.connection_lostBaseProtocol.connection_madeBaseProtocol.copy_inBaseProtocol.copy_outBaseProtocol.data_receivedBaseProtocol.executeBaseProtocol.get_record_classBaseProtocol.get_server_pidBaseProtocol.get_settingsBaseProtocol.is_closedBaseProtocol.is_connectedBaseProtocol.pause_writingBaseProtocol.prepareBaseProtocol.queryBaseProtocol.resum""e_writingBaseProtocol.set_connectionCancelledErrorClientSecurityContextCodecCodecMapCodecMap.__reduce_cython__CodecMap.__setstate_cython__Codec.__reduce_cython__Codec.__setstate_cython__ConnectionDoesNotExistErrorConnectionSettingsConnectionSettings.__reduce_cython__ConnectionSettings.__setstate_cython__ConnectionSettings.add_python_codecConnectionSettings.clear_type_cacheConnectionSettings.get_data_codecConnectionSettings.get_text_codecConnectionSettings.register_data_typesConnectionSettings.remove_python_codecConnectionSettings.set_builtin_type_codecCoreProtocolCoreProtocol.__reduce_cython__CoreProtocol.__setstate_cython__CoreProtocol.is_in_transactionDEFAULT_CLIENT_NONCE_BYTESDIGESTDataCodecConfigDataCodecConfig.__reduce_cython__DataCodecConfig.__setstate_cython__DataCodecConfig._set_builtin_type_codecDataCodecConfig.add_python_codecDataCodecConfig.add_typesDataCodecConfig.clear_type_cacheDataCodecConfig.declare_fallback_codecDataCodecConfig.remove_python_codecDataCodecConfig.set_builtin_type_codecDataErrorENCODINGS_MAPEventFLUSH_MESSAGEFutureIPPROTO_TCPInterfaceErrorInternalClientErrorIterableIterableABCKerberosMappingMappingABCNANFKCNO_TIMEOUTNameNameTypeNegotiateOrderedDictOutdatedSchemaCacheErrorPostgresErrorPreparedStatementStatePreparedStatementState.__reduce_cython__PreparedStatementState.__setstate_cython__PreparedStatementState._get_attributesPreparedStatementState._get_parametersPreparedStatementState._init_codecsPreparedStatementState._init_typesPreparedStatementState.attachPreparedStatementState.detachPreparedStatementState.mark_closedPreparedStatementState.mark_unpreparedProtocolProtocolError__Pyx_PyDict_NextRefREQUIREMENTS_CLIENT_FINAL_MESSAGEREQUIREMENTS_CLIENT_PROOFROLLBACKRangeRecordRecordDescriptorSASLPREP_PROHIBITEDSCRAMAuthenticationSCRAMAuthentication.__reduce_cython__SCRAMAuthentication.__setstate_cython__SCRAMAuthentication._bytes_xor..genexprSCRAMAuthentication._normalize_password..genexprSYNC_MESSAGESecurityContextSequence""SequenceABCSizedSizedABCStopAsyncIterationTCP_NODELAYTimeoutErrorTimerTimer.__enter__Timer.__exit__Timer.__init__Timer.get_remaining_budgetTimer.has_budget_greater_thanTypeUnsupportedClientFeatureErrorUserCredential_a_iabcabortabstimeaclitemadd_done_callbackadd_python_codecadd_typesaddr__aiter__aiteralias_oidalias_toaltamount__anext__anyanyarrayanycompatibleanycompatiblearrayanycompatiblemultirangeanycompatiblenonarrayanycompatiblerangeanyelementanyenumanymultirangeanynonarrayanyrangeapg_excapg_exc_baseapg_typesarg_bufsargsargs_bufarrayarray_element_oidasciiasyncioasyncio.coroutinesasyncpgasyncpg.exceptionsasyncpg.protocol.protocolasyncpg.protocol.recordattachattrnameattrnamesattrtypoidsauth_msgauthentication_method__await__bb64decodeb64encodeb_i_basebase64base_codecbase_typebasetypebasetype_namebigbigintbinarybindbind_executebind_execute_manybind_execute_many..genexprbitboolboxbpcharbudget_budgetbufferbuiltinsbyteabyteordercc_decoderc_encodercall_exception_handlercall_latercancel_cancel_current_commandcancelled__cause__charcharacterchunkcidcidrcircle__class_getitem___cleanupclearclear_type_cacheclient_channel_bindingclient_encodingcline_in_tracebackcloseclose_portalclose_statementcodeccodec_mapcodec_setcodec_strcodecscollectionscollections.abccommand_timeoutcomp_elem_codecscomp_type_attrscompatcompositeconcon_params_configconnected_futconnectionconnection_lostconnection_madecopy_incopy_in..copy_outcopy_out..copy_stmtcore_codeccp1250cp1251cp1252cp1253cp1254cp1255cp1256cp1257cp1258cp1521cp866cp874cp932cp936cp949cp950create_future_create_future_fallback_create_recordcredentialcstringddatadata_gendata_receiveddata_typedatabasedatedecimaldeclare_fallback_codecdecodedecoderdescdetachdetail__dict___dictdigest__doc__doneeelemelem_codecelem_delimelem_formatelemdelimelement_nameselemselemtypeelemtype_nameemptyencodeencoder__enter__enumerateeteuc_cneuc_jis_2004euc_jpeuc_kreuccneucjpeuckrevent_triggerexexcexceptionexceptionsexecute__exit""__ffamilyfdw_handlerfloat4float8fmtformatformats__func__futgenexprget_get_attributesget_data_codecget_extra_info_get_parametersget_record_classget_remaining_budgetget_server_pidget_settingsget_text_codec_get_timeout__getattribute____getstate__groupgssgssapigsslibgtsvectorhas_budget_greater_thanhas_text_elementshashlibhexdigesthinthmachostbased_serviceiignore_custom_codecin_prohibited_tablein_table_a1in_table_b1in_table_c12in_table_c21_c22in_table_c3in_table_c4in_table_c5in_table_c6in_table_c7in_table_c8in_table_c9in_table_d1in_table_d2index_am_handlerinet__init___init_codecs_init_typesinitiateintint2int4int8integerinternalinterval_is_cancellingis_closedis_connected_is_coroutineis_in_transactionisemptyitemitemsiteratorjsonjsonbjsonpathkerberosv5kindkoi8_rkoi8_ukoi8rkoi8ukrbsrvnamelanguage_handlerlimitlinelookuplooplowerlower_inclsegmacaddrmacaddr8__main__make_recordmappingmark_closedmark_unpreparedmd5message__metaclass__missing__module__moneymonotonicmore__mro_entries__multirangename__name__new__new__nextnormalizensnum_colsnumericobjectoid_on_error_on_timeout_on_waiter_completedopaquep_oidpasswordpassword_iterationspassword_saltpathpause_readingpause_writingpg_brin_bloom_summarypg_brin_minmax_multi_summarypg_catalogpg_ddl_commandpg_dependenciespg_lsnpg_mcv_listpg_ndistinctpg_node_treepg_snapshotpointpolygonpopportal_namepositionpostgresprepare__prepare___process_log_message_process_notificationprotocol__pyx_checksum__pyx_result__pyx_state__pyx_type__pyx_unpickle_BaseProtocol__pyx_unpickle_CoreProtocol__pyx_unpickle_DataCodecConfig__pyx_vtable____qualname__queryrangerange_subtyperange_subtype_namerange_subtype_oidrdescrereaderrealrecrecordrecord_classrecord_stmtrecords__reduce____reduce_cython____reduce_ex__refrefcursorregclassregcollationregconfigregdictionaryregister_data_typesregnamespaceregoperregoperatorregprocregprocedureregroleregtypereleasereltimeremove_python_codec_request_cancelresultresume_readingresume_writingreturn_extrareturn_rowsreversedrowsscal""arschemasearchsecretsselfsendserver_first_messageserver_nonceserver_settingssetset_builtin_type_codec_set_builtin_type_codecset_connectionset_exception__set_name__set_resultsetdefaultsetsockopt__setstate____setstate_cython__settingssha256shift_jisshift_jis_2004sinksjissleepsmallintsmgrsocksocketsql_asciisspisspilib_startedstartswithstatestatus_msgstepstmt_namestrstringpreptable_am_handlertarget_codectarget_nametbtcvntcvn5712__test__textthrowtitidtimetimeouttimertimestamptimestamptztimetztintervalto_bytestoken_bytestransporttriggertsm_handlertsquerytsvectortupletxid_snapshottypeinfostypekindtypenametypeoidtypestypeschematypoidunicodeunicodedataunknownupdateupperupper_incusageuse_setstateuserutf_8uuidvaluevaluesvarbitvarcharvoidvsciiwwaitwait_for_wait_for_cancellationwaiterwaswbufweakrefwerewinwin1250win1251win1252win1253win1254win1255win1256win1257win1258win866win874win932win936win949win950windows1250windows1251windows1252windows1253windows1254windows1255windows1256windows1257windows1258windows866windows874windows932windows936windows949windows950with_msgwritewritelineswriting_allowedxxformatxidxid8xmlyzipClient KeyPGCOPY\n\377\r\n\000PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, PyObject *, char **, Py_ssize_t *)\000PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000PyObject *(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t)\000as_pg_string_and_size\000bits_encode\000bool_encode\000box_encode\000bytea_""encode\000cidr_encode\000circle_encode\000date_encode\000date_encode_tuple\000float4_encode\000float8_encode\000hstore_encode\000inet_encode\000int2_encode\000int4_encode\000int8_encode\000interval_encode\000interval_encode_tuple\000jsonb_encode\000jsonpath_encode\000line_encode\000lseg_encode\000numeric_encode_binary\000numeric_encode_text\000path_encode\000pg_snapshot_encode\000point_encode\000poly_encode\000text_encode\000tid_encode\000time_encode\000time_encode_tuple\000timestamp_encode\000timestamp_encode_tuple\000timestamptz_encode\000timetz_encode\000timetz_encode_tuple\000uint4_encode\000uint8_encode\000uuid_encode\000void_encode\000bits_decode\000bool_decode\000box_decode\000bytea_decode\000cidr_decode\000circle_decode\000date_decode\000date_decode_tuple\000float4_decode\000float8_decode\000hstore_decode\000inet_decode\000int2_decode\000int4_decode\000int8_decode\000interval_decode\000interval_decode_tuple\000jsonb_decode\000jsonpath_decode\000line_decode\000lseg_decode\000numeric_decode_binary\000numeric_decode_text\000path_decode\000pg_snapshot_decode\000point_decode\000poly_decode\000text_decode\000tid_decode\000time_decode\000time_decode_tuple\000timestamp_decode\000timestamp_decode_tuple\000timestamptz_decode\000timetz_decode\000timetz_decode_tuple\000uint4_decode\000uint8_decode\000uuid_decode\000void_decode\000frb_checkSCRAM-SHA-256Server Key\"\"\000,\000\000\000\001c=,c=,i=(\\d+),?\2401\260\032\2701\270J\300a\210!\34034\330*+\200\001\330\004*\250!\2506\260\021\210A\200A\33001\330\010\014\320\014$\240A\240Y\250j\270\014\300A\330%/\250q\330\010\014\320\014\035\230Q\200A\33012\360\010\000\r\034\230=\250\001\250\021\330\014!\240\021\330\014\035\230Q\340\010\013\2107\220#\220Q\330\014\027\320\027)\250\021\340\014\027\220q\340\010\013\210:\220Q\220j\240\001\330\014\030\230\r\240Q\240a\340\014\030\320\030-\250T\260\021\260*\270A\340\010\014\210J\220a\330\014\017\210z\230\023\230A\330\020\037\230t\240:\250Q\250k\270\021\340\020\037\230\177\250a\250z\270""\021\340\014\017\210}\230C\230q\330\020\021\340\014\024\220L\240\005\240Q\330\014\021\220\027\230\001\330\014\021\220\030\230\021\330\014\021\220\032\2301\330\014\021\220\030\230\021\340\014\020\320\020$\240A\240Y\250j\270\001\330\014\030\230\001\340\010\013\2104\210q\330\014\017\210w\220c\230\021\330\020\034\230A\330\021\030\230\003\2301\330\020\034\230A\340\020\034\230A\340\014\022\220*\230O\2501\330\020\037\230q\240\r\250Q\250a\330\020\037\320\0374\260A\260Q\200A\330\010\014\320\014!\240\021\330\010\014\320\014!\240\021\200A\330\010\013\2104\210q\330\014\022\220*\320\0340\260\001\330\020\021\330\010\014\210L\230\001\200A\330\010\013\2104\210q\330\014\r\330\010\014\210K\220q\330\010\014\320\014.\250a\250q\330\010\014\210K\220q\330\010\014\210J\220f\230A\330\010\014\210M\230\021\200A\330\010\013\2104\210q\330\014\020\220\017\230w\240a\330\014\020\320\020\"\240!\330\010\013\2104\210w\220d\230(\240#\240T\250\037\270\007\270q\330\014\r\330\010\013\2103\210j\230\001\330\014\020\320\020 \240\001\200A\360\006\000\t\014\2104\210s\220!\360\014\000\r\023\220*\320\034:\270!\330\020/\250q\260\r\270Q\270a\360\020\000\r\021\320\020(\250\001\250\025\250f\260H\270A\330)2\260!\340\014\024\220D\230\n\240!\2405\250\001\340\010\017\210q\200A\360\006\000\t\014\2104\210t\2201\330\014\023\2201\340\010\021\220\021\330\010\014\210E\220\024\220Q\330\014\023\2201\220A\220Q\330\014\022\220!\2201\220A\340\014\024\220D\230\t\240\037\260\001\260\021\330\014\017\210v\220S\230\001\330\020\026\220j\320 4\260A\330\024:\270'\300\021\300!\340\014\023\2204\220w\230a\230t\2409\250A\340\014\022\220'\230\021\330\020\031\230\032\2401\240A\330\024\035\230U\240!\2405\250\005\250W\260E\270\027\300\005\300Q\340\010\017\210u\220A\220Q\200A\330\010\013\2104\210x\220w\230d\240#\240S\250\005\250S\260\001\330\020\024\220O\2407\250%\250q\330\020\024\320\024$\240C\240q\330\014\r\330\010\014\320\014\034\230A\330\010\014\210G\220>\240\021\240'\250\035\260a\200A\330\010\013\2104\210y\230\003\2301\340\014\023\2201\340""\014\023\2204\220y\240\002\240!\200A\330\010\013\2104\210y\230\007\230q\330\014\020\220\014\230D\240\n\250!\200A\330\010\013\2104\210y\230\007\230q\330\014\020\220\014\230D\240\n\250#\250R\250t\2601\200A\360\n\000\t\014\2107\220#\220Q\330\014\026\220a\330\r\024\220C\220q\330\014\026\220a\330\r\024\220C\220q\330\014\026\220a\340\014\022\220*\230O\2501\330\020B\300'\310\021\330\024*\250!\360\006\000\t\r\210M\320\0310\260\001\260\031\270*\300A\3301;\270:\300Q\200A\360\016\000\t\014\2107\220#\220Q\330\014\026\220a\330\014\026\220a\330\r\024\220C\220q\330\014\026\220a\330\014\026\220a\330\r\024\220C\220q\330\014\026\220a\330\014\026\220a\340\014\022\220*\230O\2501\330\020B\300'\310\021\330\0243\2601\360\006\000\t\r\210M\320\031*\250!\2509\260J\270a\330+5\260Q\330+4\260A\330+4\260A\200A\330\010\013\2108\2207\230!\330\014\r\330\020\023\2204\220q\230\t\240\023\240A\330\024\032\230!\330\020\032\230%\230q\240\001\330\023\024\330\020\026\220j\240\001\330\024\025\330 '\240q\250\017\260q\340\010\017\210t\320\023%\240Q\240a\200A\330\010\014\320\014\034\230D\240\001\200A\330\010\014\320\014\034\230F\240!\200A\360\022\000\t\r\210F\220!\330\014\022\220\"\220A\220Q\340\014\017\210t\220:\230Q\230e\240?\260'\270\021\330\020\021\340\014\023\2202\220Q\220a\330\014\025\220R\220q\230\001\330\014 \240\002\240!\2401\330\014 \240\002\240!\2401\330\014\017\210r\220\021\220!\330\020\"\240%\240q\250\002\250!\2501\340\020\"\240!\330\014\030\230\002\230!\2301\340\014\017\210q\360\010\000\021\024\2204\220{\240!\2401\330\024\033\2304\230q\240\001\330\020\027\220v\230W\240A\240Q\340\020\035\230T\240\032\2501\320,?\270q\330\020\023\220;\230c\240\021\330\024!\240\024\320%<\270A\330\030+\2502\250Q\320.@\300\001\340\020\035\230Y\240b\250\001\250\034\260Q\260a\340\020\024\320\024)\250\021\250%\250z\270\021\330\031)\250\021\330\030\035\230V\2408\250<\260q\340\021\023\2201\220H\230C\230q\360\006\000\021\024\2204\220q\330\024\032\230*\320$8\270\001\330\030H\310\001\310\021\340\020#\2401\330\020$\240A\340""\020\024\220J\230a\330\024!\240\024\240Z\250q\260\010\270\001\330\024\027\220{\240#\240Q\330\030\036\230j\320(<\270A\330\034D\300A\300Q\330\024\027\220z\240\030\250\023\250A\330\030,\250A\330\024$\240G\2501\250A\340\020 \240\013\250<\260q\330\020\024\220C\220|\2409\250A\250R\250q\260\001\330\024!\240\021\240,\250a\360\010\000\021\024\2201\330\024\"\240!\340\024\"\240!\340\020\024\320\024)\250\021\250%\250q\330\031-\250Q\330\030\035\230V\2408\250=\270\001\330\030)\250\021\340\021\023\2201\220H\230C\230q\360\006\000\021\024\2204\220q\330\024\032\230*\320$8\270\001\330\030C\3001\300A\340\020\035\230T\240\032\2501\250K\260q\330\020\023\220;\230c\240\021\330\024!\240\024\320%<\270A\330\030#\2402\240Q\320&8\270\001\340\020\024\320\024)\250\021\250%\250z\270\033\300A\340\021\023\2201\220H\230C\230q\360\006\000\021\024\2204\220q\330\024\032\230*\320$8\270\001\330\030B\300!\3001\340\020\035\230T\240\032\2501\320,?\270q\330\020\023\220;\230c\240\021\330\024!\240\024\320%<\270A\330\030+\2502\250Q\320.E\300Q\340\020\024\320\024)\250\021\250%\250z\270\021\330\031)\250\021\250%\250v\260X\270Q\340\021\023\2201\220H\230C\230q\360\006\000\021\024\2204\220q\330\024\032\230*\320$8\270\001\330\030G\300q\310\001\340\020\035\230T\240\032\2501\320,?\270q\330\020\023\220;\230c\240\021\330\024!\240\024\320%<\270A\330\030+\2502\250Q\320.E\300Q\340\020\024\320\024)\250\021\250%\250z\270\021\330\031.\250a\250u\260F\270(\300!\340\021\023\2201\220H\230C\230q\340\020\024\320\024,\250A\250U\260&\270\010\300\001\330-6\260a\340\020\024\320\024+\2501\250E\260\026\260q\200A\330\010\014\210G\2201\320\024&\240a\330\014\020\320\020$\240D\250\002\250)\2606\270\021\330\010\014\320\014\035\230Q\200A\360\006\000\t\022\220\021\330\010\014\210G\2204\220q\330\014\024\220D\230\t\240\037\260\001\260\021\330\014\017\210v\220S\230\001\330\020\026\220j\320 4\260A\330\024:\270'\300\021\300!\330\014\022\220'\230\021\230)\2405\250\001\330\020\025\220U\230'\240\025\240g\250U\260!\340\010\017\210u\220A\220Q\200A\330\010""\014\210G\220:\230Q\230a\330\010\014\320\014\"\240!\200A\330\010\014\210I\220Q\200A\330\010\014\210J\220a\200A\330\010\014\210J\220g\230T\240\021\240!\200A\330\010\014\210K\220q\330\010\014\210L\230\001\200A\330\010\014\210M\320\031*\250!\200A\330\010\014\210M\230\032\2401\240A\200A\330\010\014\210M\320\031-\250Q\250i\260z\300\021\200A\330\010\014\210M\230\021\340\010\017\210y\230\017\240q\250\001\330\010\014\210E\220\027\230\005\230Q\330\017\023\2207\230!\2308\2401\330\017\022\220$\220h\230c\240\026\240q\330\014\020\220\013\2301\230F\240!\330\034\"\240.\260\001\340\010\t\330\014\020\220\t\230\021\330\010\017\210}\230A\330\014\025\220V\2301\330\014\020\220\016\230a\330\014\020\220\013\2301\230A\330\014\020\220\n\230!\2301\200A\330\010\014\210N\230!\330\010\014\210K\220q\230\001\330\010\014\320\014 \240\001\240\021\200A\360\006\000\r\036\230Q\340\010\013\2104\210q\330\014\020\220\t\230\024\230Q\330\020\030\230\004\230I\240_\260A\260Z\270q\330\020\023\2206\230\023\230E\240\023\240D\250\005\250\\\270\021\330\024\033\2304\230q\240\001\340\010\013\2104\210q\330\014\020\220\t\230\024\230Q\330\020\030\230\004\230I\240_\260A\260[\300\005\300Q\300a\330\020\023\2206\230\023\230E\240\023\240D\250\005\250\\\270\021\330\024\033\2304\230q\240\005\240Q\240a\340\010\017\210q\200A\330\010\014\320\014\035\230T\240\036\250q\330\010\014\320\014\"\240$\240n\260A\340\010\016\210d\220/\240\021\330\010\013\2104\210w\220a\360\006\000\r\020\320\017'\240q\250\004\250A\340\014\020\220\005\320\025,\250A\330\020\033\2301\360\n\000\r\021\220\006\220a\340\010\013\2104\210w\220c\230\021\360\014\000\r\021\220\007\220q\230\001\330\010\014\210K\220q\230\001\200A\330\010\014\320\014!\240\026\240q\200A\360\006\000\r \230q\330\014$\240A\330\014$\240A\330\014\037\230q\330\014\033\230=\250\001\250\021\330\014\035\230Q\360\006\000\t\r\320\014 \240\001\240\031\250*\260A\340\010\013\2101\330\014\020\220\n\230!\2301\340\010\013\2107\220#\220Q\330\014\027\320\027'\240q\340\014\027\220q\340\010\014\210G\2201""\330\014\017\210x\220s\230!\330\020\023\2209\230C\230q\330\024!\240\036\250q\260\005\260U\270!\330\024\027\220{\240#\240Q\330\030\031\330\024 \240\n\250!\330\024 \240\n\250!\330\025\036\230c\240\021\330\024!\240\024\240Z\250q\260\005\260Q\330\024\027\220{\240#\240Q\330\030\031\340\014\020\320\020$\240A\240Y\250a\330\025&\240a\240u\250J\260l\300!\330'0\260\t\270\033\300A\330'3\2605\270\001\330\014\030\230\001\340\010\013\2104\210q\330\014\022\220*\230O\2501\330\020F\300g\310Q\330\024\025\200A\330\010\017\210t\2201\200A\330\010\017\210t\2204\220y\240\004\240D\250\014\260C\260q\200A\330>?\330?@\330\010\017\210t\220=\240\n\250!\2505\260\010\270\001\200A\360\006\000\t\020\210t\220=\240\004\320$5\260Q\200A\330\010\t\330\014\020\220\017\230w\240e\2501\330\014\020\320\020$\240G\2501\200A\330\010\017\210w\220g\230Q\230e\2404\240q\240Q\200\001\330\004\n\210+\220Q\200\001\330\004-\250Q\250f\260A\200\001\360\010\000\005\016\210T\320\021!\240\024\320%5\260T\3209P\320PT\320Ti\320im\320m}\360\000\000~\001B\002\360\000\000B\002L\002\360\000\000L\002P\002\360\000\000P\002^\002\360\000\000^\002b\002\360\000\000b\002s\002\360\000\000s\002w\002\360\000\000w\002@\003\360\000\000@\003D\003\360\000\000D\003Q\003\360\000\000Q\003U\003\360\000\000U\003b\003\360\000\000b\003f\003\360\000\000f\003q\003\360\000\000q\003u\003\360\000\000u\003\177\003\360\000\000\177\003C\004\360\000\000C\004L\004\360\000\000L\004P\004\360\000\000P\004k\004\360\000\000k\004o\004\360\000\000o\004C\005\360\000\000C\005G\005\360\000\000G\005Y\005\360\000\000Y\005]\005\360\000\000]\005q\005\360\000\000q\005u\005\360\000\000u\005C\006\360\000\000C\006G\006\360\000\000G\006O\006\360\000\000O\006S\006\360\000\000S\006[\006\360\000\000[\006_\006\360\000\000_\006k\006\360\000\000k\006o\006\360\000\000o\006p\006\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\030\230\001\330\004\007\200q\330\010\017\320\017-\250T\260\021\260'\270\033\300G\3101\340\010""\017\320\017-\250T\260\021\260'\270\033\300A\200\001\360\010\000\005\016\210T\320\021!\240\024\320%5\260T\3209P\320PT\320Ti\320im\320mw\320w{\360\000\000|\001L\002\360\000\000L\002P\002\360\000\000P\002Z\002\360\000\000Z\002^\002\360\000\000^\002l\002\360\000\000l\002p\002\360\000\000p\002A\003\360\000\000A\003E\003\360\000\000E\003N\003\360\000\000N\003R\003\360\000\000R\003g\003\360\000\000g\003k\003\360\000\000k\003{\003\360\000\000{\003\177\003\360\000\000\177\003I\004\360\000\000I\004M\004\360\000\000M\004Z\004\360\000\000Z\004^\004\360\000\000^\004k\004\360\000\000k\004o\004\360\000\000o\004x\004\360\000\000x\004|\004\360\000\000|\004L\005\360\000\000L\005P\005\360\000\000P\005[\005\360\000\000[\005_\005\360\000\000_\005i\005\360\000\000i\005m\005\360\000\000m\005z\005\360\000\000z\005~\005\360\000\000~\005K\006\360\000\000K\006O\006\360\000\000O\006V\006\360\000\000V\006Z\006\360\000\000Z\006j\006\360\000\000j\006n\006\360\000\000n\006}\006\360\000\000}\006A\007\360\000\000A\007J\007\360\000\000J\007N\007\360\000\000N\007i\007\360\000\000i\007m\007\360\000\000m\007A\010\360\000\000A\010E\010\360\000\000E\010W\010\360\000\000W\010[\010\360\000\000[\010o\010\360\000\000o\010s\010\360\000\000s\010A\t\360\000\000A\tE\t\360\000\000E\tT\t\360\000\000T\tX\t\360\000\000X\t`\t\360\000\000`\td\t\360\000\000d\to\t\360\000\000o\ts\t\360\000\000s\t{\t\360\000\000{\t\177\t\360\000\000\177\tK\n\360\000\000K\nO\n\360\000\000O\n`\n\360\000\000`\nd\n\360\000\000d\np\n\360\000\000p\nt\n\360\000\000t\n}\n\360\000\000}\nA\013\360\000\000A\013R\013\360\000\000R\013V\013\360\000\000V\013W\013\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\030\230\001\330\004\007\200q\330\010\017\320\017-\250T\260\021\260'\270\033\300G\3101\340\010\017\320\017-\250T\260\021\260'\270\033\300A\200\001\360\010\000\005\016\210T\320\021'\240t\2501\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010""\022\220!\330\010\027\220q\340\010\030\230\001\330\004\007\200q\330\010\017\320\0170\260\004\260A\260W\270K\300w\310a\340\010\017\320\0170\260\004\260A\260W\270K\300q\240Z\250q\260\n\270!\230\021\210!\340\017\020\340\025\026\330\017\020\330\026\027\250!\210!\340\017\020\340\025\026\340\025\026\210!\240a\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220?\240(\250!\2501\330\004\007\200|\2207\230!\330\0101\260\021\3202D\300N\320RS\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220<\230x\240q\250\001\330\004\007\200|\2207\230!\330\010.\250a\250\177\270n\310A\330\004\013\2101\200\001\360\016\000\005\010\200x\210s\220!\330\010\017\320\017\037\230q\240\004\240A\340\010\017\320\017\037\230q\330\014\025\220U\230!\230<\240}\260A\340\004\n\210$\210l\230!\2308\2403\240a\240q\330\004\010\210\005\210U\220!\2203\220a\220q\330\010\017\210u\220A\220Q\330\017\031\230\021\230!\330\022%\240Q\240e\2503\250a\330\004\013\2101n,,n=,p=,r=r=([^,]+),,s=([^,]+),v=([^,]+)NULLcclient_encodingdemmd5r"; PyObject *data = NULL; CYTHON_UNUSED_VAR(__Pyx_DecompressString); #endif PyObject **stringtab = __pyx_mstate->__pyx_string_tab; Py_ssize_t pos = 0; for (int i = 0; i < 850; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); if (likely(string) && i >= 161) PyUnicode_InternInPlace(&string); if (unlikely(!string)) { Py_XDECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } stringtab[i] = string; pos += bytes_length; } for (int i = 850; i < 939; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); stringtab[i] = string; pos += bytes_length; if (unlikely(!string)) { Py_XDECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } } Py_XDECREF(data); for (Py_ssize_t i = 0; i < 939; i++) { if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { __PYX_ERR(0, 1, __pyx_L1_error) } } #if CYTHON_IMMORTAL_CONSTANTS { PyObject **table = stringtab + 850; for (Py_ssize_t i=0; i<89; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); #else Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); #endif } } #endif } { PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0; int8_t const cint_constants_1[] = {0,1,4,6,16,17,18,19,20,21,23,24,25,26,27,28,29,32,114}; int16_t const cint_constants_2[] = {142,194,210,269,325,600,601,602,603,604,628,650,700,701,702,703,704,705,718,774,790,829,869,1009,1028,1033,1042,1043,1082,1083,1114,1184,1186,1266,1560,1562,1700,1790,2202,2203,2204,2205,2206,2249,2275,2276,2277,2278,2279,2280,2281,2282,2283,2776,2950,2970,3115,3220,3310,3361,3402,3500,3614,3615,3642,3734,3769,3802,3831,3838,4072,4089,4096,4191,4537,4538,4600,4601,5017,5038,5069,5077,5078,5079,5080}; int32_t const cint_constants_4[] = {32768L,524288L,134522893L,175807176L,228230485L}; for (int i = 0; i < 109; i++) { numbertab[i] = PyLong_FromLong((i < 19 ? cint_constants_1[i - 0] : (i < 104 ? cint_constants_2[i - 19] : cint_constants_4[i - 104]))); if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error) } } #if CYTHON_IMMORTAL_CONSTANTS { PyObject **table = __pyx_mstate->__pyx_number_tab; for (Py_ssize_t i=0; i<109; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); #else Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); #endif } } #endif return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_codeobjects ### */ typedef struct { unsigned int argcount : 4; unsigned int num_posonly_args : 1; unsigned int num_kwonly_args : 2; unsigned int nlocals : 5; unsigned int flags : 10; unsigned int first_line : 11; } __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( const __Pyx_PyCode_New_function_description descr, PyObject * const *varnames, PyObject *filename, PyObject *funcname, PyObject *line_table, PyObject *tuple_dedup_map ); static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 188}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_a_i, __pyx_mstate->__pyx_n_u_b_i}; __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_scram_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__26, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 287}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_scram_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 313}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_in_prohibited_table}; __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_scram_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 327}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_scram_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 336}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_scram_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {4, 0, 3, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 139}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stmt_name, __pyx_mstate->__pyx_n_u_query, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_ignore_custom_codec, __pyx_mstate->__pyx_n_u_record_class, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex}; __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_prepare, __pyx_mstate->__pyx_kp_b_iso88591_34, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 167}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_portal_name, __pyx_mstate->__pyx_n_u_limit, __pyx_mstate->__pyx_n_u_return_extra, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_args_buf, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex}; __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_bind_execute, __pyx_mstate->__pyx_kp_b_iso88591__27, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 228}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_b}; __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__28, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 207}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_portal_name, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_return_rows, __pyx_mstate->__pyx_n_u_timer, __pyx_mstate->__pyx_n_u_data_gen, __pyx_mstate->__pyx_n_u_arg_bufs, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_more, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_ex, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_bind_execute_many, __pyx_mstate->__pyx_kp_b_iso88591__29, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 268}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_portal_name, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_args_buf, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex}; __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_bind, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 296}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_portal_name, __pyx_mstate->__pyx_n_u_limit, __pyx_mstate->__pyx_n_u_return_extra, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex}; __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_execute, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 325}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_portal_name, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex}; __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_close_portal, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 347}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_query, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex}; __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_query, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 371}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_copy_stmt, __pyx_mstate->__pyx_n_u_sink, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_timer, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_done, __pyx_mstate->__pyx_n_u_status_msg, __pyx_mstate->__pyx_n_u_ex}; __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_copy_out, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 410}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f}; __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_1Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 22, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 424}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_copy_stmt, __pyx_mstate->__pyx_n_u_reader, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_records, __pyx_mstate->__pyx_n_u_record_stmt, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_wbuf, __pyx_mstate->__pyx_n_u_num_cols, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_timer, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_codecs, __pyx_mstate->__pyx_n_u_settings, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_item, __pyx_mstate->__pyx_n_u_aiter_2, __pyx_mstate->__pyx_n_u_iterator, __pyx_mstate->__pyx_n_u_chunk, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_status_msg}; __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_copy_in, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 553}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f}; __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 562}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex}; __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_close_statement, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 602}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_timeout}; __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_close, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 744}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_wait_for_cancellation, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 32}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_get_text_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_types}; __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_register_data_types, __pyx_mstate->__pyx_kp_b_iso88591_A_M_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 38}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_typeinfos, __pyx_mstate->__pyx_n_u_typekind, __pyx_mstate->__pyx_n_u_encoder, __pyx_mstate->__pyx_n_u_decoder, __pyx_mstate->__pyx_n_u_format}; __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_add_python_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_7_Q_a_a_Cq_a_a_Cq_a_a_O1_B_31, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 65}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema}; __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_remove_python_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_M_Qiz, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 68}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_clear_type_cache, __pyx_mstate->__pyx_kp_b_iso88591_A_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 71}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_typekind, __pyx_mstate->__pyx_n_u_alias_to, __pyx_mstate->__pyx_n_u_format}; __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_set_builtin_type_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_7_Q_a_Cq_a_Cq_a_O1_B_M_0_A1_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 91}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_oid, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_ignore_custom_codec}; __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_get_data_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_t_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 517}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_types, __pyx_mstate->__pyx_n_u_elem_codec, __pyx_mstate->__pyx_n_u_comp_elem_codecs, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_elem_format, __pyx_mstate->__pyx_n_u_has_text_elements, __pyx_mstate->__pyx_n_u_elem_delim, __pyx_mstate->__pyx_n_u_ti, __pyx_mstate->__pyx_n_u_oid, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_array_element_oid, __pyx_mstate->__pyx_n_u_range_subtype_oid, __pyx_mstate->__pyx_n_u_comp_type_attrs, __pyx_mstate->__pyx_n_u_base_type, __pyx_mstate->__pyx_n_u_typoid, __pyx_mstate->__pyx_n_u_element_names, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_attrname}; __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_add_types, __pyx_mstate->__pyx_kp_b_iso88591_A_F_AQ_t_Qe_2Qa_Rq_1_1_r_q_1_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {10, 0, 0, 18, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 647}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_typekind, __pyx_mstate->__pyx_n_u_typeinfos, __pyx_mstate->__pyx_n_u_encoder, __pyx_mstate->__pyx_n_u_decoder, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_xformat, __pyx_mstate->__pyx_n_u_core_codec, __pyx_mstate->__pyx_n_u_c_encoder, __pyx_mstate->__pyx_n_u_c_decoder, __pyx_mstate->__pyx_n_u_base_codec, __pyx_mstate->__pyx_n_u_oid, __pyx_mstate->__pyx_n_u_codec_set, __pyx_mstate->__pyx_n_u_formats, __pyx_mstate->__pyx_n_u_fmt}; __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_add_python_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_q_A_A_q_Q_A_1_1_7_Q_q_q_G1_xs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 692}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_fmt}; __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_remove_python_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_G1_a_D_6_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 697}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_typekind, __pyx_mstate->__pyx_n_u_alias_to, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_target_codec, __pyx_mstate->__pyx_n_u_oid, __pyx_mstate->__pyx_n_u_alias_oid, __pyx_mstate->__pyx_n_u_codec_set, __pyx_mstate->__pyx_n_u_formats, __pyx_mstate->__pyx_n_u_codec_str}; __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_set_builtin_type_codec_2, __pyx_mstate->__pyx_kp_b_iso88591_A12_Q_7_Q_q_Qj_Qa_T_A_Ja_z_A_t_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 746}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_typekind, __pyx_mstate->__pyx_n_u_alias_to, __pyx_mstate->__pyx_n_u_format}; __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_set_builtin_type_codec, __pyx_mstate->__pyx_kp_b_iso88591_A01_AYj_A_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 752}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_clear_type_cache, __pyx_mstate->__pyx_kp_b_iso88591_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 755}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_oid, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_codec}; __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_declare_fallback_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_4s_q_Qa_fHA_2_D_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate}; __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_t1_G1F_a_vWE_Q_q_q_0_AWKwa_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 46}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_coreproto_pyx, __pyx_mstate->__pyx_n_u_is_in_transaction, __pyx_mstate->__pyx_kp_b_iso88591_A_t_5Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate}; __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_5T9PPTTiimm_B_B_L_L_P_P_b_b_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_oid}; __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_get_parameters, __pyx_mstate->__pyx_kp_b_iso88591_A_G4q_D_vS_j_4A_5_U_gU_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 49}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_d, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_oid}; __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_get_attributes, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_1_E_Q_1AQ_1A_D_vS_j_4A_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 73}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_p_oid, __pyx_mstate->__pyx_n_u_rdesc}; __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_init_types, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_4q_Q_I_AZq_6_E_D_4q_4q_Q_I_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 92}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_init_codecs, __pyx_mstate->__pyx_kp_b_iso88591_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 96}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_attach, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 99}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_detach, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 102}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_mark_closed, __pyx_mstate->__pyx_kp_b_iso88591_A_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 105}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_mark_unprepared, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_0_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 111}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_connection}; __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_set_connection, __pyx_mstate->__pyx_kp_b_iso88591_A_JgT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 120}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_get_server_pid, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 123}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_get_settings, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_get_record_class, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 587}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_is_closed, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 590}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_is_connected, __pyx_mstate->__pyx_kp_b_iso88591_A_t4y_D_Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 593}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_abort, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_Kq_aq_Kq_JfA_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 642}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_con}; __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_request_cancel, __pyx_mstate->__pyx_kp_b_iso88591_A_T_q_nA_d_4wa_q_A_A_1_a_4wc_q_K, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 669}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fut}; __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_on_timeout, __pyx_mstate->__pyx_kp_b_iso88591_A_4xwd_S_S_O7_q_Cq_A_G_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 677}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fut}; __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_on_waiter_completed, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_wa_4wd_T_q_3j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 686}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_create_future_fallback, __pyx_mstate->__pyx_kp_b_iso88591_A_wgQe4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 702}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_timeout}; __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_get_timeout, __pyx_mstate->__pyx_kp_b_iso88591_A_87_4q_A_q_j_q_q_t_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 738}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_is_cancelling, __pyx_mstate->__pyx_kp_b_iso88591_A_we1_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 963}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data}; __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_data_received, __pyx_mstate->__pyx_kp_b_iso88591_A_G_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 967}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_transport, __pyx_mstate->__pyx_n_u_sock, __pyx_mstate->__pyx_n_u_ex}; __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_connection_made, __pyx_mstate->__pyx_kp_b_iso88591_A_M_y_q_E_Q_7_81_hc_q_1F_A_V1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 985}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc}; __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_connection_lost, __pyx_mstate->__pyx_kp_b_iso88591_A_N_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 990}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_pause_writing, __pyx_mstate->__pyx_kp_b_iso88591_A_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 993}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_resume_writing, __pyx_mstate->__pyx_kp_b_iso88591_A_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate}; __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_5T9PPTTiimmww_L_L_P_P_Z_Z_l_l, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1006}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_budget}; __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_Kq_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1010}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_4y_q_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1014}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_et, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_tb}; __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_4y_q_D_Rt1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1018}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_get_remaining_budget, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1021}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_amount}; __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_has_budget_greater_than, __pyx_mstate->__pyx_kp_b_iso88591_A_4y_1_1_4y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1033}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_mapping, __pyx_mstate->__pyx_n_u_elems, __pyx_mstate->__pyx_n_u_rec, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_desc, __pyx_mstate->__pyx_n_u_elem}; __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_create_record, __pyx_mstate->__pyx_kp_b_iso88591_xs_q_A_q_U_A_l_83aq_U_3aq_uAQ_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result}; __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_DataCodecConfig, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_1_7_1_2DNRS_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result}; __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_CoreProtocol, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_xq_7_a_nA_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result}; __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_BaseProtocol, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_xq_7_a_nA_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; bad: Py_DECREF(tuple_dedup_map); return -1; } /* #### Code section: init_globals ### */ static int __Pyx_InitGlobals(void) { /* PythonCompatibility.init */ if (likely(__Pyx_init_co_variables() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CommonTypesMetaclass.init */ if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* Coroutine.init */ if (likely(__pyx_Coroutine_init(__pyx_m) == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* Coro_CheckExact.init */ #if CYTHON_COMPILING_IN_LIMITED_API { PyObject *typesModule=NULL; typesModule = PyImport_ImportModule("types"); if (typesModule) { __pyx_mstate_global->__Pyx_CachedCoroType = PyObject_GetAttrString(typesModule, "CoroutineType"); Py_DECREF(typesModule); } } // error handling follows #endif if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CachedMethodType.init */ #if CYTHON_COMPILING_IN_LIMITED_API { PyObject *typesModule=NULL; typesModule = PyImport_ImportModule("types"); if (typesModule) { __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); } } // error handling follows #endif if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CythonFunctionShared.init */ if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* Generator.init */ if (likely(__pyx_Generator_init(__pyx_m) == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### 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 (used by PyObjectGetAttrStrNoError) */ #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); 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 (used by PyObjectGetAttrStrNoError) */ #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 (used by PyObjectGetAttrStrNoError) */ #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); return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError (used by GetBuiltinName) */ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 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 >= 0x030d0000 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS 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_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, "name '%U' is not defined", name); } return result; } /* PyDictVersioning (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_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_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { if (!PyErr_Occurred()) PyErr_SetNone(PyExc_NameError); return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } PyErr_Clear(); #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return result; } #else result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyObjectCall (used by PyObjectFastCall) */ #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 (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; 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 /* PyObjectCallMethO (used by PyObjectFastCall) */ #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 (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; 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 (used by PyObjectFastCallMethod) */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*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 #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x03090000 #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) #elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { PyTypeObject *tp = Py_TYPE(callable); #if defined(__Pyx_CyFunction_USED) if (__Pyx_CyFunction_CheckExact(callable)) { return __Pyx_CyFunction_func_vectorcall(callable); } #endif if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { return NULL; } assert(PyCallable_Check(callable)); Py_ssize_t offset = tp->tp_vectorcall_offset; assert(offset > 0); vectorcallfunc ptr; memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); return ptr; } #else #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) #endif #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *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 (kwargs == NULL) { #if CYTHON_VECTORCALL #if CYTHON_COMPILING_IN_LIMITED_API return PyObject_Vectorcall(func, args, _nargs, NULL); #else vectorcallfunc f = __Pyx_PyVectorcall_Function(func); if (f) { return f(func, args, _nargs, NULL); } #endif #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_mstate_global->__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 } /* PyObjectFastCallMethod */ #if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) { PyObject *result; PyObject *attr = PyObject_GetAttr(args[0], name); if (unlikely(!attr)) return NULL; result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1); Py_DECREF(attr); return result; } #endif /* TupleAndListFromArray (used by fastcall) */ #if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; Py_ssize_t i; if (n <= 0) { return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; for (i = 0; i < n; i++) { if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) { Py_DECREF(res); return NULL; } Py_INCREF(src[i]); } return res; } #elif 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) { return __Pyx_NewRef(__pyx_mstate_global->__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 (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) 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 (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else 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 (s1_is_unicode & s2_is_unicode) { Py_ssize_t length, length2; int kind; void *data1, *data2; #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(length < 0)) return -1; #endif length2 = __Pyx_PyUnicode_GET_LENGTH(s2); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(length2 < 0)) return -1; #endif if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; 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)); 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_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: return (equals == Py_EQ); return_ne: 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 = __Pyx_PyTuple_GET_SIZE(kwnames); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(n == -1)) return NULL; #endif for (i = 0; i < n; i++) { PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(!namei)) return NULL; #endif if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(!namei)) return NULL; #endif int eq = __Pyx_PyUnicode_Equals(s, namei, 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_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs; PyObject *dict; #if !CYTHON_ASSUME_SAFE_SIZE nkwargs = PyTuple_Size(kwnames); if (unlikely(nkwargs < 0)) return NULL; #else nkwargs = PyTuple_GET_SIZE(kwnames); #endif dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itype, *target->method_name); if (unlikely(!method)) return -1; result = method; #if CYTHON_COMPILING_IN_CPYTHON if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) { 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); result = unbound_method; } } #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING if (unlikely(target->method)) { Py_DECREF(result); } else #endif target->method = result; return 0; } /* CallUnboundCMethod0 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); if (likely(was_initialized == 2 && cfunc->func)) { if (likely(cfunc->flag == METH_NOARGS)) return __Pyx_CallCFunction(cfunc, self, NULL); if (likely(cfunc->flag == METH_FASTCALL)) return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (cfunc->flag == METH_VARARGS) return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); return __Pyx__CallUnboundCMethod0(cfunc, self); } #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING else if (unlikely(was_initialized == 1)) { __Pyx_CachedCFunction tmp_cfunc = { #ifndef __cplusplus 0 #endif }; tmp_cfunc.type = cfunc->type; tmp_cfunc.method_name = cfunc->method_name; return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); } #endif PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); return result; } #endif static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { PyObject *result; if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; result = __Pyx_PyObject_CallOneArg(cfunc->method, self); return result; } /* py_dict_items (used by OwnedDictNext) */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d); } /* py_dict_values (used by OwnedDictNext) */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d); } /* OwnedDictNext (used by RejectKeywords) */ #if CYTHON_AVOID_BORROWED_REFS static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) { PyObject *next = NULL; if (!*ppos) { if (pvalue) { PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p); if (unlikely(!dictview)) goto bad; *ppos = PyObject_GetIter(dictview); Py_DECREF(dictview); } else { *ppos = PyObject_GetIter(p); } if (unlikely(!*ppos)) goto bad; } next = PyIter_Next(*ppos); if (!next) { if (PyErr_Occurred()) goto bad; return 0; } if (pkey && pvalue) { *pkey = __Pyx_PySequence_ITEM(next, 0); if (unlikely(*pkey)) goto bad; *pvalue = __Pyx_PySequence_ITEM(next, 1); if (unlikely(*pvalue)) goto bad; Py_DECREF(next); } else if (pkey) { *pkey = next; } else { assert(pvalue); *pvalue = next; } return 1; bad: Py_XDECREF(next); #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef"); #else PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef); #endif if (pkey) *pkey = NULL; if (pvalue) *pvalue = NULL; return 0; } #else // !CYTHON_AVOID_BORROWED_REFS static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) { int result = PyDict_Next(p, ppos, pkey, pvalue); if (likely(result == 1)) { if (pkey) Py_INCREF(*pkey); if (pvalue) Py_INCREF(*pvalue); } return result; } #endif /* RejectKeywords */ static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) { PyObject *key = NULL; if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) { key = __Pyx_PySequence_ITEM(kwds, 0); } else { #if CYTHON_AVOID_BORROWED_REFS PyObject *pos = NULL; #else Py_ssize_t pos = 0; #endif #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return; #endif __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(pos); #endif } if (likely(key)) { PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); Py_DECREF(key); } } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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 (used by ParseKeywordsImpl) */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, "%s() got multiple values for keyword argument '%U'", func_name, kw_name); } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); if (likely(was_initialized == 2 && cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { return __Pyx_CallCFunctionFast(cfunc, self, args, 2); } if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); } #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING else if (unlikely(was_initialized == 1)) { __Pyx_CachedCFunction tmp_cfunc = { #ifndef __cplusplus 0 #endif }; tmp_cfunc.type = cfunc->type; tmp_cfunc.method_name = cfunc->method_name; return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); } #endif PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); return result; } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ 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)) { PyObject *result = NULL; PyObject *args = PyTuple_New(2); if (unlikely(!args)) return NULL; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); else result = __Pyx_CallCFunction(cfunc, self, args); Py_DECREF(args); return result; } #endif { PyObject *args[4] = {NULL, self, arg1, arg2}; return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } } /* ParseKeywordsImpl (used by ParseKeywords) */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], PyObject ** const *first_kw_arg, const char* function_name) { PyObject ** const *name = argnames; while (name != first_kw_arg) { PyObject *key = **name; int found = PyDict_Contains(kwds, key); if (unlikely(found)) { if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; } name++; } return 0; bad: return -1; } #if CYTHON_USE_UNICODE_INTERNALS static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { int kind; Py_ssize_t len = PyUnicode_GET_LENGTH(s1); if (len != PyUnicode_GET_LENGTH(s2)) return 0; kind = PyUnicode_KIND(s1); if (kind != PyUnicode_KIND(s2)) return 0; const void *data1 = PyUnicode_DATA(s1); const void *data2 = PyUnicode_DATA(s2); return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); } #endif static int __Pyx_MatchKeywordArg_str( PyObject *key, PyObject ** const argnames[], PyObject ** const *first_kw_arg, size_t *index_found, const char *function_name) { PyObject ** const *name; #if CYTHON_USE_UNICODE_INTERNALS Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; if (unlikely(key_hash == -1)) { key_hash = PyObject_Hash(key); if (unlikely(key_hash == -1)) goto bad; } #endif name = first_kw_arg; while (*name) { PyObject *name_str = **name; #if CYTHON_USE_UNICODE_INTERNALS if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { *index_found = (size_t) (name - argnames); return 1; } #else #if CYTHON_ASSUME_SAFE_SIZE if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) #endif { int cmp = PyUnicode_Compare(name_str, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { *index_found = (size_t) (name - argnames); return 1; } } #endif name++; } name = argnames; while (name != first_kw_arg) { PyObject *name_str = **name; #if CYTHON_USE_UNICODE_INTERNALS if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { if (__Pyx_UnicodeKeywordsEqual(name_str, key)) goto arg_passed_twice; } #else #if CYTHON_ASSUME_SAFE_SIZE if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) #endif { if (unlikely(name_str == key)) goto arg_passed_twice; int cmp = PyUnicode_Compare(name_str, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; } #endif name++; } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; bad: return -1; } static int __Pyx_MatchKeywordArg_nostr( PyObject *key, PyObject ** const argnames[], PyObject ** const *first_kw_arg, size_t *index_found, const char *function_name) { PyObject ** const *name; if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; name = first_kw_arg; while (*name) { int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); if (cmp == 1) { *index_found = (size_t) (name - argnames); return 1; } if (unlikely(cmp == -1)) goto bad; name++; } name = argnames; while (name != first_kw_arg) { int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); if (unlikely(cmp != 0)) { if (cmp == 1) goto arg_passed_twice; else goto bad; } name++; } 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; bad: return -1; } static CYTHON_INLINE int __Pyx_MatchKeywordArg( PyObject *key, PyObject ** const argnames[], PyObject ** const *first_kw_arg, size_t *index_found, const char *function_name) { return likely(PyUnicode_CheckExact(key)) ? __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); } static void __Pyx_RejectUnknownKeyword( PyObject *kwds, PyObject ** const argnames[], PyObject ** const *first_kw_arg, const char *function_name) { #if CYTHON_AVOID_BORROWED_REFS PyObject *pos = NULL; #else Py_ssize_t pos = 0; #endif PyObject *key = NULL; __Pyx_BEGIN_CRITICAL_SECTION(kwds); while ( #if CYTHON_AVOID_BORROWED_REFS __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL) #else PyDict_Next(kwds, &pos, &key, NULL) #endif ) { PyObject** const *name = first_kw_arg; while (*name && (**name != key)) name++; if (!*name) { size_t index_found = 0; int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); if (cmp != 1) { if (cmp == 0) { PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(key); #endif break; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(key); #endif } __Pyx_END_CRITICAL_SECTION(); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(pos); #endif assert(PyErr_Occurred()); } static int __Pyx_ParseKeywordDict( PyObject *kwds, PyObject ** const argnames[], PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs) { PyObject** const *name; PyObject** const *first_kw_arg = argnames + num_pos_args; Py_ssize_t extracted = 0; #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; #endif name = first_kw_arg; while (*name && num_kwargs > extracted) { PyObject * key = **name; PyObject *value; int found = 0; #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 found = PyDict_GetItemRef(kwds, key, &value); #else value = PyDict_GetItemWithError(kwds, key); if (value) { Py_INCREF(value); found = 1; } else { if (unlikely(PyErr_Occurred())) goto bad; } #endif if (found) { if (unlikely(found < 0)) goto bad; values[name-argnames] = value; extracted++; } name++; } if (num_kwargs > extracted) { if (ignore_unknown_kwargs) { if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) goto bad; } else { __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); goto bad; } } return 0; bad: return -1; } static int __Pyx_ParseKeywordDictToDict( PyObject *kwds, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject** const *name; PyObject** const *first_kw_arg = argnames + num_pos_args; Py_ssize_t len; #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; #endif if (PyDict_Update(kwds2, kwds) < 0) goto bad; name = first_kw_arg; while (*name) { PyObject *key = **name; PyObject *value; #if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) int found = PyDict_Pop(kwds2, key, &value); if (found) { if (unlikely(found < 0)) goto bad; values[name-argnames] = value; } #elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 int found = PyDict_GetItemRef(kwds2, key, &value); if (found) { if (unlikely(found < 0)) goto bad; values[name-argnames] = value; if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; } #else #if CYTHON_COMPILING_IN_CPYTHON value = _PyDict_Pop(kwds2, key, kwds2); #else value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); #endif if (value == kwds2) { Py_DECREF(value); } else { if (unlikely(!value)) goto bad; values[name-argnames] = value; } #endif name++; } len = PyDict_Size(kwds2); if (len > 0) { return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); } else if (unlikely(len == -1)) { goto bad; } return 0; bad: return -1; } static int __Pyx_ParseKeywordsTuple( PyObject *kwds, PyObject * const *kwvalues, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs) { PyObject *key = NULL; PyObject** const * name; PyObject** const *first_kw_arg = argnames + num_pos_args; for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); #else key = __Pyx_PyTuple_GET_ITEM(kwds, pos); #endif #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(!key)) goto bad; #endif name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { PyObject *value = kwvalues[pos]; values[name-argnames] = __Pyx_NewRef(value); } else { size_t index_found = 0; int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); if (cmp == 1) { PyObject *value = kwvalues[pos]; values[index_found] = __Pyx_NewRef(value); } else { if (unlikely(cmp == -1)) goto bad; if (kwds2) { PyObject *value = kwvalues[pos]; if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else if (!ignore_unknown_kwargs) { goto invalid_keyword; } } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(key); key = NULL; #endif } return 0; invalid_keyword: PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); goto bad; bad: #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(key); #endif return -1; } /* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, PyObject ** const argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, const char* function_name, int ignore_unknown_kwargs) { if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); else if (kwds2) return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); else return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); } /* RaiseException */ 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; } /* DictGetItem */ #if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error 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 value; } #endif /* GetTopmostException (used by SaveResetException) */ #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 >= 0x030C0000 local_value = tstate->current_exception; tstate->current_exception = 0; #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 #elif __PYX_LIMITED_VERSION_HEX > 0x030C0000 local_value = PyErr_GetRaisedException(); #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif #if __PYX_LIMITED_VERSION_HEX > 0x030C0000 if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 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); #elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000 PyErr_SetHandledException(local_value); Py_XDECREF(local_value); Py_XDECREF(local_type); Py_XDECREF(local_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; #if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; #endif } /* 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, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); #if CYTHON_ASSUME_SAFE_SIZE Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) { return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared); } else if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else (void)wraparound; (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); #if CYTHON_ASSUME_SAFE_SIZE && 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)))) { return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i)); } return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else (void)wraparound; (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck, int unsafe_shared) { CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) { return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared); } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { return __Pyx_NewRef(PyList_GET_ITEM(o, n)); } } else #if !CYTHON_AVOID_BORROWED_REFS 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)))) { return __Pyx_NewRef(PyTuple_GET_ITEM(o, n)); } } else #endif #endif #if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (!is_list && mm && mm->mp_subscript) { PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (is_list || 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 (void)wraparound; (void)boundscheck; return __Pyx_GetItemInt_Generic(o, PyLong_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, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(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_mstate_global->__pyx_n_u_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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 /* PyObjectVectorCallKwBuilder */ #if CYTHON_VECTORCALL static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { (void)__Pyx_PyObject_FastCallDict; if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; Py_INCREF(key); args[n] = value; return 0; } CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { (void)__Pyx_VectorcallBuilder_AddArgStr; if (unlikely(!PyUnicode_Check(key))) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); return -1; } return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); } static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { PyObject *pyKey = PyUnicode_FromString(key); if (!pyKey) return -1; return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); } #else // CYTHON_VECTORCALL CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { if (unlikely(!PyUnicode_Check(key))) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); return -1; } return PyDict_SetItem(builder, key, value); } #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_GetFullyQualifiedName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetFullyQualifiedName(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, CYTHON_UNUSED int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #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 = PyLong_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 = PyLong_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_GetFullyQualifiedName(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; } /* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) { return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #if CYTHON_USE_PYLONG_INTERNALS static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; long a; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla; if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } const int is_positive = __Pyx_PyLong_IsPos(op1); const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); if (likely(size == 1)) { a = (long) digits[0]; if (!is_positive) a *= -1; } else { switch (size) { case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; } return PyLong_Type.tp_as_number->nb_add(op1, op2); } calculate_long: { long x; x = a + b; return PyLong_FromLong(x); } calculate_long_long: { PY_LONG_LONG llx; llx = lla + llb; return PyLong_FromLongLong(llx); } } #endif static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) { CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; double a = __Pyx_PyFloat_AS_DOUBLE(float_val); double result; result = ((double)a) + (double)b; return PyFloat_FromDouble(result); } static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(zerodivision_check); #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check); } #endif if (PyFloat_CheckExact(op1)) { return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check); } return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); } #endif /* py_dict_pop_ignore */ static CYTHON_INLINE int __Pyx_PyDict_Pop_ignore(PyObject *d, PyObject *key, PyObject *default_value) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop) int result = PyDict_Pop(d, key, NULL); CYTHON_UNUSED_VAR(default_value); return (unlikely(result == -1)) ? -1 : 0; #else PyObject *value; CYTHON_UNUSED_VAR(default_value); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 value = _PyDict_Pop(d, key, Py_None); #else value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, d, key, Py_None); #endif if (unlikely(value == NULL)) return -1; Py_DECREF(value); return 0; #endif } /* JoinPyUnicode */ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, 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; if (max_char > 1114111) max_char = 1114111; 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); assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) goto overflow; char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; PyObject *uval = values[i]; #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_PyUnicode_READY(uval) == (-1)) goto bad; #endif ulength = __Pyx_PyUnicode_GET_LENGTH(uval); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(ulength < 0)) goto bad; #endif 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 (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 || 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 Py_ssize_t i; PyObject *result = NULL; PyObject *value_tuple = PyTuple_New(value_count); if (unlikely(!value_tuple)) return NULL; CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); for (i=0; i__pyx_empty_unicode, value_tuple); bad: Py_DECREF(value_tuple); return result; #endif } /* ArgTypeTestFunc (used by ArgTypeTest) */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; int from_annotation_subclass = 0; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (!exact) { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } else if (exact == 2) { if (__Pyx_TypeCheck(obj, type)) { from_annotation_subclass = 1; extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; } } type_name = __Pyx_PyType_GetFullyQualifiedName(type); obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")" #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 "%s%U" #endif , name, type_name, obj_type_name #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 , (from_annotation_subclass ? ". " : ""), extra_info #endif ); #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 if (exact == 2 && from_annotation_subclass) { PyObject *res; PyObject *vargs[2]; vargs[0] = PyErr_GetRaisedException(); vargs[1] = extra_info; res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); Py_XDECREF(res); PyErr_SetRaisedException(vargs[0]); } #endif __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; 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; } /* CIntToDigits (used by CIntToPyUnicode) */ 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 (used by COrdinalToPyUnicode) */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const 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; void *udata; uval = PyUnicode_New(ulength, 127); if (unlikely(!uval)) return NULL; udata = PyUnicode_DATA(uval); 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 = PySequence_Repeat(padding, uoffset - prepend_sign); 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 = PyUnicode_Concat(padding, uval); Py_DECREF(uval); uval = tmp; } if (likely(uval) && sign) { PyObject *tmp = PyUnicode_Concat(sign, uval); Py_DECREF(uval); uval = tmp; } done_or_error: Py_XDECREF(padding); Py_XDECREF(sign); } #endif return uval; } /* COrdinalToPyUnicode (used by CIntToPyUnicode) */ static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) { return value <= 1114111; } static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) { Py_ssize_t padding_length = ulength - 1; if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) { char chars[256]; if (value <= 255) { memset(chars, padding_char, (size_t) padding_length); chars[ulength-1] = (char) value; return PyUnicode_DecodeLatin1(chars, ulength, NULL); } char *cpos = chars + sizeof(chars); if (value < 0x800) { *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0xc0 | (value & 0x1f)); } else if (value < 0x10000) { *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0xe0 | (value & 0x0f)); } else { *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0x80 | (value & 0x3f)); value >>= 6; *--cpos = (char) (0xf0 | (value & 0x07)); } cpos -= padding_length; memset(cpos, padding_char, (size_t) padding_length); return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL); } if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) { const char chars[1] = {(char) value}; return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char); } { PyObject *uchar, *padding_uchar, *padding, *result; padding_uchar = PyUnicode_FromOrdinal(padding_char); if (unlikely(!padding_uchar)) return NULL; padding = PySequence_Repeat(padding_uchar, padding_length); Py_DECREF(padding_uchar); if (unlikely(!padding)) return NULL; uchar = PyUnicode_FromOrdinal(value); if (unlikely(!uchar)) { Py_DECREF(padding); return NULL; } result = PyUnicode_Concat(padding, uchar); Py_DECREF(padding); Py_DECREF(uchar); return result; } } /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_uint32_t(uint32_t value, Py_ssize_t width, char padding_char) { #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 (unlikely(!(is_unsigned || value == 0 || value > 0) || !(sizeof(value) <= 2 || value & ~ (uint32_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) { PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)"); return NULL; } if (width <= 1) { return PyUnicode_FromOrdinal((int) value); } return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char); } static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_uint32_t(uint32_t value, Py_ssize_t width, char padding_char, char format_char) { char digits[sizeof(uint32_t)*3+2]; char *dpos, *end = digits + sizeof(uint32_t)*3+2; const char *hex_digits = DIGITS_HEX; Py_ssize_t length, ulength; int prepend_sign, last_one_off; uint32_t remaining; #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 (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 = (uint32_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 = (uint32_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 = (uint32_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); } /* PyObjectCall2Args (used by CallUnboundCMethod1) */ 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); } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); if (likely(was_initialized == 2 && cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return __Pyx_CallCFunction(cfunc, self, arg); } else if (flag == METH_FASTCALL) { return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1); } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL); } } #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING else if (unlikely(was_initialized == 1)) { __Pyx_CachedCFunction tmp_cfunc = { #ifndef __cplusplus 0 #endif }; tmp_cfunc.type = cfunc->type; tmp_cfunc.method_name = cfunc->method_name; return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg); } #endif PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg); __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); return result; } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *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)) { PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); else result = __Pyx_CallCFunction(cfunc, self, args); Py_DECREF(args); } else #endif { result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); } return result; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if !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 (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_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_mstate_global->__pyx_umethod_PyDict_Type_get, d, key); else value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 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 >= 0x030d0000 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyUnicode_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 /* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_Fallback___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, int inplace) { return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #if CYTHON_USE_PYLONG_INTERNALS static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; long a; const PY_LONG_LONG llb = intval; PY_LONG_LONG lla; if (unlikely(__Pyx_PyLong_IsZero(op1))) { return PyLong_FromLong(-intval); } const int is_positive = __Pyx_PyLong_IsPos(op1); const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); if (likely(size == 1)) { a = (long) digits[0]; if (!is_positive) a *= -1; } else { switch (size) { case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) a *= -1; goto calculate_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])); if (!is_positive) lla *= -1; goto calculate_long_long; } break; } return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } calculate_long: { long x; x = a - b; return PyLong_FromLong(x); } calculate_long_long: { PY_LONG_LONG llx; llx = lla - llb; return PyLong_FromLongLong(llx); } } #endif static PyObject* __Pyx_Float___Pyx_PyLong_SubtractObjC(PyObject *float_val, long intval, int zerodivision_check) { CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; double a = __Pyx_PyFloat_AS_DOUBLE(float_val); double result; result = ((double)a) - (double)b; return PyFloat_FromDouble(result); } static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(zerodivision_check); #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { return __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check); } #endif if (PyFloat_CheckExact(op1)) { return __Pyx_Float___Pyx_PyLong_SubtractObjC(op1, intval, zerodivision_check); } return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace); } #endif /* RaiseUnboundLocalError */ static void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_Fallback___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, int inplace) { return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #if CYTHON_USE_PYLONG_INTERNALS static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long a = intval; long b; const PY_LONG_LONG lla = intval; PY_LONG_LONG llb; if (unlikely(__Pyx_PyLong_IsZero(op2))) { return __Pyx_NewRef(op1); } const int is_positive = __Pyx_PyLong_IsPos(op2); const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_DigitCount(op2); if (likely(size == 1)) { b = (long) digits[0]; if (!is_positive) b *= -1; } else { switch (size) { case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); if (!is_positive) b *= -1; goto calculate_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])); if (!is_positive) llb *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) b *= -1; goto calculate_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])); if (!is_positive) llb *= -1; goto calculate_long_long; } break; 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])); if (!is_positive) b *= -1; goto calculate_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])); if (!is_positive) llb *= -1; goto calculate_long_long; } break; } return PyLong_Type.tp_as_number->nb_add(op1, op2); } calculate_long: { long x; x = a + b; return PyLong_FromLong(x); } calculate_long_long: { PY_LONG_LONG llx; llx = lla + llb; return PyLong_FromLongLong(llx); } } #endif static PyObject* __Pyx_Float___Pyx_PyLong_AddCObj(PyObject *float_val, long intval, int zerodivision_check) { CYTHON_UNUSED_VAR(zerodivision_check); const long a = intval; double b = __Pyx_PyFloat_AS_DOUBLE(float_val); double result; result = ((double)a) + (double)b; return PyFloat_FromDouble(result); } static CYTHON_INLINE PyObject* __Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(zerodivision_check); #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { return __Pyx_Unpacked___Pyx_PyLong_AddCObj(op1, op2, intval, inplace, zerodivision_check); } #endif if (PyFloat_CheckExact(op2)) { return __Pyx_Float___Pyx_PyLong_AddCObj(op2, intval, zerodivision_check); } return __Pyx_Fallback___Pyx_PyLong_AddCObj(op1, op2, inplace); } #endif /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char) { #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 (unlikely(!(is_unsigned || value == 0 || value > 0) || !(sizeof(value) <= 2 || value & ~ (long) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) { PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)"); return NULL; } if (width <= 1) { return PyUnicode_FromOrdinal((int) value); } return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char); } static CYTHON_INLINE PyObject* __Pyx____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); } /* PyObjectVectorCallMethodKwBuilder */ #if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) { PyObject *result; PyObject *obj = PyObject_GetAttr(args[0], name); if (unlikely(!obj)) return NULL; result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames); Py_DECREF(obj); return result; } #endif /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS if (likely(PyUnicode_Check(n))) 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) { char* self_ptr; Py_ssize_t self_len; char* sub_ptr; Py_ssize_t sub_len; int retval; #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030b0000 PyObject *converted_arg = NULL; #else Py_buffer view; view.obj = NULL; #endif #if !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE) if (PyBytes_AsStringAndSize(self, &self_ptr, &self_len) == -1) return -1; #else self_ptr = PyBytes_AS_STRING(self); self_len = PyBytes_GET_SIZE(self); #endif if (PyBytes_Check(arg)) { #if !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE) if (PyBytes_AsStringAndSize(arg, &sub_ptr, &sub_len) == -1) return -1; #else sub_ptr = PyBytes_AS_STRING(arg); sub_len = PyBytes_GET_SIZE(arg); #endif } #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030b0000 else if (PyByteArray_Check(arg)) { sub_ptr = PyByteArray_AsString(arg); if (unlikely(!sub_ptr)) return -1; sub_len = PyByteArray_Size(arg); if (unlikely(sub_len < 0)) return -1; } else { PyObject *as_memoryview = PyMemoryView_FromObject(arg); if (!as_memoryview) return -1; Py_DECREF(as_memoryview); converted_arg = PyBytes_FromObject(arg); if (!converted_arg) return -1; if (PyBytes_AsStringAndSize(converted_arg, &sub_ptr, &sub_len) == -1) { Py_DECREF(converted_arg); return -1; } } #else // LIMITED_API >= 030B0000 or !LIMITED_API else { if (unlikely(PyObject_GetBuffer(arg, &view, PyBUF_SIMPLE) == -1)) return -1; sub_ptr = (char*) view.buf; sub_len = view.len; } #endif 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 CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030b0000 Py_XDECREF(converted_arg); #else if (view.obj) PyBuffer_Release(&view); #endif 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 = __Pyx_PyTuple_GET_SIZE(substrings); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(count < 0)) return -1; #endif 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 = __Pyx_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, *new_exc; __Pyx_PyThreadState_declare int is_async_stopiteration = 0; CYTHON_MAYBE_UNUSED_VAR(in_async_gen); __Pyx_PyThreadState_assign cur_exc = __Pyx_PyErr_CurrentExceptionType(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; } else { return; } } __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); Py_XDECREF(tb); new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : "generator raised StopIteration"); if (!new_exc) { Py_XDECREF(val); return; } PyException_SetCause(new_exc, val); // steals ref to val PyErr_SetObject(PyExc_RuntimeError, new_exc); } /* RaiseClosureNameError */ static 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); return PyObject_SetAttr(obj, attr_name, value); } #endif /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_uchar___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) { #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 (unlikely(!(is_unsigned || value == 0 || value > 0) || !(sizeof(value) <= 2 || value & ~ (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) { PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)"); return NULL; } if (width <= 1) { return PyUnicode_FromOrdinal((int) value); } return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char); } static CYTHON_INLINE PyObject* __Pyx____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); } /* HasAttr (used by ImportImpl) */ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!PyUnicode_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (!r) { return (unlikely(PyErr_Occurred())) ? -1 : 0; } else { Py_DECREF(r); return 1; } } #endif /* ImportImpl (used by Import) */ static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) { PyObject *imported_module = PyImport_GetModule(qualname); if (unlikely(!imported_module)) { *module = NULL; if (PyErr_Occurred()) { return -1; } return 0; } *module = imported_module; return 1; } static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) { PyObject *imported_module; PyObject *top_level_package_name; Py_ssize_t i; int status, module_found; Py_ssize_t dot_index; module_found = __Pyx__Import_GetModule(qualname, &imported_module); if (unlikely(!module_found || module_found == -1)) { *module = NULL; return module_found; } if (imported_names) { for (i = 0; i < len_imported_names; i++) { PyObject *imported_name = imported_names[i]; #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name); #else int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name); if (unlikely(has_imported_attribute == -1)) goto error; #endif if (!has_imported_attribute) { goto not_found; } } *module = imported_module; return 1; } dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1); if (dot_index == -1) { *module = imported_module; return 1; } if (unlikely(dot_index == -2)) goto error; top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index); if (unlikely(!top_level_package_name)) goto error; Py_DECREF(imported_module); status = __Pyx__Import_GetModule(top_level_package_name, module); Py_DECREF(top_level_package_name); return status; error: Py_DECREF(imported_module); *module = NULL; return -1; not_found: Py_DECREF(imported_module); *module = NULL; return 0; } static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *from_list = 0; int module_found; if (!qualname) { qualname = name; } module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module); if (likely(module_found == 1)) { return module; } else if (unlikely(module_found == -1)) { return NULL; } empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; if (imported_names) { #if CYTHON_COMPILING_IN_CPYTHON from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names); if (unlikely(!from_list)) goto bad; #else from_list = PyList_New(len_imported_names); if (unlikely(!from_list)) goto bad; for (Py_ssize_t i=0; i__pyx_d, level); } /* decode_c_bytes (used by decode_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_mstate_global->__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); } } /* PyObjectCallNoArg (used by PyObjectCallMethod0) */ 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 (used by PyObjectCallMethod0) */ #if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) 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)) #else #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 #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_GetFullyQualifiedName(tp); PyErr_Format(PyExc_AttributeError, "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); __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; } #endif /* PyObjectCallMethod0 (used by dict_iter) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { #if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[1] = {obj}; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_CallNoArg; return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else 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; #endif } /* RaiseNoneIterError (used by UnpackTupleError) */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError (used by UnpackTuple2) */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else { Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(size < 0)) return; #endif if (size < index) { __Pyx_RaiseNeedMoreValuesError(size); } else { __Pyx_RaiseTooManyValuesError(index); } } } /* UnpackTuple2 (used by dict_iter) */ static CYTHON_INLINE int __Pyx_unpack_tuple2( PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) { if (likely(is_tuple || PyTuple_Check(tuple))) { Py_ssize_t size; if (has_known_size) { return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); } size = __Pyx_PyTuple_GET_SIZE(tuple); if (likely(size == 2)) { return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); } if (size >= 0) { __Pyx_UnpackTupleError(tuple, 2); } return -1; } else { return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple); } } static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS value1 = __Pyx_PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = __Pyx_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_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS 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 #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; #else 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); } #if !CYTHON_AVOID_BORROWED_REFS static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem) { 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); #if CYTHON_ASSUME_SAFE_MACROS PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); #else if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) { Py_DECREF(value); Py_DECREF(tuple); return -1; } if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) { Py_DECREF(tuple); return -1; } #endif *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } #endif 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_AVOID_BORROWED_REFS if (source_is_dict) { int result; #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_BEGIN_CRITICAL_SECTION(iter_obj); #endif result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem); #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_END_CRITICAL_SECTION(); #endif return result; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(tuple_size < 0)) return -1; #endif if (unlikely(pos >= tuple_size)) return 0; *ppos = pos + 1; #if CYTHON_ASSUME_SAFE_MACROS next_item = PyTuple_GET_ITEM(iter_obj, pos); #else next_item = PyTuple_GetItem(iter_obj, pos); if (unlikely(!next_item)) return -1; #endif Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(list_size < 0)) return -1; #endif if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; next_item = __Pyx_PyList_GetItemRef(iter_obj, pos); if (unlikely(!next_item)) return -1; } 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; } /* IterNextPlain (used by IterNext) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) { if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache)) __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; } #endif static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 PyObject *result; PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); if (unlikely(!next)) return NULL; result = PyObject_CallFunctionObjArgs(next, iterator, NULL); return result; #else (void)__Pyx_GetBuiltinName; // only for early limited API iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); assert(iternext); return iternext(iterator); #endif } /* 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_GetFullyQualifiedName(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; #if !CYTHON_COMPILING_IN_LIMITED_API iternextfunc iternext = __Pyx_PyObject_TryGetSlot(iterator, tp_iternext, iternextfunc); if (likely(iternext)) { 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 if (CYTHON_USE_TYPE_SLOTS) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; } else #endif if (unlikely(!PyIter_Check(iterator))) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; } else { next = defval ? PyIter_Next(iterator) : __Pyx_PyIter_Next_Plain(iterator); if (likely(next)) return next; } return __Pyx_PyIter_Next2Default(defval); } /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) { #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 (unlikely(!(is_unsigned || value == 0 || value > 0) || !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) { PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)"); return NULL; } if (width <= 1) { return PyUnicode_FromOrdinal((int) value); } return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char); } static CYTHON_INLINE PyObject* __Pyx____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 static int __Pyx_unicode_modifiable(PyObject *unicode, int unsafe_shared) { if (!__Pyx_IS_UNIQUELY_REFERENCED(unicode, unsafe_shared)) return 0; #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030F0000 if (PyUnstable_Unicode_GET_CACHED_HASH(unicode) != -1) return 0; #endif 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, int unsafe_shared #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, unsafe_shared) && 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 /* 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); } 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); } } 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); for (i=0; i length) stop = length; if (stop <= start) return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_unicode); if (start == 0 && stop == length) return __Pyx_NewRef(text); #if CYTHON_COMPILING_IN_LIMITED_API return PyUnicode_Substring(text, start, stop); #else return PyUnicode_FromKindAndData(PyUnicode_KIND(text), PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start); #endif } /* PyUnicode_Unicode */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) { if (unlikely(obj == Py_None)) obj = __pyx_mstate_global->__pyx_kp_u_None; return __Pyx_NewRef(obj); } /* RaiseKeywordRequired */ static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, "%s() needs keyword-only argument %U", func_name, kw_name); } /* dict_setdefault (used by FetchCommonType) */ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) { PyObject* value; #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 PyObject *args[] = {d, key, default_value}; value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #elif CYTHON_COMPILING_IN_LIMITED_API value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL); #elif PY_VERSION_HEX >= 0x030d0000 PyDict_SetDefaultRef(d, key, default_value, &value); #else value = PyDict_SetDefault(d, key, default_value); if (unlikely(!value)) return NULL; Py_INCREF(value); #endif return value; } /* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static Py_ssize_t __Pyx_GetTypeDictOffset(void) { PyObject *tp_dictoffset_o; Py_ssize_t tp_dictoffset; tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__"); if (unlikely(!tp_dictoffset_o)) return -1; tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o); Py_DECREF(tp_dictoffset_o); if (unlikely(tp_dictoffset == 0)) { PyErr_SetString( PyExc_TypeError, "'type' doesn't have a dictoffset"); return -1; } else if (unlikely(tp_dictoffset < 0)) { PyErr_SetString( PyExc_TypeError, "'type' has an unexpected negative dictoffset. " "Please report this as Cython bug"); return -1; } return tp_dictoffset; } static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { static Py_ssize_t tp_dictoffset = 0; if (unlikely(tp_dictoffset == 0)) { tp_dictoffset = __Pyx_GetTypeDictOffset(); if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) { tp_dictoffset = 0; // try again next time? return NULL; } } return *(PyObject**)((char*)tp + tp_dictoffset); } #endif /* SetItemOnTypeDict (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { int result; PyObject *tp_dict; #if CYTHON_COMPILING_IN_LIMITED_API tp_dict = __Pyx_GetTypeDict(tp); if (unlikely(!tp_dict)) return -1; #else tp_dict = tp->tp_dict; #endif result = PyDict_SetItem(tp_dict, k, v); if (likely(!result)) { PyType_Modified(tp); if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) { PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL); if (!setNameResult) return -1; Py_DECREF(setNameResult); } } return result; } /* FixUpExtensionType (used by FetchCommonType) */ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if __PYX_LIMITED_VERSION_HEX > 0x030900B1 CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #else const PyType_Slot *slot = spec->slots; int changed = 0; #if !CYTHON_COMPILING_IN_LIMITED_API while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { #if !CYTHON_COMPILING_IN_CPYTHON const #endif // !CYTHON_COMPILING_IN_CPYTHON) PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { 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); type->tp_vectorcall_offset = memb->offset; changed = 1; } #endif // CYTHON_METH_FASTCALL #if !CYTHON_COMPILING_IN_PYPY 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; int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); Py_DECREF(descr); if (unlikely(set_item_result < 0)) { return -1; } changed = 1; } #endif // !CYTHON_COMPILING_IN_PYPY } memb++; } } #endif // !CYTHON_COMPILING_IN_LIMITED_API #if !CYTHON_COMPILING_IN_PYPY slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_getset) slot++; if (slot && slot->slot == Py_tp_getset) { PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc; while (getset && getset->name) { if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) { PyObject *descr = PyDescr_NewGetSet(type, getset); if (unlikely(!descr)) return -1; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *pyname = PyUnicode_FromString(getset->name); if (unlikely(!pyname)) { Py_DECREF(descr); return -1; } int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr); Py_DECREF(pyname); #else CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); #endif Py_DECREF(descr); if (unlikely(set_item_result < 0)) { return -1; } changed = 1; } ++getset; } } #else CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #endif // !CYTHON_COMPILING_IN_PYPY if (changed) PyType_Modified(type); #endif // PY_VERSION_HEX > 0x030900B1 return 0; } /* AddModuleRef (used by FetchSharedCythonModule) */ #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) { PyObject *module_dict = PyImport_GetModuleDict(); PyObject *m; if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) { return NULL; } if (m != NULL && PyModule_Check(m)) { return m; } Py_XDECREF(m); m = PyModule_NewObject(name); if (m == NULL) return NULL; if (PyDict_CheckExact(module_dict)) { PyObject *new_m; (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m); Py_DECREF(m); return new_m; } else { if (PyObject_SetItem(module_dict, name, m) != 0) { Py_DECREF(m); return NULL; } return m; } } static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *py_name = PyUnicode_FromString(name); if (!py_name) return NULL; PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name); Py_DECREF(py_name); return module; } #elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif /* FetchSharedCythonModule (used by FetchCommonType) */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } /* FetchCommonType (used by CommonTypesMetaclass) */ #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases); if (result && metaclass) { PyObject *old_tp = (PyObject*)Py_TYPE(result); Py_INCREF((PyObject*)metaclass); #if __PYX_LIMITED_VERSION_HEX >= 0x03090000 Py_SET_TYPE(result, metaclass); #else result->ob_type = metaclass; #endif Py_DECREF(old_tp); } return result; } #else #define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b) #endif static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t expected_basicsize) { Py_ssize_t basicsize; if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (expected_basicsize == 0) { return 0; // size is inherited, nothing useful to check } #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) return -1; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = NULL; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1; #else basicsize = ((PyTypeObject*) cached_type)->tp_basicsize; #endif if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; int get_item_ref_result; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; py_object_name = PyUnicode_FromString(object_name); if (!py_object_name) return NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) goto done; abi_module_dict = PyModule_GetDict(abi_module); if (!abi_module_dict) goto done; get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type); if (get_item_ref_result == 1) { if (__Pyx_VerifyCachedType( cached_type, object_name, spec->basicsize) < 0) { goto bad; } goto done; } else if (unlikely(get_item_ref_result == -1)) { goto bad; } cached_type = __Pyx_PyType_FromMetaclass( metaclass, CYTHON_USE_MODULE_STATE ? module : 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; new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type); if (unlikely(new_cached_type != cached_type)) { if (unlikely(!new_cached_type)) goto bad; Py_DECREF(cached_type); cached_type = new_cached_type; if (__Pyx_VerifyCachedType( cached_type, object_name, spec->basicsize) < 0) { goto bad; } goto done; } else { Py_DECREF(new_cached_type); } done: Py_XDECREF(abi_module); Py_DECREF(py_object_name); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* CommonTypesMetaclass (used by CoroutineBase) */ static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); } #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) { PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types"); return NULL; } static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) { PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable"); return -1; } #endif static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = { {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = { {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset}, #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call}, {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call}, {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr}, #endif {0, 0} }; static PyType_Spec __pyx_CommonTypesMetaclass_spec = { __PYX_TYPE_MODULE_PREFIX "_common_types_metatype", 0, 0, Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT, __pyx_CommonTypesMetaclass_slots }; static int __pyx_CommonTypesMetaclass_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); PyObject *bases = PyTuple_Pack(1, &PyType_Type); if (unlikely(!bases)) { return -1; } mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); Py_DECREF(bases); if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { return -1; } return 0; } /* CallTypeTraverse (used by CoroutineBase) */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 if (__Pyx_get_runtime_version() < 0x03090000) return 0; #endif if (!always_call) { PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); unsigned long flags = PyType_GetFlags(base); if (flags & Py_TPFLAGS_HEAPTYPE) { return 0; } } Py_VISIT((PyObject*)Py_TYPE(o)); return 0; } #endif /* PyObjectCallMethod1 (used by CoroutineBase) */ #if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) 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 >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[2] = {obj, arg}; (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 } /* ReturnWithStopIteration (used by CoroutineBase) */ static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { if (value == Py_None) { if (async || !iternext) PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration); return; } __Pyx__ReturnWithStopIteration(value, async); } static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { #if CYTHON_COMPILING_IN_CPYTHON __Pyx_PyThreadState_declare #endif PyObject *exc; PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration; #if CYTHON_COMPILING_IN_CPYTHON if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { if (PY_VERSION_HEX >= (0x030e00A1)) { exc = __Pyx_PyObject_CallOneArg(exc_type, value); } else { PyObject *args_tuple = PyTuple_New(1); if (unlikely(!args_tuple)) return; Py_INCREF(value); PyTuple_SET_ITEM(args_tuple, 0, value); exc = PyObject_Call(exc_type, args_tuple, NULL); Py_DECREF(args_tuple); } if (unlikely(!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(exc_type); __Pyx_ErrRestore(exc_type, exc, NULL); return; } #endif #else exc = __Pyx_PyObject_CallOneArg(exc_type, value); if (unlikely(!exc)) return; #endif PyErr_SetObject(exc_type, exc); Py_DECREF(exc); } /* CoroutineBase (used by Coroutine) */ #if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #endif // CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void __Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) { #if CYTHON_USE_AM_SEND gen->yieldfrom_am_send = NULL; #endif 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; } else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!value)) goto limited_api_failure; #else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); #endif Py_DECREF(ev); } else if (unlikely(PyTuple_Check(ev))) { Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(tuple_size < 0)) { Py_XDECREF(tb); Py_DECREF(ev); Py_DECREF(et); return -1; } #endif if (tuple_size >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); #elif CYTHON_ASSUME_SAFE_MACROS value = PySequence_ITEM(ev, 0); #else value = PySequence_GetItem(ev, 0); if (!value) goto limited_api_failure; #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 CYTHON_COMPILING_IN_LIMITED_API value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); #else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); #endif Py_DECREF(ev); #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!value)) return -1; #endif *pvalue = value; return 0; #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS limited_api_failure: Py_XDECREF(et); Py_XDECREF(tb); Py_XDECREF(ev); return -1; #endif } static CYTHON_INLINE __Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) { if (*retval) { return PYGEN_NEXT; } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) { return PYGEN_RETURN; } else { return PYGEN_ERROR; } } 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); } 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(PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static __Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(__Pyx_Coroutine_get_is_running(self)); // Callers should ensure is_running if (unlikely(self->resume_label == -1)) { __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); return PYGEN_ERROR; } #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_LIMITED_API || 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 retval = self->body(self, tstate, value); #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 *result = retval; if (self->resume_label == -1) { return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR; } return PYGEN_NEXT; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API 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 } #define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\ ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext)) static PyObject * __Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) { CYTHON_MAYBE_UNUSED_VAR(gen); if (likely(result == PYGEN_RETURN)) { int is_async = 0; #ifdef __Pyx_AsyncGen_USED is_async = __Pyx_AsyncGen_CheckExact(gen); #endif __Pyx_ReturnWithStopIteration(retval, is_async, iternext); Py_XDECREF(retval); } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON 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 __Pyx_PySendResult __Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) { __Pyx_PySendResult result; PyObject *val = NULL; assert(__Pyx_Coroutine_get_is_running(gen)); __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); result = __Pyx_Coroutine_SendEx(gen, val, retval, 0); Py_XDECREF(val); return result; } #if CYTHON_USE_AM_SEND static __Pyx_PySendResult __Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) { PyObject *ret = NULL; __Pyx_PySendResult delegate_result, result; assert(__Pyx_Coroutine_get_is_running(gen)); delegate_result = gen_am_send(gen->yieldfrom, value, &ret); if (delegate_result == PYGEN_NEXT) { assert (ret != NULL); *retval = ret; return PYGEN_NEXT; } assert (delegate_result != PYGEN_ERROR || ret == NULL); __Pyx_Coroutine_Undelegate(gen); result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0); Py_XDECREF(ret); return result; } #endif static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { PyObject *retval = NULL; __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval); return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); } static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) { __Pyx_PySendResult result; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { *retval = __Pyx_Coroutine_AlreadyRunningError(gen); return PYGEN_ERROR; } #if CYTHON_USE_AM_SEND if (gen->yieldfrom_am_send) { result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval); } else #endif if (gen->yieldfrom) { PyObject *yf = gen->yieldfrom; PyObject *ret; #if !CYTHON_USE_AM_SEND #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 if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif #endif { #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000 if (value == Py_None && PyIter_Check(yf)) ret = __Pyx_PyIter_Next_Plain(yf); else #endif ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value); } if (likely(ret)) { __Pyx_Coroutine_unset_is_running(gen); *retval = ret; return PYGEN_NEXT; } result = __Pyx_Coroutine_FinishDelegation(gen, retval); } else { result = __Pyx_Coroutine_SendEx(gen, value, retval, 0); } __Pyx_Coroutine_unset_is_running(gen); return result; } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { __Pyx_PySendResult result; PyObject *retval = NULL; CYTHON_UNUSED_VAR(gen); assert(__Pyx_Coroutine_get_is_running(gen)); #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { result = __Pyx_Coroutine_Close(yf, &retval); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { result = __Pyx_Coroutine_Close(yf, &retval); } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); result = PYGEN_RETURN; } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); result = PYGEN_RETURN; } else #endif { PyObject *meth; result = PYGEN_RETURN; meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); } } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); if (unlikely(!retval)) { result = PYGEN_ERROR; } } } Py_XDECREF(retval); return result == PYGEN_ERROR ? -1 : 0; } static PyObject *__Pyx_Generator_Next(PyObject *self) { __Pyx_PySendResult result; PyObject *retval = NULL; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { return __Pyx_Coroutine_AlreadyRunningError(gen); } #if CYTHON_USE_AM_SEND if (gen->yieldfrom_am_send) { result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval); } else #endif if (gen->yieldfrom) { PyObject *yf = gen->yieldfrom; PyObject *ret; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND) if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); } else #endif ret = __Pyx_PyIter_Next_Plain(yf); if (likely(ret)) { __Pyx_Coroutine_unset_is_running(gen); return ret; } result = __Pyx_Coroutine_FinishDelegation(gen, &retval); } else { result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); } __Pyx_Coroutine_unset_is_running(gen); return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { PyObject *retval = NULL; __Pyx_PySendResult result; CYTHON_UNUSED_VAR(arg); result = __Pyx_Coroutine_Close(self, &retval); if (unlikely(result == PYGEN_ERROR)) return NULL; Py_XDECREF(retval); Py_RETURN_NONE; } static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; __Pyx_PySendResult result; PyObject *yf; int err = 0; if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { *retval = __Pyx_Coroutine_AlreadyRunningError(gen); return PYGEN_ERROR; } yf = gen->yieldfrom; 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); result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1); if (result == PYGEN_ERROR) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_Coroutine_unset_is_running(gen); if (!__Pyx_PyErr_Occurred()) { return PYGEN_RETURN; } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) { __Pyx_PyErr_Clear(); return PYGEN_RETURN; } return PYGEN_ERROR; } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) { __Pyx_Coroutine_unset_is_running(gen); return PYGEN_RETURN; } else { const char *msg; Py_DECREF(*retval); *retval = NULL; 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)) { msg = "async generator ignored GeneratorExit"; #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); __Pyx_Coroutine_unset_is_running(gen); return PYGEN_ERROR; } } 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; if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) return __Pyx_Coroutine_AlreadyRunningError(gen); yf = gen->yieldfrom; if (yf) { __Pyx_PySendResult result; 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) goto propagate_exception; goto throw_here; } 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_mstate_global->__pyx_n_u_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { __Pyx_Coroutine_unset_is_running(gen); return NULL; } __Pyx_Coroutine_Undelegate(gen); 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); } Py_DECREF(yf); if (ret) { __Pyx_Coroutine_unset_is_running(gen); return ret; } result = __Pyx_Coroutine_FinishDelegation(gen, &ret); __Pyx_Coroutine_unset_is_running(gen); return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0); } throw_here: __Pyx_Raise(typ, val, tb, NULL); propagate_exception: { PyObject *retval = NULL; __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0); __Pyx_Coroutine_unset_is_running(gen); return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); } } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; if (unlikely(!PyArg_UnpackTuple(args, "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) { { int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg); if (e) return e; } 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); __Pyx_Coroutine_Undelegate(gen); __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 PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API if (gen->gi_weakreflist != NULL) #endif PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); #if CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else { destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor); if (del) 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); } #if CYTHON_USE_TP_FINALIZE 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; } __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 (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); PyObject_GC_Track(self); } #endif } else { PyObject *retval = NULL; __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval); if (result == PYGEN_ERROR) { PyErr_WriteUnraisable(self); } else { Py_XDECREF(retval); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); } #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 (unlikely(value == NULL || !PyUnicode_Check(value))) { 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 (unlikely(value == NULL || !PyUnicode_Check(value))) { 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) { #if !CYTHON_COMPILING_IN_LIMITED_API PyObject *frame; #if PY_VERSION_HEX >= 0x030d0000 Py_BEGIN_CRITICAL_SECTION(self); #endif frame = self->gi_frame; if (!frame) { if (unlikely(!self->gi_code)) { Py_RETURN_NONE; } PyObject *globals = PyDict_New(); if (unlikely(!globals)) return NULL; frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); Py_DECREF(globals); if (unlikely(!frame)) return NULL; if (unlikely(self->gi_frame)) { Py_DECREF(frame); frame = self->gi_frame; } else { self->gi_frame = frame; } } Py_INCREF(frame); #if PY_VERSION_HEX >= 0x030d0000 Py_END_CRITICAL_SECTION(); #endif return frame; #else CYTHON_UNUSED_VAR(self); Py_RETURN_NONE; #endif } static PyObject * __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { CYTHON_UNUSED_VAR(context); PyObject *frame = self->gi_frame; if (frame) return __Pyx_NewRef(frame); return __Pyx__Coroutine_get_frame(self); } 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; gen->yieldfrom_am_send = NULL; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API 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 #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API gen->gi_weakreflist = NULL; #endif 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; } static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) { char result; #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_BEGIN_CRITICAL_SECTION(gen); #endif result = gen->is_running; gen->is_running = 1; #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_END_CRITICAL_SECTION(); #endif return result; } static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) { #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_BEGIN_CRITICAL_SECTION(gen); #endif assert(gen->is_running); gen->is_running = 0; #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_END_CRITICAL_SECTION(); #endif } static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) { char result; #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_BEGIN_CRITICAL_SECTION(gen); #endif result = gen->is_running; #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_END_CRITICAL_SECTION(); #endif return result; } static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) { CYTHON_UNUSED_VAR(closure); char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen); if (result) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #if __PYX_HAS_PY_AM_SEND == 2 static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) { Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type; if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) { return; } memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async)); static_amsend_methods->am_send = am_send; type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods); } #endif static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) { CYTHON_UNUSED_VAR(arg); __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self)); PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object", self_type_name); __Pyx_DECREF_TypeName(self_type_name); return NULL; } /* Coroutine (used by CoroutineYieldFrom) */ 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) { { int e = __Pyx_call_type_traverse((PyObject*)self, 1, visit, arg); if (e) return e; } 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); } #if __PYX_HAS_PY_AM_SEND static __Pyx_PySendResult __Pyx_CoroutineAwait_AmSend(PyObject *self, PyObject *value, PyObject **retval) { return __Pyx_Coroutine_AmSend(((__pyx_CoroutineAwaitObject*)self)->coroutine, value, retval); } #endif static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args) { return __Pyx_Coroutine_Throw(self->coroutine, args); } static __Pyx_PySendResult __Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self) { PyObject *retval = NULL; __Pyx_PySendResult result = __Pyx_Coroutine_Close(self->coroutine, &retval); Py_XDECREF(retval); return result; } static PyObject *__Pyx_CoroutineAwait_Close_Method(__pyx_CoroutineAwaitObject *self, PyObject *arg) { PyObject *retval = NULL; __Pyx_PySendResult result; CYTHON_UNUSED_VAR(arg); result = __Pyx_Coroutine_Close(self->coroutine, &retval); if (unlikely(result == PYGEN_ERROR)) return NULL; Py_XDECREF(retval); Py_RETURN_NONE; } 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 PyMethodDef __pyx_CoroutineAwait_methods[] = { {"send", (PyCFunction) __Pyx_CoroutineAwait_Send, METH_O, PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_CoroutineAwait_Throw, METH_VARARGS, PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_CoroutineAwait_Close_Method, METH_NOARGS, PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")}, {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0}, {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0}, {0, 0, 0, 0} }; 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}, #if __PYX_HAS_PY_AM_SEND == 1 {Py_am_send, (void *)__Pyx_CoroutineAwait_AmSend}, #endif {0, 0}, }; static PyType_Spec __pyx_CoroutineAwaitType_spec = { __PYX_TYPE_MODULE_PREFIX "coroutine_wrapper", sizeof(__pyx_CoroutineAwaitObject), 0, Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND, __pyx_CoroutineAwaitType_slots }; #if __PYX_HAS_PY_AM_SEND == 2 // backport static __Pyx_PyAsyncMethodsStruct __pyx_CoroutineAwait_as_async; #endif static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) { __pyx_CoroutineAwaitObject *await = PyObject_GC_New(__pyx_CoroutineAwaitObject, __pyx_mstate_global->__pyx_CoroutineAwaitType); if (unlikely(!await)) return NULL; Py_INCREF(coroutine); await->coroutine = coroutine; PyObject_GC_Track(await); return (PyObject*)await; } 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); } static PyMethodDef __pyx_Coroutine_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next iterated value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, 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, PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")}, {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0}, {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Coroutine_memberlist[] = { {"cr_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, PyDoc_STR("object being awaited, or None")}, {"cr_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Coroutine_getsets[] = { {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, PyDoc_STR("name of the coroutine"), 0}, {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, PyDoc_STR("qualified name of the coroutine"), 0}, {"cr_frame", (getter)__Pyx_Coroutine_get_frame, NULL, PyDoc_STR("Frame of the coroutine"), 0}, {"cr_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; 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 *) PyObject_GenericGetAttr}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, #endif #if __PYX_HAS_PY_AM_SEND == 1 {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, #endif {0, 0}, }; static PyType_Spec __pyx_CoroutineType_spec = { __PYX_TYPE_MODULE_PREFIX "coroutine", sizeof(__pyx_CoroutineObject), 0, #if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_TPFLAGS_MANAGED_WEAKREF | #endif Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND, __pyx_CoroutineType_slots }; #if __PYX_HAS_PY_AM_SEND == 2 static __Pyx_PyAsyncMethodsStruct __pyx_Coroutine_as_async; #endif static int __pyx_Coroutine_init(PyObject *module) { __pyx_mstatetype *mstate; CYTHON_MAYBE_UNUSED_VAR(module); mstate = __Pyx_PyModule_GetState(module); mstate->__pyx_CoroutineType = __Pyx_FetchCommonTypeFromSpec( mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CoroutineType_spec, NULL); if (unlikely(!mstate->__pyx_CoroutineType)) return -1; #if __PYX_HAS_PY_AM_SEND == 2 __Pyx_SetBackportTypeAmSend(mstate->__pyx_CoroutineType, &__pyx_Coroutine_as_async, &__Pyx_Coroutine_AmSend); #endif #ifdef __Pyx_IterableCoroutine_USED if (unlikely(__pyx_IterableCoroutine_init(module) == -1)) return -1; #endif mstate->__pyx_CoroutineAwaitType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CoroutineAwaitType_spec, NULL); if (unlikely(!mstate->__pyx_CoroutineAwaitType)) return -1; #if __PYX_HAS_PY_AM_SEND == 2 __Pyx_SetBackportTypeAmSend(mstate->__pyx_CoroutineAwaitType, &__pyx_CoroutineAwait_as_async, &__Pyx_CoroutineAwait_AmSend); #endif return 0; } /* CoroutineSetYieldFrom (used by CoroutineYieldFrom) */ static void __Pyx_Coroutine_Set_Owned_Yield_From(__pyx_CoroutineObject *gen, PyObject *yf) { assert (!gen->yieldfrom); #if CYTHON_USE_AM_SEND assert (!gen->yieldfrom_am_send); #if PY_VERSION_HEX < 0x030A00F0 if (__Pyx_PyType_HasFeature(Py_TYPE(yf), __Pyx_TPFLAGS_HAVE_AM_SEND)) #endif { __Pyx_pyiter_sendfunc am_send; #if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 am_send = __Pyx_PyObject_TryGetSubSlot(yf, tp_as_async, am_send, __Pyx_pyiter_sendfunc); #else __Pyx_PyAsyncMethodsStruct* tp_as_async = (__Pyx_PyAsyncMethodsStruct*) Py_TYPE(yf)->tp_as_async; am_send = tp_as_async ? tp_as_async->am_send : NULL; #endif if (likely(am_send)) { gen->yieldfrom_am_send = am_send; } } #endif gen->yieldfrom = yf; } /* Coro_CheckExact (used by GetAwaitIter) */ #if CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_PyCoro_CheckExact(PyObject *o) { return (PyObject*)Py_TYPE(o) == __pyx_mstate_global->__Pyx_CachedCoroType; } #endif /* GetAwaitIter (used by CoroutineYieldFrom) */ 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 < 0x030d0000 || defined(_PyErr_FormatFromCause)) && !CYTHON_COMPILING_IN_LIMITED_API __Pyx_TypeName source_type_name = __Pyx_PyType_GetFullyQualifiedName(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); #else PyObject *exc, *val, *val2, *tb; __Pyx_TypeName source_type_name = __Pyx_PyType_GetFullyQualifiedName(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); #endif } static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) { PyObject *res; unaryfunc am_await; am_await = __Pyx_PyObject_TryGetSubSlot(obj, tp_as_async, am_await, unaryfunc); if (likely(am_await)) { res = (*am_await)(obj); } else #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 { #if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[] = { obj }; res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_await, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); if (unlikely(!res)) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); int has_attr = PyObject_HasAttr(obj, __pyx_mstate_global->__pyx_n_u_await); PyErr_Restore(type, value, traceback); if (!has_attr) goto slot_error; } } #else PyObject *method = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, __pyx_mstate_global->__pyx_n_u_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); #endif } if (unlikely(!res)) { __Pyx_Coroutine_AwaitableIterError(obj); goto bad; } if (unlikely(!PyIter_Check(res))) { __Pyx_TypeName res_type_name = __Pyx_PyType_GetFullyQualifiedName(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 is_coroutine |= __Pyx_PyCoro_CheckExact(res); 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_GetFullyQualifiedName(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 __Pyx_PySendResult __Pyx_Coroutine_Yield_From_Coroutine(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval) { __Pyx_PySendResult result; if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) { PyErr_SetString( PyExc_RuntimeError, "coroutine is being awaited already"); return PYGEN_ERROR; } result = __Pyx_Coroutine_AmSend(source, Py_None, retval); if (result == PYGEN_NEXT) { Py_INCREF(source); __Pyx_Coroutine_Set_Owned_Yield_From(gen, source); } return result; } static __Pyx_PySendResult __Pyx_Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval) { __Pyx_PySendResult result; PyObject *source_gen = NULL; source_gen = __Pyx_Coroutine_GetAwaitableIter(source); if (unlikely(!source_gen)) return PYGEN_ERROR; if (__Pyx_Coroutine_Check(source_gen)) { result = __Pyx_Coroutine_Yield_From_Coroutine(gen, source_gen, retval); Py_DECREF(source_gen); return result; } *retval = __Pyx_PyIter_Next_Plain(source_gen); if (*retval) { __Pyx_Coroutine_Set_Owned_Yield_From(gen, source_gen); return PYGEN_NEXT; } result = __Pyx_Coroutine_status_from_result(retval); Py_XDECREF(source_gen); return result; } static CYTHON_INLINE __Pyx_PySendResult __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval) { if (__Pyx_Coroutine_Check(source)) { return __Pyx_Coroutine_Yield_From_Coroutine(gen, source, retval); } #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(source)) { *retval = __Pyx_async_gen_asend_iternext(source); if (*retval) { Py_INCREF(source); __Pyx_Coroutine_Set_Owned_Yield_From(gen, source); return PYGEN_NEXT; } return __Pyx_Coroutine_status_from_result(retval); } #endif return __Pyx_Coroutine_Yield_From_Generic(gen, source, retval); } /* pybuiltin_invalid (used by pyint_simplify) */ static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *type_name, const char *argname) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); if (argname) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got " __Pyx_FMT_TYPENAME ")", argname, type_name, obj_type_name ); } else { PyErr_Format(PyExc_TypeError, "Expected %.200s, got " __Pyx_FMT_TYPENAME, type_name, obj_type_name ); } __Pyx_DECREF_TypeName(obj_type_name); } /* pyint_simplify */ static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none) { PyObject *number = *number_var; if (likely((accept_none && number == Py_None) || PyLong_CheckExact(number))) { return 0; } PyObject *int_object; if (likely(PyNumber_Check(number))) { int_object = PyNumber_Long(number); if (unlikely(!int_object)) goto bad; } else { __Pyx_PyBuiltin_Invalid(number, "int", argname); goto bad; } *number_var = int_object; Py_DECREF(number); return 0; bad: *number_var = NULL; Py_DECREF(number); return -1; } /* 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); 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 /* PyMethodNew (used by CythonFunctionShared) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *result; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 { PyObject *args[] = {func, self}; result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); } #else result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); #endif return result; } #else 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); } #endif /* PyVectorcallFastCallDict (used by CythonFunctionShared) */ #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL 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; #if CYTHON_AVOID_BORROWED_REFS PyObject *pos; #else Py_ssize_t pos; #endif size_t j; PyObject *key, *value; unsigned long keys_are_strings; #if !CYTHON_ASSUME_SAFE_SIZE Py_ssize_t nkw = PyDict_Size(kw); if (unlikely(nkw == -1)) return NULL; #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); #endif 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 = 0; i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) { keys_are_strings &= #if CYTHON_COMPILING_IN_LIMITED_API PyType_GetFlags(Py_TYPE(key)); #else Py_TYPE(key)->tp_flags; #endif #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; #else PyTuple_SET_ITEM(kwnames, i, key); #endif 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: #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(pos); #endif 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) { Py_ssize_t kw_size = likely(kw == NULL) ? 0 : #if !CYTHON_ASSUME_SAFE_SIZE PyDict_Size(kw); #else PyDict_GET_SIZE(kw); #endif if (kw_size == 0) { return vc(func, args, nargs, NULL); } #if !CYTHON_ASSUME_SAFE_SIZE else if (unlikely(kw_size == -1)) { return NULL; } #endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared (used by CythonFunction) */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { 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; } static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { int result; PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); if (unlikely(!newFunc)) { PyErr_Clear(); // It's only an optimization, so don't throw an error return 0; } result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); Py_DECREF(newFunc); return result; } return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { if (PyMethod_Check(func)) { func = PyMethod_GET_FUNCTION(func); } 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_locked(__pyx_CyFunctionObject *op) { 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) { op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); 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 PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { PyObject *result; CYTHON_UNUSED_VAR(closure); __Pyx_BEGIN_CRITICAL_SECTION(op); result = __Pyx_CyFunction_get_doc_locked(op); __Pyx_END_CRITICAL_SECTION(); return result; } 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_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_doc, value); __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #else op->func_name = PyUnicode_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 PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { PyObject *result = NULL; CYTHON_UNUSED_VAR(context); __Pyx_BEGIN_CRITICAL_SECTION(op); result = __Pyx_CyFunction_get_name_locked(op); __Pyx_END_CRITICAL_SECTION(); return result; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_name, value); __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); PyObject *result; __Pyx_BEGIN_CRITICAL_SECTION(op); Py_INCREF(op->func_qualname); result = op->func_qualname; __Pyx_END_CRITICAL_SECTION(); return result; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_qualname, value); __Pyx_END_CRITICAL_SECTION(); return 0; } #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 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; } #endif 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_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; 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 PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = NULL; CYTHON_UNUSED_VAR(context); __Pyx_BEGIN_CRITICAL_SECTION(op); result = __Pyx_CyFunction_get_defaults_locked(op); __Pyx_END_CRITICAL_SECTION(); 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_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; 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 PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result; CYTHON_UNUSED_VAR(context); __Pyx_BEGIN_CRITICAL_SECTION(op); result = __Pyx_CyFunction_get_kwdefaults_locked(op); __Pyx_END_CRITICAL_SECTION(); 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_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); __Pyx_END_CRITICAL_SECTION(); return 0; } static PyObject * __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; 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_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject *result; CYTHON_UNUSED_VAR(context); __Pyx_BEGIN_CRITICAL_SECTION(op); result = __Pyx_CyFunction_get_annotations_locked(op); __Pyx_END_CRITICAL_SECTION(); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; if (is_coroutine) { PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(is_coroutine_value)) { return is_coroutine_value; } ignore: PyErr_Clear(); } return __Pyx_PyBool_FromLong(is_coroutine); } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { PyObject *result; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } result = __Pyx_CyFunction_get_is_coroutine_value(op); if (unlikely(!result)) return NULL; __Pyx_BEGIN_CRITICAL_SECTION(op); if (op->func_is_coroutine) { Py_DECREF(result); result = __Pyx_NewRef(op->func_is_coroutine); } else { op->func_is_coroutine = __Pyx_NewRef(result); } __Pyx_END_CRITICAL_SECTION(); return result; } static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); if (!py_name) return; PyErr_Format(PyExc_TypeError, "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, message, size); Py_DECREF(py_name); #else const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; PyErr_Format(PyExc_TypeError, "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", name, message, size); #endif } static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); if (!py_name) return; PyErr_Format(PyExc_TypeError, "%.200S() %s", py_name, message); Py_DECREF(py_name); #else const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; PyErr_Format(PyExc_TypeError, "%.200s() %s", name, message); #endif } #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[] = { {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, #else {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, #endif {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {"_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 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #endif #if CYTHON_METH_FASTCALL #if CYTHON_COMPILING_IN_LIMITED_API {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #if CYTHON_COMPILING_IN_LIMITED_API {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {"__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) { PyObject *result = NULL; CYTHON_UNUSED_VAR(args); __Pyx_BEGIN_CRITICAL_SECTION(m); Py_INCREF(m->func_qualname); result = m->func_qualname; __Pyx_END_CRITICAL_SECTION(); return result; } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if 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 #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API op->func_dict = NULL; #endif 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 = 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 #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func_dict); #elif PY_VERSION_HEX < 0x030d0000 _PyObject_ClearManagedDict((PyObject*)m); #else PyObject_ClearManagedDict((PyObject*)m); #endif 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); Py_CLEAR(m->defaults); 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) { { int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); if (e) return e; } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func_dict); #else { int e = #if PY_VERSION_HEX < 0x030d0000 _PyObject_VisitManagedDict #else PyObject_VisitManagedDict #endif ((PyObject*)m, visit, arg); if (e != 0) return e; } #endif __Pyx_VISIT_CONST(m->func_name); __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); __Pyx_VISIT_CONST(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); Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { PyObject *repr; __Pyx_BEGIN_CRITICAL_SECTION(op); repr = PyUnicode_FromFormat("", op->func_qualname, (void *)op); __Pyx_END_CRITICAL_SECTION(); return repr; } 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; 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(*)(void))meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_SIZE 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); __Pyx_CyFunction_raise_argument_count_error( (__pyx_CyFunctionObject*)func, "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_SIZE 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; } __Pyx_CyFunction_raise_argument_count_error( (__pyx_CyFunctionObject*)func, "takes exactly one argument", size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } __Pyx_CyFunction_raise_type_error( (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); 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 && CYTHON_VECTORCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE 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_SIZE 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); PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); 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 && CYTHON_VECTORCALL 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)) { __Pyx_CyFunction_raise_type_error( cyfunc, "needs an argument"); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { __Pyx_CyFunction_raise_type_error( cyfunc, "takes no keyword arguments"); 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; Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); if (unlikely(!meth)) return NULL; #else PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; #endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)cyfunc)->m_self; #endif break; default: return NULL; } if (unlikely(nargs != 0)) { __Pyx_CyFunction_raise_argument_count_error( cyfunc, "takes no arguments", nargs); return NULL; } return 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; Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); if (unlikely(!meth)) return NULL; #else PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; #endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)cyfunc)->m_self; #endif break; default: return NULL; } if (unlikely(nargs != 1)) { __Pyx_CyFunction_raise_argument_count_error( cyfunc, "takes exactly one argument", nargs); return NULL; } return 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; Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); if (unlikely(!meth)) return NULL; #else PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; #endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)cyfunc)->m_self; #endif break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))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; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); if (unlikely(!meth)) return NULL; #else PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; #endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)cyfunc)->m_self; #endif break; default: return NULL; } #if PY_VERSION_HEX < 0x030e00A6 size_t nargs_value = (size_t) nargs; #else Py_ssize_t nargs_value = nargs; #endif return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames); } #endif 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 CYTHON_METH_FASTCALL #if defined(Py_TPFLAGS_HAVE_VECTORCALL) Py_TPFLAGS_HAVE_VECTORCALL | #elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif #endif // CYTHON_METH_FASTCALL #if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_TPFLAGS_MANAGED_DICT | #endif Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; static int __pyx_CyFunction_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec( mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL); if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) return NULL; 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_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* AsyncIter */ static PyObject *__Pyx_Coroutine_GetAsyncIter_Fail(PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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 { unaryfunc am_aiter = __Pyx_PyObject_TryGetSubSlot(obj, tp_as_async, am_aiter, unaryfunc); if (likely(am_aiter)) { return (*am_aiter)(obj); } } return __Pyx_Coroutine_GetAsyncIter_Fail(obj); } static PyObject *__Pyx_Coroutine_AsyncIterNext_Fail(PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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 { unaryfunc am_anext = __Pyx_PyObject_TryGetSubSlot(obj, tp_as_async, am_anext, unaryfunc); if (likely(am_anext)) { return (*am_anext)(obj); } } return __Pyx_Coroutine_AsyncIterNext_Fail(obj); } /* pybytes_as_double (used by pynumber_float) */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj) { PyObject *float_value = PyFloat_FromString(obj); if (likely(float_value)) { double value = __Pyx_PyFloat_AS_DOUBLE(float_value); 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; int parse_error_found = 0; 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 != '_'); parse_error_found |= last_was_punctuation & is_punctuation; last_was_punctuation = is_punctuation; } parse_error_found |= last_was_punctuation; *buffer = '\0'; return unlikely(parse_error_found) ? NULL : buffer; } 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); } /* AllocateExtensionType */ static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) { if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc); return alloc_func(t, 0); } else { newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc); #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 if (!tp_new) { PyObject *new_str = PyUnicode_FromString("__new__"); if (likely(new_str)) { PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL); Py_DECREF(new_str); return o; } else return NULL; } else #endif return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0); } } /* 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 (used by PyType_Ready) */ #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_SIZE n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (unlikely(n < 0)) return -1; #endif for (i = 1; i < n; i++) { PyTypeObject *b; #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 b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(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 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_GetFullyQualifiedName(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 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 */ CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) { while (t) { PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases) { return 1; } t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*); } return 0; } static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || 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; if (!__Pyx_PyType_HasMultipleInheritance(t)) { return PyType_Ready(t); } 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 !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 (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ !CYTHON_COMPILING_IN_GRAAL gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__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_mstate_global->__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 !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_mstate_global->__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_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable (used by MergeVTables) */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_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 */ static int __Pyx_MergeVtables(PyTypeObject *type) { int i=0; Py_ssize_t size; void** base_vtables; __Pyx_TypeName tp_base_name = NULL; __Pyx_TypeName base_name = NULL; void* unknown = (void*)-1; PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*); int base_depth = 0; { PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); while (base) { base_depth += 1; base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*); } } base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; #if CYTHON_COMPILING_IN_LIMITED_API size = PyTuple_Size(bases); if (size < 0) goto other_failure; #else size = PyTuple_GET_SIZE(bases); #endif for (i = 1; i < size; i++) { PyObject *basei; void* base_vtable; #if CYTHON_AVOID_BORROWED_REFS basei = PySequence_GetItem(bases, i); if (unlikely(!basei)) goto other_failure; #elif !CYTHON_ASSUME_SAFE_MACROS basei = PyTuple_GetItem(bases, i); if (unlikely(!basei)) goto other_failure; #else basei = PyTuple_GET_ITEM(bases, i); #endif base_vtable = __Pyx_GetVtable((PyTypeObject*)basei); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(basei); #endif if (base_vtable != NULL) { int j; PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); 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 = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*); } } } PyErr_Clear(); PyMem_Free(base_vtables); return 0; bad: { PyTypeObject* basei = NULL; PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base); #if CYTHON_AVOID_BORROWED_REFS basei = (PyTypeObject*)PySequence_GetItem(bases, i); if (unlikely(!basei)) goto really_bad; #elif !CYTHON_ASSUME_SAFE_MACROS basei = (PyTypeObject*)PyTuple_GetItem(bases, i); if (unlikely(!basei)) goto really_bad; #else basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i); #endif base_name = __Pyx_PyType_GetFullyQualifiedName(basei); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(basei); #endif } PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); #if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS really_bad: // bad has failed! #endif __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS other_failure: #endif PyMem_Free(base_vtables); return -1; } /* DelItemOnTypeDict (used by SetupReduce) */ static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) { int result; PyObject *tp_dict; #if CYTHON_COMPILING_IN_LIMITED_API tp_dict = __Pyx_GetTypeDict(tp); if (unlikely(!tp_dict)) return -1; #else tp_dict = tp->tp_dict; #endif result = PyDict_DelItem(tp_dict, k); if (likely(!result)) PyType_Modified(tp); return result; } /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (likely(reduce_cython)) { ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (likely(setstate_cython)) { ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_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_GetFullyQualifiedName((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; } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_2_1 #define __PYX_HAVE_RT_ImportType_3_2_1 static PyTypeObject *__Pyx_ImportType_3_2_1(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_1 check_size) { PyObject *result = 0; Py_ssize_t basicsize; Py_ssize_t itemsize; #if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && 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 !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) ) basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else if (size == 0) { return (PyTypeObject *)result; } 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_2_1 && ((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_2_1 && (size_t)basicsize > size) { if (PyErr_WarnFormat(NULL, 0, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize) < 0) { goto bad; } } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* PxdImportShared (used by FunctionImport) */ #ifndef __PYX_HAVE_RT_ImportFromPxd_3_2_1 #define __PYX_HAVE_RT_ImportFromPxd_3_2_1 static int __Pyx_ImportFromPxd_3_2_1(PyObject *module, const char *name, void **p, const char *sig, const char *what) { PyObject *d = 0; PyObject *cobj = 0; d = PyObject_GetAttrString(module, "__pyx_capi__"); if (!d) goto bad; #if (defined(Py_LIMITED_API) && Py_LIMITED_API >= 0x030d0000) || (!defined(Py_LIMITED_API) && PY_VERSION_HEX >= 0x030d0000) PyDict_GetItemStringRef(d, name, &cobj); #else cobj = PyDict_GetItemString(d, name); Py_XINCREF(cobj); #endif if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C %.8s %.200s", PyModule_GetName(module), what, name); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C %.8s %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", what, PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); goto bad; } *p = PyCapsule_GetPointer(cobj, sig); if (!(*p)) goto bad; Py_DECREF(d); Py_DECREF(cobj); return 0; bad: Py_XDECREF(d); Py_XDECREF(cobj); return -1; } #endif /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_2_1 #define __PYX_HAVE_RT_ImportFunction_3_2_1 static int __Pyx_ImportFunction_3_2_1(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { union { void (*fp)(void); void *p; } tmp; int result = __Pyx_ImportFromPxd_3_2_1(module, funcname, &tmp.p, sig, "function"); if (result == 0) { *f = tmp.fp; } return result; } #endif /* 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_mstate_global->__pyx_kp_u__16); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ CYTHON_COMPILING_IN_GRAAL { 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, "cannot import name %S", name); } return value; } /* ListPack */ static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { va_list va; PyObject *l = PyList_New(n); va_start(va, n); if (unlikely(!l)) goto end; for (Py_ssize_t i=0; i__pyx_n_u_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_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } 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_mstate_global->__pyx_n_u_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, mkw); Py_XDECREF(owned_metaclass); return result; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL; #if CYTHON_ASSUME_SAFE_SIZE size_bases = PyTuple_GET_SIZE(bases); #else size_bases = PyTuple_Size(bases); if (size_bases < 0) return NULL; #endif for (i = 0; i < size_bases; i++) { #if CYTHON_AVOID_BORROWED_REFS Py_CLEAR(base); #endif #if CYTHON_ASSUME_SAFE_MACROS base = PyTuple_GET_ITEM(bases, i); #else base = PyTuple_GetItem(bases, i); if (!base) goto error; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(base); #endif if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_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++) { PyObject *base_from_list; #if CYTHON_ASSUME_SAFE_MACROS base_from_list = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base_from_list); Py_INCREF(base_from_list); #else base_from_list = PyTuple_GetItem(bases, j); if (!base_from_list) goto error; Py_INCREF(base_from_list); if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error; #endif } } #if CYTHON_ASSUME_SAFE_SIZE j = PyList_GET_SIZE(new_bases); #else j = PyList_Size(new_bases); if (j < 0) goto error; #endif 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); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(base); #endif return result; error: Py_XDECREF(new_bases); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(base); #endif return NULL; } /* CLineInTraceback (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 #define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o)) #elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL); #else PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) { PyObject **dict_ptr = _PyObject_GetDictPtr(o); return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL; } #endif static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline = NULL; PyObject *ptype, *pvalue, *ptraceback; PyObject *cython_runtime_dict; CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, cython_runtime_dict, __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False)) } if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } Py_XDECREF(use_cline); Py_XDECREF(cython_runtime_dict); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache (used by AddTraceback) */ 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 __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { __Pyx_CachedCodeObjectType* code_object; int pos; if (unlikely(!code_line) || unlikely(!code_cache->entries)) { return NULL; } pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { return NULL; } code_object = code_cache->entries[pos].code_object; Py_INCREF(code_object); return code_object; } static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS (void)__pyx__find_code_object; return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. #else struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); if (old_count < 0) { __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); return NULL; } #endif __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); #endif return result; #endif } static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { code_cache->entries = entries; code_cache->max_count = 64; 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(code_cache->entries, code_cache->count, code_line); if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_INCREF(code_object); Py_DECREF(tmp); return; } if (code_cache->count == code_cache->max_count) { int new_max = code_cache->max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } code_cache->entries = entries; code_cache->max_count = new_max; } for (i=code_cache->count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; code_cache->count++; Py_INCREF(code_object); } static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS (void)__pyx__insert_code_object; return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. #else struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING __pyx_nonatomic_int_type expected = 0; if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { return; } #endif __pyx__insert_code_object(code_cache, code_line, code_object); #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); #endif #endif } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #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 = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); return NULL; } 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) { c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = __pyx_find_code_object(c_line ? -c_line : py_line); if (!code_object) { 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; if (c_line) { py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); } else { 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; __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); } else { dict = PyDict_New(); } 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 (c_line) { 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; } py_code = PyCode_NewEmpty(filename, funcname, py_line); Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); 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_mstate_global->__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 /* CheckUnpickleChecksum */ static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) { PyObject *pickle_module = PyImport_ImportModule("pickle"); if (unlikely(!pickle_module)) return; PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError"); Py_DECREF(pickle_module); if (unlikely(!pickle_error)) return; if (checksum2 == checksum1) { PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))", checksum, checksum1, members); } else if (checksum3 == checksum2) { PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))", checksum, checksum1, checksum2, members); } else { PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))", checksum, checksum1, checksum2, checksum3, members); } Py_DECREF(pickle_error); } static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) { int found = 0; found |= checksum1 == checksum; found |= checksum2 == checksum; found |= checksum3 == checksum; if (likely(found)) return 0; __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members); return -1; } /* 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 void __Pyx_PyUnicode_AsPy_UCS4_error(Py_ssize_t length) { if (likely(length >= 0)) { PyErr_Format(PyExc_ValueError, "only single character unicode strings can be converted to Py_UCS4, " "got length %" CYTHON_FORMAT_SSIZE_T "d", length); } } static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length = __Pyx_PyUnicode_GET_LENGTH(x); if (unlikely(length != 1)) { __Pyx_PyUnicode_AsPy_UCS4_error(length); return (Py_UCS4)-1; } return __Pyx_PyUnicode_READ_CHAR(x, 0); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int32_t __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) { int32_t val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int32_t) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); 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_PyLong_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 (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1; val = __Pyx_PyLong_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)) } 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)) } } 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)) } 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)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); 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_PyLong_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 (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1; val = __Pyx_PyLong_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)) } 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)) } } 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)) } 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)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); 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_PyLong_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 (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1; val = __Pyx_PyLong_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)) } 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)) } } 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)) } 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)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); 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_PyLong_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 (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1; val = __Pyx_PyLong_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)) } 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)) } } 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)) } 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)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint64_t __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) { uint64_t val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (uint64_t) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(uint64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 (unlikely(!PyLong_Check(x))) { uint32_t val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1; val = __Pyx_PyLong_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)) } 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)) } } 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)) } 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)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); 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_PyLong_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 (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1; val = __Pyx_PyLong_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)) } 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)) } } 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)) } 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)) } } { 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_PyLong_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 (unlikely(!PyLong_Check(x))) { int64_t val; PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyLong_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)) } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } 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)) } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { 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_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(ptrdiff_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #if !CYTHON_COMPILING_IN_PYPY } 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 PyLong_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { 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, *kwds = NULL; PyObject *py_bytes = 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; { PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; if (!is_unsigned) { kwds = __Pyx_MakeVectorcallBuilderKwds(1); if (!kwds) goto limited_bad; if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; } result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } limited_bad: Py_XDECREF(kwds); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* ObjectAsUCS4 */ static void __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"); } } static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject* x) { long ival; ival = __Pyx_PyLong_As_long(x); if (unlikely(!__Pyx_is_valid_index(ival, 1114111 + 1))) { __Pyx__PyObject_AsPy_UCS4_raise_error(ival); return (Py_UCS4)-1; } return (Py_UCS4)ival; } /* UpdateUnpickledDict */ static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) { PyObject *state_dict = __Pyx_PySequence_ITEM(state, index); if (unlikely(!state_dict)) { return -1; } int non_empty = PyObject_IsTrue(state_dict); if (non_empty == 0) { Py_DECREF(state_dict); return 0; } else if (unlikely(non_empty == -1)) { return -1; } PyObject *dict; #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 dict = PyObject_GetAttrString(obj, "__dict__"); #else dict = PyObject_GenericGetDict(obj, NULL); #endif if (unlikely(!dict)) { Py_DECREF(state_dict); return -1; } int result; if (likely(PyDict_CheckExact(dict))) { result = PyDict_Update(dict, state_dict); } else { PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict); if (likely(obj_result)) { Py_DECREF(obj_result); result = 0; } else { result = -1; } } Py_DECREF(state_dict); Py_DECREF(dict); return result; } static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) { Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(state_size == -1)) return -1; #endif if (state_size <= index) { return 0; } return __Pyx__UpdateUnpickledDict(obj, state, index); } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) { PyObject *module = NULL, *name = NULL, *result = NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_mstate_global->__pyx_n_u_qualname); #else name = PyType_GetQualName(tp); #endif if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { result = name; name = NULL; goto done; } result = PyUnicode_FromFormat("%U.%U", module, name); if (unlikely(result == NULL)) goto bad; done: Py_XDECREF(name); Py_XDECREF(module); return result; bad: PyErr_Clear(); if (name) { result = name; name = NULL; } else { result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__25); } goto done; } #endif /* GetRuntimeVersion */ #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 void __Pyx_init_runtime_version(void) { if (__Pyx_cached_runtime_version == 0) { 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; } __Pyx_cached_runtime_version = version; } } #endif static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 return Py_Version & ~0xFFUL; #else return __Pyx_cached_runtime_version; #endif } /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, 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, PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0}, {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, PyDoc_STR("object being iterated by 'yield from', or None")}, {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, PyDoc_STR("name of the generator"), 0}, {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, PyDoc_STR("qualified name of the generator"), 0}, {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, PyDoc_STR("Frame of the generator"), 0}, {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; 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 *) PyObject_GenericGetAttr}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, #endif #if __PYX_HAS_PY_AM_SEND == 1 {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, #endif {0, 0}, }; static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, #if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API Py_TPFLAGS_MANAGED_WEAKREF | #endif Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND, __pyx_GeneratorType_slots }; #if __PYX_HAS_PY_AM_SEND == 2 static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async; #endif static int __pyx_Generator_init(PyObject *module) { __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec( mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL); if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } #if __PYX_HAS_PY_AM_SEND == 2 __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend); #endif return 0; } static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *retval = NULL; if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { return __Pyx_Coroutine_AlreadyRunningError(gen); } __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); __Pyx_Coroutine_unset_is_running(gen); (void) result; assert (result == PYGEN_RETURN || result == PYGEN_ERROR); assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL)); return retval; } /* CheckBinaryVersion */ 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); } } /* NewCodeObj */ #if CYTHON_COMPILING_IN_LIMITED_API static 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, "iiiiiOOOOOOiOOO", 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, "iiiiiiOOOOOOiOOO", 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, "iiiiiiOOOOOOOiOOOO", 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; } #elif PY_VERSION_HEX >= 0x030B0000 static 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; 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, __pyx_mstate_global->__pyx_empty_bytes); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1 if (likely(result)) result->_co_firsttraceable = 0; #endif return result; } #elif !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 static PyObject* __Pyx_PyCode_New( const __Pyx_PyCode_New_function_description descr, PyObject * const *varnames, PyObject *filename, PyObject *funcname, PyObject *line_table, PyObject *tuple_dedup_map ) { PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL; Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; PyObject *varnames_tuple = PyTuple_New(var_count); if (unlikely(!varnames_tuple)) return NULL; for (Py_ssize_t i=0; i < var_count; i++) { Py_INCREF(varnames[i]); if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; } #if CYTHON_COMPILING_IN_LIMITED_API varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); if (!varnames_tuple_dedup) { if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; varnames_tuple_dedup = varnames_tuple; } #else varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); if (unlikely(!varnames_tuple_dedup)) goto done; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(varnames_tuple_dedup); #endif if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) { Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely(line_table_length == -1)) goto done; #endif Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL; code_bytes = PyBytes_FromStringAndSize(NULL, code_len); if (unlikely(!code_bytes)) goto done; char* c_code_bytes = PyBytes_AsString(code_bytes); if (unlikely(!c_code_bytes)) goto done; memset(c_code_bytes, 0, (size_t) code_len); } code_obj = (PyObject*) __Pyx__PyCode_New( (int) descr.argcount, (int) descr.num_posonly_args, (int) descr.num_kwonly_args, (int) descr.nlocals, 0, (int) descr.flags, code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_empty_tuple, varnames_tuple_dedup, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_empty_tuple, filename, funcname, (int) descr.first_line, (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes ); done: Py_XDECREF(code_bytes); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(varnames_tuple_dedup); #endif Py_DECREF(varnames_tuple); return code_obj; } /* DecompressString */ static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) { PyObject *module, *decompress, *compressed_bytes, *decompressed; const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib"; PyObject *methodname = PyUnicode_FromString("decompress"); if (unlikely(!methodname)) return NULL; #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000 if (algo == 3) { PyObject *fromlist = Py_BuildValue("[O]", methodname); if (unlikely(!fromlist)) return NULL; module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0); Py_DECREF(fromlist); } else #endif module = PyImport_ImportModule(module_name); if (unlikely(!module)) goto import_failed; decompress = PyObject_GetAttr(module, methodname); if (unlikely(!decompress)) goto import_failed; { #ifdef __cplusplus char *memview_bytes = const_cast(s); #else #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wcast-qual" #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-qual" #endif char *memview_bytes = (char*) s; #if defined(__clang__) #pragma clang diagnostic pop #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) #pragma GCC diagnostic pop #endif #endif #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ) int memview_flags = 0x100; #else int memview_flags = PyBUF_READ; #endif compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags); } if (unlikely(!compressed_bytes)) { Py_DECREF(decompress); goto bad; } decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL); Py_DECREF(compressed_bytes); Py_DECREF(decompress); Py_DECREF(module); Py_DECREF(methodname); return decompressed; import_failed: PyErr_Format(PyExc_ImportError, "Failed to import '%.20s.decompress' - cannot initialise module strings. " "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.", module_name, algo); bad: Py_XDECREF(module); Py_DECREF(methodname); return NULL; } #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_UTF8 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API { const char* result; Py_ssize_t unicode_length; CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; #else result = PyUnicode_AsUTF8AndSize(o, length); #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII unicode_length = PyUnicode_GetLength(o); if (unlikely(unicode_length < 0)) return NULL; if (unlikely(unicode_length != *length)) { PyUnicode_AsASCIIString(o); return NULL; } #endif return result; } #else #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_UTF8 if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif if (PyByteArray_Check(o)) { #if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); #else *length = PyByteArray_Size(o); if (*length == -1) return NULL; return PyByteArray_AsString(o); #endif } else { 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_LongWrongResultType(PyObject* result) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); 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; } PyErr_Format(PyExc_TypeError, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif PyObject *res = NULL; if (likely(PyLong_Check(x))) return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; if (likely(m && m->nb_int)) { res = m->nb_int(x); } #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Long(x); } #endif if (likely(res)) { if (unlikely(!PyLong_CheckExact(res))) { return __Pyx_PyNumber_LongWrongResultType(res); } } 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 (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 = PyLong_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); } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { CYTHON_UNUSED_VAR(b); return __Pyx_NewRef(Py_None); } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return __Pyx_NewRef(b ? Py_True: Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { return PyLong_FromSize_t(ival); } /* MultiPhaseInitModuleState */ #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE #ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE #if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 #else #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 #endif #endif #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS #error "Module state with PEP489 requires atomics. Currently that's one of\ C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" #endif #if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE #define __Pyx_ModuleStateLookup_Lock() #define __Pyx_ModuleStateLookup_Unlock() #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; #define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) #define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) #elif defined(__cplusplus) && __cplusplus >= 201103L #include static std::mutex __Pyx_ModuleStateLookup_mutex; #define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() #define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) #include static mtx_t __Pyx_ModuleStateLookup_mutex; static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; static void __Pyx_ModuleStateLookup_initialize_mutex(void) { mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); } #define __Pyx_ModuleStateLookup_Lock()\ call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ mtx_lock(&__Pyx_ModuleStateLookup_mutex) #define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) #elif defined(HAVE_PTHREAD_H) #include static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; #define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) #define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) #elif defined(_WIN32) #include // synchapi.h on its own doesn't work static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; #define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) #define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) #else #error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ Requires C standard >= C11, or C++ standard >= C++11,\ or pthreads, or the Windows 32 API, or Python >= 3.13." #endif typedef struct { int64_t id; PyObject *module; } __Pyx_InterpreterIdAndModule; typedef struct { char interpreter_id_as_index; Py_ssize_t count; Py_ssize_t allocated; __Pyx_InterpreterIdAndModule table[1]; } __Pyx_ModuleStateLookupData; #define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; #endif #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; #else static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; #endif static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( __Pyx_InterpreterIdAndModule* table, Py_ssize_t count, int64_t interpreterId) { __Pyx_InterpreterIdAndModule* begin = table; __Pyx_InterpreterIdAndModule* end = begin + count; if (begin->id == interpreterId) { return begin; } while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; if (halfway->id == interpreterId) { return halfway; } if (halfway->id < interpreterId) { begin = halfway; } else { end = halfway; } } for (; begin < end; ++begin) { if (begin->id >= interpreterId) return begin; } return begin; } static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); if (interpreter_id == -1) return NULL; #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); { __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); if (likely(data)) { __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); if (likely(data == new_data)) { goto read_finished; } } __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); __Pyx_ModuleStateLookup_Lock(); __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); __Pyx_ModuleStateLookup_Unlock(); } read_finished:; #else __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; #endif __Pyx_InterpreterIdAndModule* found = NULL; if (unlikely(!data)) goto end; if (data->interpreter_id_as_index) { if (interpreter_id < data->count) { found = data->table+interpreter_id; } } else { found = __Pyx_State_FindModuleStateLookupTableLowerBound( data->table, data->count, interpreter_id); } end: { PyObject *result=NULL; if (found && found->id == interpreter_id) { result = found->module; } #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); #endif return result; } } #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); } #else #define __Pyx_ModuleStateLookup_wait_until_no_readers() #endif static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { Py_ssize_t to_allocate = (*old_data)->allocated; while (to_allocate <= interpreter_id) { if (to_allocate == 0) to_allocate = 1; else to_allocate *= 2; } __Pyx_ModuleStateLookupData *new_data = *old_data; if (to_allocate != (*old_data)->allocated) { new_data = (__Pyx_ModuleStateLookupData *)realloc( *old_data, sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); if (!new_data) { PyErr_NoMemory(); return -1; } for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { new_data->table[i].id = i; new_data->table[i].module = NULL; } new_data->allocated = to_allocate; } new_data->table[interpreter_id].module = module; if (new_data->count < interpreter_id+1) { new_data->count = interpreter_id+1; } *old_data = new_data; return 0; } static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { __Pyx_InterpreterIdAndModule *read = data->table; __Pyx_InterpreterIdAndModule *write = data->table; __Pyx_InterpreterIdAndModule *end = read + data->count; for (; readmodule) { write->id = read->id; write->module = read->module; ++write; } } data->count = write - data->table; for (; writeid = 0; write->module = NULL; } data->interpreter_id_as_index = 0; } static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); if (interpreter_id == -1) return -1; int result = 0; __Pyx_ModuleStateLookup_Lock(); #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); #else __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; #endif __Pyx_ModuleStateLookupData *new_data = old_data; if (!new_data) { new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); if (!new_data) { result = -1; PyErr_NoMemory(); goto end; } new_data->allocated = 1; new_data->interpreter_id_as_index = 1; } __Pyx_ModuleStateLookup_wait_until_no_readers(); if (new_data->interpreter_id_as_index) { if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); goto end; } __Pyx_State_ConvertFromInterpIdAsIndex(new_data); } { Py_ssize_t insert_at = 0; { __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( new_data->table, new_data->count, interpreter_id); assert(lower_bound); insert_at = lower_bound - new_data->table; if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { lower_bound->module = module; goto end; // already in table, nothing more to do } } if (new_data->count+1 >= new_data->allocated) { Py_ssize_t to_allocate = (new_data->count+1)*2; new_data = (__Pyx_ModuleStateLookupData*)realloc( new_data, sizeof(__Pyx_ModuleStateLookupData) + (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); if (!new_data) { result = -1; new_data = old_data; PyErr_NoMemory(); goto end; } new_data->allocated = to_allocate; } ++new_data->count; int64_t last_id = interpreter_id; PyObject *last_module = module; for (Py_ssize_t i=insert_at; icount; ++i) { int64_t current_id = new_data->table[i].id; new_data->table[i].id = last_id; last_id = current_id; PyObject *current_module = new_data->table[i].module; new_data->table[i].module = last_module; last_module = current_module; } } end: #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); #else __Pyx_ModuleStateLookup_data = new_data; #endif __Pyx_ModuleStateLookup_Unlock(); return result; } static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); if (interpreter_id == -1) return -1; __Pyx_ModuleStateLookup_Lock(); #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); #else __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; #endif if (data->interpreter_id_as_index) { if (interpreter_id < data->count) { data->table[interpreter_id].module = NULL; } goto done; } { __Pyx_ModuleStateLookup_wait_until_no_readers(); __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( data->table, data->count, interpreter_id); if (!lower_bound) goto done; if (lower_bound->id != interpreter_id) goto done; __Pyx_InterpreterIdAndModule *end = data->table+data->count; for (;lower_boundid = (lower_bound+1)->id; lower_bound->module = (lower_bound+1)->module; } } --data->count; if (data->count == 0) { free(data); data = NULL; } done: #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); #else __Pyx_ModuleStateLookup_data = data; #endif __Pyx_ModuleStateLookup_Unlock(); return 0; } #endif /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/protocol.pxd0000644000175100017510000000360715111154235020574 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/protocol.pyi0000644000175100017510000002162415111154235020601 0ustar00runnerrunnerimport asyncio import asyncio.protocols import hmac from codecs import CodecInfo from collections.abc import Callable, Iterable, 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 from .record import Record _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 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/protocol.pyx0000644000175100017510000010325115111154235020615 0ustar00runnerrunner# 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 recordcapi 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 from asyncpg.protocol.record import Record, RecordDescriptor 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() 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 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 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 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 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 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 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 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 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 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 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 ) 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 = RecordDescriptor({}, ()) else: desc = RecordDescriptor( mapping, tuple(mapping) if mapping else ()) rec = desc.make_record(Record, len(elems)) for i in range(len(elems)): elem = elems[i] cpython.Py_INCREF(elem) recordcapi.ApgRecord_SET_ITEM(rec, i, elem) return rec ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1764022438.2948217 asyncpg-0.31.0/asyncpg/protocol/record/0000755000175100017510000000000015111154246017470 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/record/pythoncapi_compat.h0000644000175100017510000021041215111154235023360 0ustar00runnerrunner// Header file providing new C API functions to old Python versions. // // File distributed under the Zero Clause BSD (0BSD) license. // Copyright Contributors to the pythoncapi_compat project. // // Homepage: // https://github.com/python/pythoncapi_compat // // Latest version: // https://raw.githubusercontent.com/python/pythoncapi-compat/main/pythoncapi_compat.h // // SPDX-License-Identifier: 0BSD #ifndef PYTHONCAPI_COMPAT #define PYTHONCAPI_COMPAT #ifdef __cplusplus extern "C" { #endif #include #include // offsetof() // Python 3.11.0b4 added PyFrame_Back() to Python.h #if PY_VERSION_HEX < 0x030b00B4 && !defined(PYPY_VERSION) # include "frameobject.h" // PyFrameObject, PyFrame_GetBack() #endif #if PY_VERSION_HEX < 0x030C00A3 # include // T_SHORT, READONLY #endif #ifndef _Py_CAST # define _Py_CAST(type, expr) ((type)(expr)) #endif // Static inline functions should use _Py_NULL rather than using directly NULL // to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer, // _Py_NULL is defined as nullptr. #ifndef _Py_NULL # if (defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \ || (defined(__cplusplus) && __cplusplus >= 201103) # define _Py_NULL nullptr # else # define _Py_NULL NULL # endif #endif // Cast argument to PyObject* type. #ifndef _PyObject_CAST # define _PyObject_CAST(op) _Py_CAST(PyObject*, op) #endif #ifndef Py_BUILD_ASSERT # define Py_BUILD_ASSERT(cond) \ do { \ (void)sizeof(char [1 - 2 * !(cond)]); \ } while(0) #endif // bpo-42262 added Py_NewRef() to Python 3.10.0a3 #if PY_VERSION_HEX < 0x030A00A3 && !defined(Py_NewRef) static inline PyObject* _Py_NewRef(PyObject *obj) { Py_INCREF(obj); return obj; } #define Py_NewRef(obj) _Py_NewRef(_PyObject_CAST(obj)) #endif // bpo-42262 added Py_XNewRef() to Python 3.10.0a3 #if PY_VERSION_HEX < 0x030A00A3 && !defined(Py_XNewRef) static inline PyObject* _Py_XNewRef(PyObject *obj) { Py_XINCREF(obj); return obj; } #define Py_XNewRef(obj) _Py_XNewRef(_PyObject_CAST(obj)) #endif // bpo-39573 added Py_SET_REFCNT() to Python 3.9.0a4 #if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_REFCNT) static inline void _Py_SET_REFCNT(PyObject *ob, Py_ssize_t refcnt) { ob->ob_refcnt = refcnt; } #define Py_SET_REFCNT(ob, refcnt) _Py_SET_REFCNT(_PyObject_CAST(ob), refcnt) #endif // Py_SETREF() and Py_XSETREF() were added to Python 3.5.2. // It is excluded from the limited C API. #if (PY_VERSION_HEX < 0x03050200 && !defined(Py_SETREF)) && !defined(Py_LIMITED_API) #define Py_SETREF(dst, src) \ do { \ PyObject **_tmp_dst_ptr = _Py_CAST(PyObject**, &(dst)); \ PyObject *_tmp_dst = (*_tmp_dst_ptr); \ *_tmp_dst_ptr = _PyObject_CAST(src); \ Py_DECREF(_tmp_dst); \ } while (0) #define Py_XSETREF(dst, src) \ do { \ PyObject **_tmp_dst_ptr = _Py_CAST(PyObject**, &(dst)); \ PyObject *_tmp_dst = (*_tmp_dst_ptr); \ *_tmp_dst_ptr = _PyObject_CAST(src); \ Py_XDECREF(_tmp_dst); \ } while (0) #endif // bpo-43753 added Py_Is(), Py_IsNone(), Py_IsTrue() and Py_IsFalse() // to Python 3.10.0b1. #if PY_VERSION_HEX < 0x030A00B1 && !defined(Py_Is) # define Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX < 0x030A00B1 && !defined(Py_IsNone) # define Py_IsNone(x) Py_Is(x, Py_None) #endif #if (PY_VERSION_HEX < 0x030A00B1 || defined(PYPY_VERSION)) && !defined(Py_IsTrue) # define Py_IsTrue(x) Py_Is(x, Py_True) #endif #if (PY_VERSION_HEX < 0x030A00B1 || defined(PYPY_VERSION)) && !defined(Py_IsFalse) # define Py_IsFalse(x) Py_Is(x, Py_False) #endif // bpo-39573 added Py_SET_TYPE() to Python 3.9.0a4 #if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_TYPE) static inline void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type) { ob->ob_type = type; } #define Py_SET_TYPE(ob, type) _Py_SET_TYPE(_PyObject_CAST(ob), type) #endif // bpo-39573 added Py_SET_SIZE() to Python 3.9.0a4 #if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_SIZE) static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size) { ob->ob_size = size; } #define Py_SET_SIZE(ob, size) _Py_SET_SIZE((PyVarObject*)(ob), size) #endif // bpo-40421 added PyFrame_GetCode() to Python 3.9.0b1 #if PY_VERSION_HEX < 0x030900B1 || defined(PYPY_VERSION) static inline PyCodeObject* PyFrame_GetCode(PyFrameObject *frame) { assert(frame != _Py_NULL); assert(frame->f_code != _Py_NULL); return _Py_CAST(PyCodeObject*, Py_NewRef(frame->f_code)); } #endif static inline PyCodeObject* _PyFrame_GetCodeBorrow(PyFrameObject *frame) { PyCodeObject *code = PyFrame_GetCode(frame); Py_DECREF(code); return code; } // bpo-40421 added PyFrame_GetBack() to Python 3.9.0b1 #if PY_VERSION_HEX < 0x030900B1 && !defined(PYPY_VERSION) static inline PyFrameObject* PyFrame_GetBack(PyFrameObject *frame) { assert(frame != _Py_NULL); return _Py_CAST(PyFrameObject*, Py_XNewRef(frame->f_back)); } #endif #if !defined(PYPY_VERSION) static inline PyFrameObject* _PyFrame_GetBackBorrow(PyFrameObject *frame) { PyFrameObject *back = PyFrame_GetBack(frame); Py_XDECREF(back); return back; } #endif // bpo-40421 added PyFrame_GetLocals() to Python 3.11.0a7 #if PY_VERSION_HEX < 0x030B00A7 && !defined(PYPY_VERSION) static inline PyObject* PyFrame_GetLocals(PyFrameObject *frame) { #if PY_VERSION_HEX >= 0x030400B1 if (PyFrame_FastToLocalsWithError(frame) < 0) { return NULL; } #else PyFrame_FastToLocals(frame); #endif return Py_NewRef(frame->f_locals); } #endif // bpo-40421 added PyFrame_GetGlobals() to Python 3.11.0a7 #if PY_VERSION_HEX < 0x030B00A7 && !defined(PYPY_VERSION) static inline PyObject* PyFrame_GetGlobals(PyFrameObject *frame) { return Py_NewRef(frame->f_globals); } #endif // bpo-40421 added PyFrame_GetBuiltins() to Python 3.11.0a7 #if PY_VERSION_HEX < 0x030B00A7 && !defined(PYPY_VERSION) static inline PyObject* PyFrame_GetBuiltins(PyFrameObject *frame) { return Py_NewRef(frame->f_builtins); } #endif // bpo-40421 added PyFrame_GetLasti() to Python 3.11.0b1 #if PY_VERSION_HEX < 0x030B00B1 && !defined(PYPY_VERSION) static inline int PyFrame_GetLasti(PyFrameObject *frame) { #if PY_VERSION_HEX >= 0x030A00A7 // bpo-27129: Since Python 3.10.0a7, f_lasti is an instruction offset, // not a bytes offset anymore. Python uses 16-bit "wordcode" (2 bytes) // instructions. if (frame->f_lasti < 0) { return -1; } return frame->f_lasti * 2; #else return frame->f_lasti; #endif } #endif // gh-91248 added PyFrame_GetVar() to Python 3.12.0a2 #if PY_VERSION_HEX < 0x030C00A2 && !defined(PYPY_VERSION) static inline PyObject* PyFrame_GetVar(PyFrameObject *frame, PyObject *name) { PyObject *locals, *value; locals = PyFrame_GetLocals(frame); if (locals == NULL) { return NULL; } #if PY_VERSION_HEX >= 0x03000000 value = PyDict_GetItemWithError(locals, name); #else value = _PyDict_GetItemWithError(locals, name); #endif Py_DECREF(locals); if (value == NULL) { if (PyErr_Occurred()) { return NULL; } #if PY_VERSION_HEX >= 0x03000000 PyErr_Format(PyExc_NameError, "variable %R does not exist", name); #else PyErr_SetString(PyExc_NameError, "variable does not exist"); #endif return NULL; } return Py_NewRef(value); } #endif // gh-91248 added PyFrame_GetVarString() to Python 3.12.0a2 #if PY_VERSION_HEX < 0x030C00A2 && !defined(PYPY_VERSION) static inline PyObject* PyFrame_GetVarString(PyFrameObject *frame, const char *name) { PyObject *name_obj, *value; #if PY_VERSION_HEX >= 0x03000000 name_obj = PyUnicode_FromString(name); #else name_obj = PyString_FromString(name); #endif if (name_obj == NULL) { return NULL; } value = PyFrame_GetVar(frame, name_obj); Py_DECREF(name_obj); return value; } #endif // bpo-39947 added PyThreadState_GetInterpreter() to Python 3.9.0a5 #if PY_VERSION_HEX < 0x030900A5 || (defined(PYPY_VERSION) && PY_VERSION_HEX < 0x030B0000) static inline PyInterpreterState * PyThreadState_GetInterpreter(PyThreadState *tstate) { assert(tstate != _Py_NULL); return tstate->interp; } #endif // bpo-40429 added PyThreadState_GetFrame() to Python 3.9.0b1 #if PY_VERSION_HEX < 0x030900B1 && !defined(PYPY_VERSION) static inline PyFrameObject* PyThreadState_GetFrame(PyThreadState *tstate) { assert(tstate != _Py_NULL); return _Py_CAST(PyFrameObject *, Py_XNewRef(tstate->frame)); } #endif #if !defined(PYPY_VERSION) static inline PyFrameObject* _PyThreadState_GetFrameBorrow(PyThreadState *tstate) { PyFrameObject *frame = PyThreadState_GetFrame(tstate); Py_XDECREF(frame); return frame; } #endif // bpo-39947 added PyInterpreterState_Get() to Python 3.9.0a5 #if PY_VERSION_HEX < 0x030900A5 || defined(PYPY_VERSION) static inline PyInterpreterState* PyInterpreterState_Get(void) { PyThreadState *tstate; PyInterpreterState *interp; tstate = PyThreadState_GET(); if (tstate == _Py_NULL) { Py_FatalError("GIL released (tstate is NULL)"); } interp = tstate->interp; if (interp == _Py_NULL) { Py_FatalError("no current interpreter"); } return interp; } #endif // bpo-39947 added PyInterpreterState_Get() to Python 3.9.0a6 #if 0x030700A1 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x030900A6 && !defined(PYPY_VERSION) static inline uint64_t PyThreadState_GetID(PyThreadState *tstate) { assert(tstate != _Py_NULL); return tstate->id; } #endif // bpo-43760 added PyThreadState_EnterTracing() to Python 3.11.0a2 #if PY_VERSION_HEX < 0x030B00A2 && !defined(PYPY_VERSION) static inline void PyThreadState_EnterTracing(PyThreadState *tstate) { tstate->tracing++; #if PY_VERSION_HEX >= 0x030A00A1 tstate->cframe->use_tracing = 0; #else tstate->use_tracing = 0; #endif } #endif // bpo-43760 added PyThreadState_LeaveTracing() to Python 3.11.0a2 #if PY_VERSION_HEX < 0x030B00A2 && !defined(PYPY_VERSION) static inline void PyThreadState_LeaveTracing(PyThreadState *tstate) { int use_tracing = (tstate->c_tracefunc != _Py_NULL || tstate->c_profilefunc != _Py_NULL); tstate->tracing--; #if PY_VERSION_HEX >= 0x030A00A1 tstate->cframe->use_tracing = use_tracing; #else tstate->use_tracing = use_tracing; #endif } #endif // bpo-37194 added PyObject_CallNoArgs() to Python 3.9.0a1 // PyObject_CallNoArgs() added to PyPy 3.9.16-v7.3.11 #if !defined(PyObject_CallNoArgs) && PY_VERSION_HEX < 0x030900A1 static inline PyObject* PyObject_CallNoArgs(PyObject *func) { return PyObject_CallFunctionObjArgs(func, NULL); } #endif // bpo-39245 made PyObject_CallOneArg() public (previously called // _PyObject_CallOneArg) in Python 3.9.0a4 // PyObject_CallOneArg() added to PyPy 3.9.16-v7.3.11 #if !defined(PyObject_CallOneArg) && PY_VERSION_HEX < 0x030900A4 static inline PyObject* PyObject_CallOneArg(PyObject *func, PyObject *arg) { return PyObject_CallFunctionObjArgs(func, arg, NULL); } #endif // bpo-1635741 added PyModule_AddObjectRef() to Python 3.10.0a3 #if PY_VERSION_HEX < 0x030A00A3 static inline int PyModule_AddObjectRef(PyObject *module, const char *name, PyObject *value) { int res; if (!value && !PyErr_Occurred()) { // PyModule_AddObject() raises TypeError in this case PyErr_SetString(PyExc_SystemError, "PyModule_AddObjectRef() must be called " "with an exception raised if value is NULL"); return -1; } Py_XINCREF(value); res = PyModule_AddObject(module, name, value); if (res < 0) { Py_XDECREF(value); } return res; } #endif // bpo-40024 added PyModule_AddType() to Python 3.9.0a5 #if PY_VERSION_HEX < 0x030900A5 static inline int PyModule_AddType(PyObject *module, PyTypeObject *type) { const char *name, *dot; if (PyType_Ready(type) < 0) { return -1; } // inline _PyType_Name() name = type->tp_name; assert(name != _Py_NULL); dot = strrchr(name, '.'); if (dot != _Py_NULL) { name = dot + 1; } return PyModule_AddObjectRef(module, name, _PyObject_CAST(type)); } #endif // bpo-40241 added PyObject_GC_IsTracked() to Python 3.9.0a6. // bpo-4688 added _PyObject_GC_IS_TRACKED() to Python 2.7.0a2. #if PY_VERSION_HEX < 0x030900A6 && !defined(PYPY_VERSION) static inline int PyObject_GC_IsTracked(PyObject* obj) { return (PyObject_IS_GC(obj) && _PyObject_GC_IS_TRACKED(obj)); } #endif // bpo-40241 added PyObject_GC_IsFinalized() to Python 3.9.0a6. // bpo-18112 added _PyGCHead_FINALIZED() to Python 3.4.0 final. #if PY_VERSION_HEX < 0x030900A6 && PY_VERSION_HEX >= 0x030400F0 && !defined(PYPY_VERSION) static inline int PyObject_GC_IsFinalized(PyObject *obj) { PyGC_Head *gc = _Py_CAST(PyGC_Head*, obj) - 1; return (PyObject_IS_GC(obj) && _PyGCHead_FINALIZED(gc)); } #endif // bpo-39573 added Py_IS_TYPE() to Python 3.9.0a4 #if PY_VERSION_HEX < 0x030900A4 && !defined(Py_IS_TYPE) static inline int _Py_IS_TYPE(PyObject *ob, PyTypeObject *type) { return Py_TYPE(ob) == type; } #define Py_IS_TYPE(ob, type) _Py_IS_TYPE(_PyObject_CAST(ob), type) #endif // bpo-46906 added PyFloat_Pack2() and PyFloat_Unpack2() to Python 3.11a7. // bpo-11734 added _PyFloat_Pack2() and _PyFloat_Unpack2() to Python 3.6.0b1. // Python 3.11a2 moved _PyFloat_Pack2() and _PyFloat_Unpack2() to the internal // C API: Python 3.11a2-3.11a6 versions are not supported. #if 0x030600B1 <= PY_VERSION_HEX && PY_VERSION_HEX <= 0x030B00A1 && !defined(PYPY_VERSION) static inline int PyFloat_Pack2(double x, char *p, int le) { return _PyFloat_Pack2(x, (unsigned char*)p, le); } static inline double PyFloat_Unpack2(const char *p, int le) { return _PyFloat_Unpack2((const unsigned char *)p, le); } #endif // bpo-46906 added PyFloat_Pack4(), PyFloat_Pack8(), PyFloat_Unpack4() and // PyFloat_Unpack8() to Python 3.11a7. // Python 3.11a2 moved _PyFloat_Pack4(), _PyFloat_Pack8(), _PyFloat_Unpack4() // and _PyFloat_Unpack8() to the internal C API: Python 3.11a2-3.11a6 versions // are not supported. #if PY_VERSION_HEX <= 0x030B00A1 && !defined(PYPY_VERSION) static inline int PyFloat_Pack4(double x, char *p, int le) { return _PyFloat_Pack4(x, (unsigned char*)p, le); } static inline int PyFloat_Pack8(double x, char *p, int le) { return _PyFloat_Pack8(x, (unsigned char*)p, le); } static inline double PyFloat_Unpack4(const char *p, int le) { return _PyFloat_Unpack4((const unsigned char *)p, le); } static inline double PyFloat_Unpack8(const char *p, int le) { return _PyFloat_Unpack8((const unsigned char *)p, le); } #endif // gh-92154 added PyCode_GetCode() to Python 3.11.0b1 #if PY_VERSION_HEX < 0x030B00B1 && !defined(PYPY_VERSION) static inline PyObject* PyCode_GetCode(PyCodeObject *code) { return Py_NewRef(code->co_code); } #endif // gh-95008 added PyCode_GetVarnames() to Python 3.11.0rc1 #if PY_VERSION_HEX < 0x030B00C1 && !defined(PYPY_VERSION) static inline PyObject* PyCode_GetVarnames(PyCodeObject *code) { return Py_NewRef(code->co_varnames); } #endif // gh-95008 added PyCode_GetFreevars() to Python 3.11.0rc1 #if PY_VERSION_HEX < 0x030B00C1 && !defined(PYPY_VERSION) static inline PyObject* PyCode_GetFreevars(PyCodeObject *code) { return Py_NewRef(code->co_freevars); } #endif // gh-95008 added PyCode_GetCellvars() to Python 3.11.0rc1 #if PY_VERSION_HEX < 0x030B00C1 && !defined(PYPY_VERSION) static inline PyObject* PyCode_GetCellvars(PyCodeObject *code) { return Py_NewRef(code->co_cellvars); } #endif // Py_UNUSED() was added to Python 3.4.0b2. #if PY_VERSION_HEX < 0x030400B2 && !defined(Py_UNUSED) # if defined(__GNUC__) || defined(__clang__) # define Py_UNUSED(name) _unused_ ## name __attribute__((unused)) # else # define Py_UNUSED(name) _unused_ ## name # endif #endif // gh-105922 added PyImport_AddModuleRef() to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A0 static inline PyObject* PyImport_AddModuleRef(const char *name) { return Py_XNewRef(PyImport_AddModule(name)); } #endif // gh-105927 added PyWeakref_GetRef() to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D0000 static inline int PyWeakref_GetRef(PyObject *ref, PyObject **pobj) { PyObject *obj; if (ref != NULL && !PyWeakref_Check(ref)) { *pobj = NULL; PyErr_SetString(PyExc_TypeError, "expected a weakref"); return -1; } obj = PyWeakref_GetObject(ref); if (obj == NULL) { // SystemError if ref is NULL *pobj = NULL; return -1; } if (obj == Py_None) { *pobj = NULL; return 0; } *pobj = Py_NewRef(obj); return 1; } #endif // bpo-36974 added PY_VECTORCALL_ARGUMENTS_OFFSET to Python 3.8b1 #ifndef PY_VECTORCALL_ARGUMENTS_OFFSET # define PY_VECTORCALL_ARGUMENTS_OFFSET (_Py_CAST(size_t, 1) << (8 * sizeof(size_t) - 1)) #endif // bpo-36974 added PyVectorcall_NARGS() to Python 3.8b1 #if PY_VERSION_HEX < 0x030800B1 static inline Py_ssize_t PyVectorcall_NARGS(size_t n) { return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET; } #endif // gh-105922 added PyObject_Vectorcall() to Python 3.9.0a4 #if PY_VERSION_HEX < 0x030900A4 static inline PyObject* PyObject_Vectorcall(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames) { #if PY_VERSION_HEX >= 0x030800B1 && !defined(PYPY_VERSION) // bpo-36974 added _PyObject_Vectorcall() to Python 3.8.0b1 return _PyObject_Vectorcall(callable, args, nargsf, kwnames); #else PyObject *posargs = NULL, *kwargs = NULL; PyObject *res; Py_ssize_t nposargs, nkwargs, i; if (nargsf != 0 && args == NULL) { PyErr_BadInternalCall(); goto error; } if (kwnames != NULL && !PyTuple_Check(kwnames)) { PyErr_BadInternalCall(); goto error; } nposargs = (Py_ssize_t)PyVectorcall_NARGS(nargsf); if (kwnames) { nkwargs = PyTuple_GET_SIZE(kwnames); } else { nkwargs = 0; } posargs = PyTuple_New(nposargs); if (posargs == NULL) { goto error; } if (nposargs) { for (i=0; i < nposargs; i++) { PyTuple_SET_ITEM(posargs, i, Py_NewRef(*args)); args++; } } if (nkwargs) { kwargs = PyDict_New(); if (kwargs == NULL) { goto error; } for (i = 0; i < nkwargs; i++) { PyObject *key = PyTuple_GET_ITEM(kwnames, i); PyObject *value = *args; args++; if (PyDict_SetItem(kwargs, key, value) < 0) { goto error; } } } else { kwargs = NULL; } res = PyObject_Call(callable, posargs, kwargs); Py_DECREF(posargs); Py_XDECREF(kwargs); return res; error: Py_DECREF(posargs); Py_XDECREF(kwargs); return NULL; #endif } #endif // gh-106521 added PyObject_GetOptionalAttr() and // PyObject_GetOptionalAttrString() to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A1 static inline int PyObject_GetOptionalAttr(PyObject *obj, PyObject *attr_name, PyObject **result) { // bpo-32571 added _PyObject_LookupAttr() to Python 3.7.0b1 #if PY_VERSION_HEX >= 0x030700B1 && !defined(PYPY_VERSION) return _PyObject_LookupAttr(obj, attr_name, result); #else *result = PyObject_GetAttr(obj, attr_name); if (*result != NULL) { return 1; } if (!PyErr_Occurred()) { return 0; } if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); return 0; } return -1; #endif } static inline int PyObject_GetOptionalAttrString(PyObject *obj, const char *attr_name, PyObject **result) { PyObject *name_obj; int rc; #if PY_VERSION_HEX >= 0x03000000 name_obj = PyUnicode_FromString(attr_name); #else name_obj = PyString_FromString(attr_name); #endif if (name_obj == NULL) { *result = NULL; return -1; } rc = PyObject_GetOptionalAttr(obj, name_obj, result); Py_DECREF(name_obj); return rc; } #endif // gh-106307 added PyObject_GetOptionalAttr() and // PyMapping_GetOptionalItemString() to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A1 static inline int PyMapping_GetOptionalItem(PyObject *obj, PyObject *key, PyObject **result) { *result = PyObject_GetItem(obj, key); if (*result) { return 1; } if (!PyErr_ExceptionMatches(PyExc_KeyError)) { return -1; } PyErr_Clear(); return 0; } static inline int PyMapping_GetOptionalItemString(PyObject *obj, const char *key, PyObject **result) { PyObject *key_obj; int rc; #if PY_VERSION_HEX >= 0x03000000 key_obj = PyUnicode_FromString(key); #else key_obj = PyString_FromString(key); #endif if (key_obj == NULL) { *result = NULL; return -1; } rc = PyMapping_GetOptionalItem(obj, key_obj, result); Py_DECREF(key_obj); return rc; } #endif // gh-108511 added PyMapping_HasKeyWithError() and // PyMapping_HasKeyStringWithError() to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A1 static inline int PyMapping_HasKeyWithError(PyObject *obj, PyObject *key) { PyObject *res; int rc = PyMapping_GetOptionalItem(obj, key, &res); Py_XDECREF(res); return rc; } static inline int PyMapping_HasKeyStringWithError(PyObject *obj, const char *key) { PyObject *res; int rc = PyMapping_GetOptionalItemString(obj, key, &res); Py_XDECREF(res); return rc; } #endif // gh-108511 added PyObject_HasAttrWithError() and // PyObject_HasAttrStringWithError() to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A1 static inline int PyObject_HasAttrWithError(PyObject *obj, PyObject *attr) { PyObject *res; int rc = PyObject_GetOptionalAttr(obj, attr, &res); Py_XDECREF(res); return rc; } static inline int PyObject_HasAttrStringWithError(PyObject *obj, const char *attr) { PyObject *res; int rc = PyObject_GetOptionalAttrString(obj, attr, &res); Py_XDECREF(res); return rc; } #endif // gh-106004 added PyDict_GetItemRef() and PyDict_GetItemStringRef() // to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A1 static inline int PyDict_GetItemRef(PyObject *mp, PyObject *key, PyObject **result) { #if PY_VERSION_HEX >= 0x03000000 PyObject *item = PyDict_GetItemWithError(mp, key); #else PyObject *item = _PyDict_GetItemWithError(mp, key); #endif if (item != NULL) { *result = Py_NewRef(item); return 1; // found } if (!PyErr_Occurred()) { *result = NULL; return 0; // not found } *result = NULL; return -1; } static inline int PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result) { int res; #if PY_VERSION_HEX >= 0x03000000 PyObject *key_obj = PyUnicode_FromString(key); #else PyObject *key_obj = PyString_FromString(key); #endif if (key_obj == NULL) { *result = NULL; return -1; } res = PyDict_GetItemRef(mp, key_obj, result); Py_DECREF(key_obj); return res; } #endif // gh-106307 added PyModule_Add() to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A1 static inline int PyModule_Add(PyObject *mod, const char *name, PyObject *value) { int res = PyModule_AddObjectRef(mod, name, value); Py_XDECREF(value); return res; } #endif // gh-108014 added Py_IsFinalizing() to Python 3.13.0a1 // bpo-1856 added _Py_Finalizing to Python 3.2.1b1. // _Py_IsFinalizing() was added to PyPy 7.3.0. #if (0x030201B1 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x030D00A1) \ && (!defined(PYPY_VERSION_NUM) || PYPY_VERSION_NUM >= 0x7030000) static inline int Py_IsFinalizing(void) { #if PY_VERSION_HEX >= 0x030700A1 // _Py_IsFinalizing() was added to Python 3.7.0a1. return _Py_IsFinalizing(); #else return (_Py_Finalizing != NULL); #endif } #endif // gh-108323 added PyDict_ContainsString() to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A1 static inline int PyDict_ContainsString(PyObject *op, const char *key) { PyObject *key_obj = PyUnicode_FromString(key); if (key_obj == NULL) { return -1; } int res = PyDict_Contains(op, key_obj); Py_DECREF(key_obj); return res; } #endif // gh-108445 added PyLong_AsInt() to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A1 static inline int PyLong_AsInt(PyObject *obj) { #ifdef PYPY_VERSION long value = PyLong_AsLong(obj); if (value == -1 && PyErr_Occurred()) { return -1; } if (value < (long)INT_MIN || (long)INT_MAX < value) { PyErr_SetString(PyExc_OverflowError, "Python int too large to convert to C int"); return -1; } return (int)value; #else return _PyLong_AsInt(obj); #endif } #endif // gh-107073 added PyObject_VisitManagedDict() to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A1 static inline int PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg) { PyObject **dict = _PyObject_GetDictPtr(obj); if (dict == NULL || *dict == NULL) { return -1; } Py_VISIT(*dict); return 0; } static inline void PyObject_ClearManagedDict(PyObject *obj) { PyObject **dict = _PyObject_GetDictPtr(obj); if (dict == NULL || *dict == NULL) { return; } Py_CLEAR(*dict); } #endif // gh-108867 added PyThreadState_GetUnchecked() to Python 3.13.0a1 // Python 3.5.2 added _PyThreadState_UncheckedGet(). #if PY_VERSION_HEX >= 0x03050200 && PY_VERSION_HEX < 0x030D00A1 static inline PyThreadState* PyThreadState_GetUnchecked(void) { return _PyThreadState_UncheckedGet(); } #endif // gh-110289 added PyUnicode_EqualToUTF8() and PyUnicode_EqualToUTF8AndSize() // to Python 3.13.0a1 #if PY_VERSION_HEX < 0x030D00A1 static inline int PyUnicode_EqualToUTF8AndSize(PyObject *unicode, const char *str, Py_ssize_t str_len) { Py_ssize_t len; const void *utf8; PyObject *exc_type, *exc_value, *exc_tb; int res; // API cannot report errors so save/restore the exception PyErr_Fetch(&exc_type, &exc_value, &exc_tb); // Python 3.3.0a1 added PyUnicode_AsUTF8AndSize() #if PY_VERSION_HEX >= 0x030300A1 if (PyUnicode_IS_ASCII(unicode)) { utf8 = PyUnicode_DATA(unicode); len = PyUnicode_GET_LENGTH(unicode); } else { utf8 = PyUnicode_AsUTF8AndSize(unicode, &len); if (utf8 == NULL) { // Memory allocation failure. The API cannot report error, // so ignore the exception and return 0. res = 0; goto done; } } if (len != str_len) { res = 0; goto done; } res = (memcmp(utf8, str, (size_t)len) == 0); #else PyObject *bytes = PyUnicode_AsUTF8String(unicode); if (bytes == NULL) { // Memory allocation failure. The API cannot report error, // so ignore the exception and return 0. res = 0; goto done; } #if PY_VERSION_HEX >= 0x03000000 len = PyBytes_GET_SIZE(bytes); utf8 = PyBytes_AS_STRING(bytes); #else len = PyString_GET_SIZE(bytes); utf8 = PyString_AS_STRING(bytes); #endif if (len != str_len) { Py_DECREF(bytes); res = 0; goto done; } res = (memcmp(utf8, str, (size_t)len) == 0); Py_DECREF(bytes); #endif done: PyErr_Restore(exc_type, exc_value, exc_tb); return res; } static inline int PyUnicode_EqualToUTF8(PyObject *unicode, const char *str) { return PyUnicode_EqualToUTF8AndSize(unicode, str, (Py_ssize_t)strlen(str)); } #endif // gh-111138 added PyList_Extend() and PyList_Clear() to Python 3.13.0a2 #if PY_VERSION_HEX < 0x030D00A2 static inline int PyList_Extend(PyObject *list, PyObject *iterable) { return PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable); } static inline int PyList_Clear(PyObject *list) { return PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL); } #endif // gh-111262 added PyDict_Pop() and PyDict_PopString() to Python 3.13.0a2 #if PY_VERSION_HEX < 0x030D00A2 static inline int PyDict_Pop(PyObject *dict, PyObject *key, PyObject **result) { PyObject *value; if (!PyDict_Check(dict)) { PyErr_BadInternalCall(); if (result) { *result = NULL; } return -1; } // bpo-16991 added _PyDict_Pop() to Python 3.5.0b2. // Python 3.6.0b3 changed _PyDict_Pop() first argument type to PyObject*. // Python 3.13.0a1 removed _PyDict_Pop(). #if defined(PYPY_VERSION) || PY_VERSION_HEX < 0x030500b2 || PY_VERSION_HEX >= 0x030D0000 value = PyObject_CallMethod(dict, "pop", "O", key); #elif PY_VERSION_HEX < 0x030600b3 value = _PyDict_Pop(_Py_CAST(PyDictObject*, dict), key, NULL); #else value = _PyDict_Pop(dict, key, NULL); #endif if (value == NULL) { if (result) { *result = NULL; } if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_KeyError)) { return -1; } PyErr_Clear(); return 0; } if (result) { *result = value; } else { Py_DECREF(value); } return 1; } static inline int PyDict_PopString(PyObject *dict, const char *key, PyObject **result) { PyObject *key_obj = PyUnicode_FromString(key); if (key_obj == NULL) { if (result != NULL) { *result = NULL; } return -1; } int res = PyDict_Pop(dict, key_obj, result); Py_DECREF(key_obj); return res; } #endif #if PY_VERSION_HEX < 0x030200A4 // Python 3.2.0a4 added Py_hash_t type typedef Py_ssize_t Py_hash_t; #endif // gh-111545 added Py_HashPointer() to Python 3.13.0a3 #if PY_VERSION_HEX < 0x030D00A3 static inline Py_hash_t Py_HashPointer(const void *ptr) { #if PY_VERSION_HEX >= 0x030900A4 && !defined(PYPY_VERSION) return _Py_HashPointer(ptr); #else return _Py_HashPointer(_Py_CAST(void*, ptr)); #endif } #endif // Python 3.13a4 added a PyTime API. // Use the private API added to Python 3.5. #if PY_VERSION_HEX < 0x030D00A4 && PY_VERSION_HEX >= 0x03050000 typedef _PyTime_t PyTime_t; #define PyTime_MIN _PyTime_MIN #define PyTime_MAX _PyTime_MAX static inline double PyTime_AsSecondsDouble(PyTime_t t) { return _PyTime_AsSecondsDouble(t); } static inline int PyTime_Monotonic(PyTime_t *result) { return _PyTime_GetMonotonicClockWithInfo(result, NULL); } static inline int PyTime_Time(PyTime_t *result) { return _PyTime_GetSystemClockWithInfo(result, NULL); } static inline int PyTime_PerfCounter(PyTime_t *result) { #if PY_VERSION_HEX >= 0x03070000 && !defined(PYPY_VERSION) return _PyTime_GetPerfCounterWithInfo(result, NULL); #elif PY_VERSION_HEX >= 0x03070000 // Call time.perf_counter_ns() and convert Python int object to PyTime_t. // Cache time.perf_counter_ns() function for best performance. static PyObject *func = NULL; if (func == NULL) { PyObject *mod = PyImport_ImportModule("time"); if (mod == NULL) { return -1; } func = PyObject_GetAttrString(mod, "perf_counter_ns"); Py_DECREF(mod); if (func == NULL) { return -1; } } PyObject *res = PyObject_CallNoArgs(func); if (res == NULL) { return -1; } long long value = PyLong_AsLongLong(res); Py_DECREF(res); if (value == -1 && PyErr_Occurred()) { return -1; } Py_BUILD_ASSERT(sizeof(value) >= sizeof(PyTime_t)); *result = (PyTime_t)value; return 0; #else // Call time.perf_counter() and convert C double to PyTime_t. // Cache time.perf_counter() function for best performance. static PyObject *func = NULL; if (func == NULL) { PyObject *mod = PyImport_ImportModule("time"); if (mod == NULL) { return -1; } func = PyObject_GetAttrString(mod, "perf_counter"); Py_DECREF(mod); if (func == NULL) { return -1; } } PyObject *res = PyObject_CallNoArgs(func); if (res == NULL) { return -1; } double d = PyFloat_AsDouble(res); Py_DECREF(res); if (d == -1.0 && PyErr_Occurred()) { return -1; } // Avoid floor() to avoid having to link to libm *result = (PyTime_t)(d * 1e9); return 0; #endif } #endif // gh-111389 added hash constants to Python 3.13.0a5. These constants were // added first as private macros to Python 3.4.0b1 and PyPy 7.3.8. #if (!defined(PyHASH_BITS) \ && ((!defined(PYPY_VERSION) && PY_VERSION_HEX >= 0x030400B1) \ || (defined(PYPY_VERSION) && PY_VERSION_HEX >= 0x03070000 \ && PYPY_VERSION_NUM >= 0x07030800))) # define PyHASH_BITS _PyHASH_BITS # define PyHASH_MODULUS _PyHASH_MODULUS # define PyHASH_INF _PyHASH_INF # define PyHASH_IMAG _PyHASH_IMAG #endif // gh-111545 added Py_GetConstant() and Py_GetConstantBorrowed() // to Python 3.13.0a6 #if PY_VERSION_HEX < 0x030D00A6 && !defined(Py_CONSTANT_NONE) #define Py_CONSTANT_NONE 0 #define Py_CONSTANT_FALSE 1 #define Py_CONSTANT_TRUE 2 #define Py_CONSTANT_ELLIPSIS 3 #define Py_CONSTANT_NOT_IMPLEMENTED 4 #define Py_CONSTANT_ZERO 5 #define Py_CONSTANT_ONE 6 #define Py_CONSTANT_EMPTY_STR 7 #define Py_CONSTANT_EMPTY_BYTES 8 #define Py_CONSTANT_EMPTY_TUPLE 9 static inline PyObject* Py_GetConstant(unsigned int constant_id) { static PyObject* constants[Py_CONSTANT_EMPTY_TUPLE + 1] = {NULL}; if (constants[Py_CONSTANT_NONE] == NULL) { constants[Py_CONSTANT_NONE] = Py_None; constants[Py_CONSTANT_FALSE] = Py_False; constants[Py_CONSTANT_TRUE] = Py_True; constants[Py_CONSTANT_ELLIPSIS] = Py_Ellipsis; constants[Py_CONSTANT_NOT_IMPLEMENTED] = Py_NotImplemented; constants[Py_CONSTANT_ZERO] = PyLong_FromLong(0); if (constants[Py_CONSTANT_ZERO] == NULL) { goto fatal_error; } constants[Py_CONSTANT_ONE] = PyLong_FromLong(1); if (constants[Py_CONSTANT_ONE] == NULL) { goto fatal_error; } constants[Py_CONSTANT_EMPTY_STR] = PyUnicode_FromStringAndSize("", 0); if (constants[Py_CONSTANT_EMPTY_STR] == NULL) { goto fatal_error; } constants[Py_CONSTANT_EMPTY_BYTES] = PyBytes_FromStringAndSize("", 0); if (constants[Py_CONSTANT_EMPTY_BYTES] == NULL) { goto fatal_error; } constants[Py_CONSTANT_EMPTY_TUPLE] = PyTuple_New(0); if (constants[Py_CONSTANT_EMPTY_TUPLE] == NULL) { goto fatal_error; } // goto dance to avoid compiler warnings about Py_FatalError() goto init_done; fatal_error: // This case should never happen Py_FatalError("Py_GetConstant() failed to get constants"); } init_done: if (constant_id <= Py_CONSTANT_EMPTY_TUPLE) { return Py_NewRef(constants[constant_id]); } else { PyErr_BadInternalCall(); return NULL; } } static inline PyObject* Py_GetConstantBorrowed(unsigned int constant_id) { PyObject *obj = Py_GetConstant(constant_id); Py_XDECREF(obj); return obj; } #endif // gh-114329 added PyList_GetItemRef() to Python 3.13.0a4 #if PY_VERSION_HEX < 0x030D00A4 static inline PyObject * PyList_GetItemRef(PyObject *op, Py_ssize_t index) { PyObject *item = PyList_GetItem(op, index); Py_XINCREF(item); return item; } #endif // gh-114329 added PyList_GetItemRef() to Python 3.13.0a4 #if PY_VERSION_HEX < 0x030D00A4 static inline int PyDict_SetDefaultRef(PyObject *d, PyObject *key, PyObject *default_value, PyObject **result) { PyObject *value; if (PyDict_GetItemRef(d, key, &value) < 0) { // get error if (result) { *result = NULL; } return -1; } if (value != NULL) { // present if (result) { *result = value; } else { Py_DECREF(value); } return 1; } // missing: set the item if (PyDict_SetItem(d, key, default_value) < 0) { // set error if (result) { *result = NULL; } return -1; } if (result) { *result = Py_NewRef(default_value); } return 0; } #endif #if PY_VERSION_HEX < 0x030D00B3 # define Py_BEGIN_CRITICAL_SECTION(op) { # define Py_END_CRITICAL_SECTION() } # define Py_BEGIN_CRITICAL_SECTION2(a, b) { # define Py_END_CRITICAL_SECTION2() } #endif #if PY_VERSION_HEX < 0x030E0000 && PY_VERSION_HEX >= 0x03060000 && !defined(PYPY_VERSION) typedef struct PyUnicodeWriter PyUnicodeWriter; static inline void PyUnicodeWriter_Discard(PyUnicodeWriter *writer) { _PyUnicodeWriter_Dealloc((_PyUnicodeWriter*)writer); PyMem_Free(writer); } static inline PyUnicodeWriter* PyUnicodeWriter_Create(Py_ssize_t length) { if (length < 0) { PyErr_SetString(PyExc_ValueError, "length must be positive"); return NULL; } const size_t size = sizeof(_PyUnicodeWriter); PyUnicodeWriter *pub_writer = (PyUnicodeWriter *)PyMem_Malloc(size); if (pub_writer == _Py_NULL) { PyErr_NoMemory(); return _Py_NULL; } _PyUnicodeWriter *writer = (_PyUnicodeWriter *)pub_writer; _PyUnicodeWriter_Init(writer); if (_PyUnicodeWriter_Prepare(writer, length, 127) < 0) { PyUnicodeWriter_Discard(pub_writer); return NULL; } writer->overallocate = 1; return pub_writer; } static inline PyObject* PyUnicodeWriter_Finish(PyUnicodeWriter *writer) { PyObject *str = _PyUnicodeWriter_Finish((_PyUnicodeWriter*)writer); assert(((_PyUnicodeWriter*)writer)->buffer == NULL); PyMem_Free(writer); return str; } static inline int PyUnicodeWriter_WriteChar(PyUnicodeWriter *writer, Py_UCS4 ch) { if (ch > 0x10ffff) { PyErr_SetString(PyExc_ValueError, "character must be in range(0x110000)"); return -1; } return _PyUnicodeWriter_WriteChar((_PyUnicodeWriter*)writer, ch); } static inline int PyUnicodeWriter_WriteStr(PyUnicodeWriter *writer, PyObject *obj) { PyObject *str = PyObject_Str(obj); if (str == NULL) { return -1; } int res = _PyUnicodeWriter_WriteStr((_PyUnicodeWriter*)writer, str); Py_DECREF(str); return res; } static inline int PyUnicodeWriter_WriteRepr(PyUnicodeWriter *writer, PyObject *obj) { PyObject *str = PyObject_Repr(obj); if (str == NULL) { return -1; } int res = _PyUnicodeWriter_WriteStr((_PyUnicodeWriter*)writer, str); Py_DECREF(str); return res; } static inline int PyUnicodeWriter_WriteUTF8(PyUnicodeWriter *writer, const char *str, Py_ssize_t size) { if (size < 0) { size = (Py_ssize_t)strlen(str); } PyObject *str_obj = PyUnicode_FromStringAndSize(str, size); if (str_obj == _Py_NULL) { return -1; } int res = _PyUnicodeWriter_WriteStr((_PyUnicodeWriter*)writer, str_obj); Py_DECREF(str_obj); return res; } static inline int PyUnicodeWriter_WriteASCII(PyUnicodeWriter *writer, const char *str, Py_ssize_t size) { if (size < 0) { size = (Py_ssize_t)strlen(str); } return _PyUnicodeWriter_WriteASCIIString((_PyUnicodeWriter*)writer, str, size); } static inline int PyUnicodeWriter_WriteWideChar(PyUnicodeWriter *writer, const wchar_t *str, Py_ssize_t size) { if (size < 0) { size = (Py_ssize_t)wcslen(str); } PyObject *str_obj = PyUnicode_FromWideChar(str, size); if (str_obj == _Py_NULL) { return -1; } int res = _PyUnicodeWriter_WriteStr((_PyUnicodeWriter*)writer, str_obj); Py_DECREF(str_obj); return res; } static inline int PyUnicodeWriter_WriteSubstring(PyUnicodeWriter *writer, PyObject *str, Py_ssize_t start, Py_ssize_t end) { if (!PyUnicode_Check(str)) { PyErr_Format(PyExc_TypeError, "expect str, not %s", Py_TYPE(str)->tp_name); return -1; } if (start < 0 || start > end) { PyErr_Format(PyExc_ValueError, "invalid start argument"); return -1; } if (end > PyUnicode_GET_LENGTH(str)) { PyErr_Format(PyExc_ValueError, "invalid end argument"); return -1; } return _PyUnicodeWriter_WriteSubstring((_PyUnicodeWriter*)writer, str, start, end); } static inline int PyUnicodeWriter_Format(PyUnicodeWriter *writer, const char *format, ...) { va_list vargs; va_start(vargs, format); PyObject *str = PyUnicode_FromFormatV(format, vargs); va_end(vargs); if (str == _Py_NULL) { return -1; } int res = _PyUnicodeWriter_WriteStr((_PyUnicodeWriter*)writer, str); Py_DECREF(str); return res; } #endif // PY_VERSION_HEX < 0x030E0000 // gh-116560 added PyLong_GetSign() to Python 3.14.0a0 #if PY_VERSION_HEX < 0x030E00A0 static inline int PyLong_GetSign(PyObject *obj, int *sign) { if (!PyLong_Check(obj)) { PyErr_Format(PyExc_TypeError, "expect int, got %s", Py_TYPE(obj)->tp_name); return -1; } *sign = _PyLong_Sign(obj); return 0; } #endif // gh-126061 added PyLong_IsPositive/Negative/Zero() to Python in 3.14.0a2 #if PY_VERSION_HEX < 0x030E00A2 static inline int PyLong_IsPositive(PyObject *obj) { if (!PyLong_Check(obj)) { PyErr_Format(PyExc_TypeError, "expected int, got %s", Py_TYPE(obj)->tp_name); return -1; } return _PyLong_Sign(obj) == 1; } static inline int PyLong_IsNegative(PyObject *obj) { if (!PyLong_Check(obj)) { PyErr_Format(PyExc_TypeError, "expected int, got %s", Py_TYPE(obj)->tp_name); return -1; } return _PyLong_Sign(obj) == -1; } static inline int PyLong_IsZero(PyObject *obj) { if (!PyLong_Check(obj)) { PyErr_Format(PyExc_TypeError, "expected int, got %s", Py_TYPE(obj)->tp_name); return -1; } return _PyLong_Sign(obj) == 0; } #endif // gh-124502 added PyUnicode_Equal() to Python 3.14.0a0 #if PY_VERSION_HEX < 0x030E00A0 static inline int PyUnicode_Equal(PyObject *str1, PyObject *str2) { if (!PyUnicode_Check(str1)) { PyErr_Format(PyExc_TypeError, "first argument must be str, not %s", Py_TYPE(str1)->tp_name); return -1; } if (!PyUnicode_Check(str2)) { PyErr_Format(PyExc_TypeError, "second argument must be str, not %s", Py_TYPE(str2)->tp_name); return -1; } #if PY_VERSION_HEX >= 0x030d0000 && !defined(PYPY_VERSION) PyAPI_FUNC(int) _PyUnicode_Equal(PyObject *str1, PyObject *str2); return _PyUnicode_Equal(str1, str2); #elif PY_VERSION_HEX >= 0x03060000 && !defined(PYPY_VERSION) return _PyUnicode_EQ(str1, str2); #elif PY_VERSION_HEX >= 0x03090000 && defined(PYPY_VERSION) return _PyUnicode_EQ(str1, str2); #else return (PyUnicode_Compare(str1, str2) == 0); #endif } #endif // gh-121645 added PyBytes_Join() to Python 3.14.0a0 #if PY_VERSION_HEX < 0x030E00A0 static inline PyObject* PyBytes_Join(PyObject *sep, PyObject *iterable) { return _PyBytes_Join(sep, iterable); } #endif #if PY_VERSION_HEX < 0x030E00A0 static inline Py_hash_t Py_HashBuffer(const void *ptr, Py_ssize_t len) { #if PY_VERSION_HEX >= 0x03000000 && !defined(PYPY_VERSION) PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void *src, Py_ssize_t len); return _Py_HashBytes(ptr, len); #else Py_hash_t hash; PyObject *bytes = PyBytes_FromStringAndSize((const char*)ptr, len); if (bytes == NULL) { return -1; } hash = PyObject_Hash(bytes); Py_DECREF(bytes); return hash; #endif } #endif #if PY_VERSION_HEX < 0x030E00A0 static inline int PyIter_NextItem(PyObject *iter, PyObject **item) { iternextfunc tp_iternext; assert(iter != NULL); assert(item != NULL); tp_iternext = Py_TYPE(iter)->tp_iternext; if (tp_iternext == NULL) { *item = NULL; PyErr_Format(PyExc_TypeError, "expected an iterator, got '%s'", Py_TYPE(iter)->tp_name); return -1; } if ((*item = tp_iternext(iter))) { return 1; } if (!PyErr_Occurred()) { return 0; } if (PyErr_ExceptionMatches(PyExc_StopIteration)) { PyErr_Clear(); return 0; } return -1; } #endif #if PY_VERSION_HEX < 0x030E00A0 static inline PyObject* PyLong_FromInt32(int32_t value) { Py_BUILD_ASSERT(sizeof(long) >= 4); return PyLong_FromLong(value); } static inline PyObject* PyLong_FromInt64(int64_t value) { Py_BUILD_ASSERT(sizeof(long long) >= 8); return PyLong_FromLongLong(value); } static inline PyObject* PyLong_FromUInt32(uint32_t value) { Py_BUILD_ASSERT(sizeof(unsigned long) >= 4); return PyLong_FromUnsignedLong(value); } static inline PyObject* PyLong_FromUInt64(uint64_t value) { Py_BUILD_ASSERT(sizeof(unsigned long long) >= 8); return PyLong_FromUnsignedLongLong(value); } static inline int PyLong_AsInt32(PyObject *obj, int32_t *pvalue) { Py_BUILD_ASSERT(sizeof(int) == 4); int value = PyLong_AsInt(obj); if (value == -1 && PyErr_Occurred()) { return -1; } *pvalue = (int32_t)value; return 0; } static inline int PyLong_AsInt64(PyObject *obj, int64_t *pvalue) { Py_BUILD_ASSERT(sizeof(long long) == 8); long long value = PyLong_AsLongLong(obj); if (value == -1 && PyErr_Occurred()) { return -1; } *pvalue = (int64_t)value; return 0; } static inline int PyLong_AsUInt32(PyObject *obj, uint32_t *pvalue) { Py_BUILD_ASSERT(sizeof(long) >= 4); unsigned long value = PyLong_AsUnsignedLong(obj); if (value == (unsigned long)-1 && PyErr_Occurred()) { return -1; } #if SIZEOF_LONG > 4 if ((unsigned long)UINT32_MAX < value) { PyErr_SetString(PyExc_OverflowError, "Python int too large to convert to C uint32_t"); return -1; } #endif *pvalue = (uint32_t)value; return 0; } static inline int PyLong_AsUInt64(PyObject *obj, uint64_t *pvalue) { Py_BUILD_ASSERT(sizeof(long long) == 8); unsigned long long value = PyLong_AsUnsignedLongLong(obj); if (value == (unsigned long long)-1 && PyErr_Occurred()) { return -1; } *pvalue = (uint64_t)value; return 0; } #endif // gh-102471 added import and export API for integers to 3.14.0a2. #if PY_VERSION_HEX < 0x030E00A2 && PY_VERSION_HEX >= 0x03000000 && !defined(PYPY_VERSION) // Helpers to access PyLongObject internals. static inline void _PyLong_SetSignAndDigitCount(PyLongObject *op, int sign, Py_ssize_t size) { #if PY_VERSION_HEX >= 0x030C0000 op->long_value.lv_tag = (uintptr_t)(1 - sign) | ((uintptr_t)(size) << 3); #elif PY_VERSION_HEX >= 0x030900A4 Py_SET_SIZE(op, sign * size); #else Py_SIZE(op) = sign * size; #endif } static inline Py_ssize_t _PyLong_DigitCount(const PyLongObject *op) { #if PY_VERSION_HEX >= 0x030C0000 return (Py_ssize_t)(op->long_value.lv_tag >> 3); #else return _PyLong_Sign((PyObject*)op) < 0 ? -Py_SIZE(op) : Py_SIZE(op); #endif } static inline digit* _PyLong_GetDigits(const PyLongObject *op) { #if PY_VERSION_HEX >= 0x030C0000 return (digit*)(op->long_value.ob_digit); #else return (digit*)(op->ob_digit); #endif } typedef struct PyLongLayout { uint8_t bits_per_digit; uint8_t digit_size; int8_t digits_order; int8_t digit_endianness; } PyLongLayout; typedef struct PyLongExport { int64_t value; uint8_t negative; Py_ssize_t ndigits; const void *digits; Py_uintptr_t _reserved; } PyLongExport; typedef struct PyLongWriter PyLongWriter; static inline const PyLongLayout* PyLong_GetNativeLayout(void) { static const PyLongLayout PyLong_LAYOUT = { PyLong_SHIFT, sizeof(digit), -1, // least significant first PY_LITTLE_ENDIAN ? -1 : 1, }; return &PyLong_LAYOUT; } static inline int PyLong_Export(PyObject *obj, PyLongExport *export_long) { if (!PyLong_Check(obj)) { memset(export_long, 0, sizeof(*export_long)); PyErr_Format(PyExc_TypeError, "expected int, got %s", Py_TYPE(obj)->tp_name); return -1; } // Fast-path: try to convert to a int64_t PyLongObject *self = (PyLongObject*)obj; int overflow; #if SIZEOF_LONG == 8 long value = PyLong_AsLongAndOverflow(obj, &overflow); #else // Windows has 32-bit long, so use 64-bit long long instead long long value = PyLong_AsLongLongAndOverflow(obj, &overflow); #endif Py_BUILD_ASSERT(sizeof(value) == sizeof(int64_t)); // the function cannot fail since obj is a PyLongObject assert(!(value == -1 && PyErr_Occurred())); if (!overflow) { export_long->value = value; export_long->negative = 0; export_long->ndigits = 0; export_long->digits = 0; export_long->_reserved = 0; } else { export_long->value = 0; export_long->negative = _PyLong_Sign(obj) < 0; export_long->ndigits = _PyLong_DigitCount(self); if (export_long->ndigits == 0) { export_long->ndigits = 1; } export_long->digits = _PyLong_GetDigits(self); export_long->_reserved = (Py_uintptr_t)Py_NewRef(obj); } return 0; } static inline void PyLong_FreeExport(PyLongExport *export_long) { PyObject *obj = (PyObject*)export_long->_reserved; if (obj) { export_long->_reserved = 0; Py_DECREF(obj); } } static inline PyLongWriter* PyLongWriter_Create(int negative, Py_ssize_t ndigits, void **digits) { if (ndigits <= 0) { PyErr_SetString(PyExc_ValueError, "ndigits must be positive"); return NULL; } assert(digits != NULL); PyLongObject *obj = _PyLong_New(ndigits); if (obj == NULL) { return NULL; } _PyLong_SetSignAndDigitCount(obj, negative?-1:1, ndigits); *digits = _PyLong_GetDigits(obj); return (PyLongWriter*)obj; } static inline void PyLongWriter_Discard(PyLongWriter *writer) { PyLongObject *obj = (PyLongObject *)writer; assert(Py_REFCNT(obj) == 1); Py_DECREF(obj); } static inline PyObject* PyLongWriter_Finish(PyLongWriter *writer) { PyObject *obj = (PyObject *)writer; PyLongObject *self = (PyLongObject*)obj; Py_ssize_t j = _PyLong_DigitCount(self); Py_ssize_t i = j; int sign = _PyLong_Sign(obj); assert(Py_REFCNT(obj) == 1); // Normalize and get singleton if possible while (i > 0 && _PyLong_GetDigits(self)[i-1] == 0) { --i; } if (i != j) { if (i == 0) { sign = 0; } _PyLong_SetSignAndDigitCount(self, sign, i); } if (i <= 1) { long val = sign * (long)(_PyLong_GetDigits(self)[0]); Py_DECREF(obj); return PyLong_FromLong(val); } return obj; } #endif #if PY_VERSION_HEX < 0x030C00A3 # define Py_T_SHORT T_SHORT # define Py_T_INT T_INT # define Py_T_LONG T_LONG # define Py_T_FLOAT T_FLOAT # define Py_T_DOUBLE T_DOUBLE # define Py_T_STRING T_STRING # define _Py_T_OBJECT T_OBJECT # define Py_T_CHAR T_CHAR # define Py_T_BYTE T_BYTE # define Py_T_UBYTE T_UBYTE # define Py_T_USHORT T_USHORT # define Py_T_UINT T_UINT # define Py_T_ULONG T_ULONG # define Py_T_STRING_INPLACE T_STRING_INPLACE # define Py_T_BOOL T_BOOL # define Py_T_OBJECT_EX T_OBJECT_EX # define Py_T_LONGLONG T_LONGLONG # define Py_T_ULONGLONG T_ULONGLONG # define Py_T_PYSSIZET T_PYSSIZET # if PY_VERSION_HEX >= 0x03000000 && !defined(PYPY_VERSION) # define _Py_T_NONE T_NONE # endif # define Py_READONLY READONLY # define Py_AUDIT_READ READ_RESTRICTED # define _Py_WRITE_RESTRICTED PY_WRITE_RESTRICTED #endif // gh-127350 added Py_fopen() and Py_fclose() to Python 3.14a4 #if PY_VERSION_HEX < 0x030E00A4 static inline FILE* Py_fopen(PyObject *path, const char *mode) { #if 0x030400A2 <= PY_VERSION_HEX && !defined(PYPY_VERSION) PyAPI_FUNC(FILE*) _Py_fopen_obj(PyObject *path, const char *mode); return _Py_fopen_obj(path, mode); #else FILE *f; PyObject *bytes; #if PY_VERSION_HEX >= 0x03000000 if (!PyUnicode_FSConverter(path, &bytes)) { return NULL; } #else if (!PyString_Check(path)) { PyErr_SetString(PyExc_TypeError, "except str"); return NULL; } bytes = Py_NewRef(path); #endif const char *path_bytes = PyBytes_AS_STRING(bytes); f = fopen(path_bytes, mode); Py_DECREF(bytes); if (f == NULL) { PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path); return NULL; } return f; #endif } static inline int Py_fclose(FILE *file) { return fclose(file); } #endif #if 0x03090000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x030E0000 && !defined(PYPY_VERSION) static inline PyObject* PyConfig_Get(const char *name) { typedef enum { _PyConfig_MEMBER_INT, _PyConfig_MEMBER_UINT, _PyConfig_MEMBER_ULONG, _PyConfig_MEMBER_BOOL, _PyConfig_MEMBER_WSTR, _PyConfig_MEMBER_WSTR_OPT, _PyConfig_MEMBER_WSTR_LIST, } PyConfigMemberType; typedef struct { const char *name; size_t offset; PyConfigMemberType type; const char *sys_attr; } PyConfigSpec; #define PYTHONCAPI_COMPAT_SPEC(MEMBER, TYPE, sys_attr) \ {#MEMBER, offsetof(PyConfig, MEMBER), \ _PyConfig_MEMBER_##TYPE, sys_attr} static const PyConfigSpec config_spec[] = { PYTHONCAPI_COMPAT_SPEC(argv, WSTR_LIST, "argv"), PYTHONCAPI_COMPAT_SPEC(base_exec_prefix, WSTR_OPT, "base_exec_prefix"), PYTHONCAPI_COMPAT_SPEC(base_executable, WSTR_OPT, "_base_executable"), PYTHONCAPI_COMPAT_SPEC(base_prefix, WSTR_OPT, "base_prefix"), PYTHONCAPI_COMPAT_SPEC(bytes_warning, UINT, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(exec_prefix, WSTR_OPT, "exec_prefix"), PYTHONCAPI_COMPAT_SPEC(executable, WSTR_OPT, "executable"), PYTHONCAPI_COMPAT_SPEC(inspect, BOOL, _Py_NULL), #if 0x030C0000 <= PY_VERSION_HEX PYTHONCAPI_COMPAT_SPEC(int_max_str_digits, UINT, _Py_NULL), #endif PYTHONCAPI_COMPAT_SPEC(interactive, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(module_search_paths, WSTR_LIST, "path"), PYTHONCAPI_COMPAT_SPEC(optimization_level, UINT, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(parser_debug, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(platlibdir, WSTR, "platlibdir"), PYTHONCAPI_COMPAT_SPEC(prefix, WSTR_OPT, "prefix"), PYTHONCAPI_COMPAT_SPEC(pycache_prefix, WSTR_OPT, "pycache_prefix"), PYTHONCAPI_COMPAT_SPEC(quiet, BOOL, _Py_NULL), #if 0x030B0000 <= PY_VERSION_HEX PYTHONCAPI_COMPAT_SPEC(stdlib_dir, WSTR_OPT, "_stdlib_dir"), #endif PYTHONCAPI_COMPAT_SPEC(use_environment, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(verbose, UINT, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(warnoptions, WSTR_LIST, "warnoptions"), PYTHONCAPI_COMPAT_SPEC(write_bytecode, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(xoptions, WSTR_LIST, "_xoptions"), PYTHONCAPI_COMPAT_SPEC(buffered_stdio, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(check_hash_pycs_mode, WSTR, _Py_NULL), #if 0x030B0000 <= PY_VERSION_HEX PYTHONCAPI_COMPAT_SPEC(code_debug_ranges, BOOL, _Py_NULL), #endif PYTHONCAPI_COMPAT_SPEC(configure_c_stdio, BOOL, _Py_NULL), #if 0x030D0000 <= PY_VERSION_HEX PYTHONCAPI_COMPAT_SPEC(cpu_count, INT, _Py_NULL), #endif PYTHONCAPI_COMPAT_SPEC(dev_mode, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(dump_refs, BOOL, _Py_NULL), #if 0x030B0000 <= PY_VERSION_HEX PYTHONCAPI_COMPAT_SPEC(dump_refs_file, WSTR_OPT, _Py_NULL), #endif #ifdef Py_GIL_DISABLED PYTHONCAPI_COMPAT_SPEC(enable_gil, INT, _Py_NULL), #endif PYTHONCAPI_COMPAT_SPEC(faulthandler, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(filesystem_encoding, WSTR, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(filesystem_errors, WSTR, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(hash_seed, ULONG, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(home, WSTR_OPT, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(import_time, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(install_signal_handlers, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(isolated, BOOL, _Py_NULL), #ifdef MS_WINDOWS PYTHONCAPI_COMPAT_SPEC(legacy_windows_stdio, BOOL, _Py_NULL), #endif PYTHONCAPI_COMPAT_SPEC(malloc_stats, BOOL, _Py_NULL), #if 0x030A0000 <= PY_VERSION_HEX PYTHONCAPI_COMPAT_SPEC(orig_argv, WSTR_LIST, "orig_argv"), #endif PYTHONCAPI_COMPAT_SPEC(parse_argv, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(pathconfig_warnings, BOOL, _Py_NULL), #if 0x030C0000 <= PY_VERSION_HEX PYTHONCAPI_COMPAT_SPEC(perf_profiling, UINT, _Py_NULL), #endif PYTHONCAPI_COMPAT_SPEC(program_name, WSTR, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(run_command, WSTR_OPT, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(run_filename, WSTR_OPT, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(run_module, WSTR_OPT, _Py_NULL), #if 0x030B0000 <= PY_VERSION_HEX PYTHONCAPI_COMPAT_SPEC(safe_path, BOOL, _Py_NULL), #endif PYTHONCAPI_COMPAT_SPEC(show_ref_count, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(site_import, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(skip_source_first_line, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(stdio_encoding, WSTR, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(stdio_errors, WSTR, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(tracemalloc, UINT, _Py_NULL), #if 0x030B0000 <= PY_VERSION_HEX PYTHONCAPI_COMPAT_SPEC(use_frozen_modules, BOOL, _Py_NULL), #endif PYTHONCAPI_COMPAT_SPEC(use_hash_seed, BOOL, _Py_NULL), PYTHONCAPI_COMPAT_SPEC(user_site_directory, BOOL, _Py_NULL), #if 0x030A0000 <= PY_VERSION_HEX PYTHONCAPI_COMPAT_SPEC(warn_default_encoding, BOOL, _Py_NULL), #endif }; #undef PYTHONCAPI_COMPAT_SPEC const PyConfigSpec *spec; int found = 0; for (size_t i=0; i < sizeof(config_spec) / sizeof(config_spec[0]); i++) { spec = &config_spec[i]; if (strcmp(spec->name, name) == 0) { found = 1; break; } } if (found) { if (spec->sys_attr != NULL) { PyObject *value = PySys_GetObject(spec->sys_attr); if (value == NULL) { PyErr_Format(PyExc_RuntimeError, "lost sys.%s", spec->sys_attr); return NULL; } return Py_NewRef(value); } PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void); const PyConfig *config = _Py_GetConfig(); void *member = (char *)config + spec->offset; switch (spec->type) { case _PyConfig_MEMBER_INT: case _PyConfig_MEMBER_UINT: { int value = *(int *)member; return PyLong_FromLong(value); } case _PyConfig_MEMBER_BOOL: { int value = *(int *)member; return PyBool_FromLong(value != 0); } case _PyConfig_MEMBER_ULONG: { unsigned long value = *(unsigned long *)member; return PyLong_FromUnsignedLong(value); } case _PyConfig_MEMBER_WSTR: case _PyConfig_MEMBER_WSTR_OPT: { wchar_t *wstr = *(wchar_t **)member; if (wstr != NULL) { return PyUnicode_FromWideChar(wstr, -1); } else { return Py_NewRef(Py_None); } } case _PyConfig_MEMBER_WSTR_LIST: { const PyWideStringList *list = (const PyWideStringList *)member; PyObject *tuple = PyTuple_New(list->length); if (tuple == NULL) { return NULL; } for (Py_ssize_t i = 0; i < list->length; i++) { PyObject *item = PyUnicode_FromWideChar(list->items[i], -1); if (item == NULL) { Py_DECREF(tuple); return NULL; } PyTuple_SET_ITEM(tuple, i, item); } return tuple; } default: Py_UNREACHABLE(); } } PyErr_Format(PyExc_ValueError, "unknown config option name: %s", name); return NULL; } static inline int PyConfig_GetInt(const char *name, int *value) { PyObject *obj = PyConfig_Get(name); if (obj == NULL) { return -1; } if (!PyLong_Check(obj)) { Py_DECREF(obj); PyErr_Format(PyExc_TypeError, "config option %s is not an int", name); return -1; } int as_int = PyLong_AsInt(obj); Py_DECREF(obj); if (as_int == -1 && PyErr_Occurred()) { PyErr_Format(PyExc_OverflowError, "config option %s value does not fit into a C int", name); return -1; } *value = as_int; return 0; } #endif // PY_VERSION_HEX > 0x03090000 && !defined(PYPY_VERSION) // gh-133144 added PyUnstable_Object_IsUniquelyReferenced() to Python 3.14.0b1. // Adapted from _PyObject_IsUniquelyReferenced() implementation. #if PY_VERSION_HEX < 0x030E00B0 static inline int PyUnstable_Object_IsUniquelyReferenced(PyObject *obj) { #if !defined(Py_GIL_DISABLED) return Py_REFCNT(obj) == 1; #else // NOTE: the entire ob_ref_shared field must be zero, including flags, to // ensure that other threads cannot concurrently create new references to // this object. return (_Py_IsOwnedByCurrentThread(obj) && _Py_atomic_load_uint32_relaxed(&obj->ob_ref_local) == 1 && _Py_atomic_load_ssize_relaxed(&obj->ob_ref_shared) == 0); #endif } #endif #if PY_VERSION_HEX < 0x030F0000 static inline PyObject* PySys_GetAttrString(const char *name) { #if PY_VERSION_HEX >= 0x03000000 PyObject *value = Py_XNewRef(PySys_GetObject(name)); #else PyObject *value = Py_XNewRef(PySys_GetObject((char*)name)); #endif if (value != NULL) { return value; } if (!PyErr_Occurred()) { PyErr_Format(PyExc_RuntimeError, "lost sys.%s", name); } return NULL; } static inline PyObject* PySys_GetAttr(PyObject *name) { #if PY_VERSION_HEX >= 0x03000000 const char *name_str = PyUnicode_AsUTF8(name); #else const char *name_str = PyString_AsString(name); #endif if (name_str == NULL) { return NULL; } return PySys_GetAttrString(name_str); } static inline int PySys_GetOptionalAttrString(const char *name, PyObject **value) { #if PY_VERSION_HEX >= 0x03000000 *value = Py_XNewRef(PySys_GetObject(name)); #else *value = Py_XNewRef(PySys_GetObject((char*)name)); #endif if (*value != NULL) { return 1; } return 0; } static inline int PySys_GetOptionalAttr(PyObject *name, PyObject **value) { #if PY_VERSION_HEX >= 0x03000000 const char *name_str = PyUnicode_AsUTF8(name); #else const char *name_str = PyString_AsString(name); #endif if (name_str == NULL) { *value = NULL; return -1; } return PySys_GetOptionalAttrString(name_str, value); } #endif // PY_VERSION_HEX < 0x030F00A1 #if PY_VERSION_HEX < 0x030F00A1 typedef struct PyBytesWriter { char small_buffer[256]; PyObject *obj; Py_ssize_t size; } PyBytesWriter; static inline Py_ssize_t _PyBytesWriter_GetAllocated(PyBytesWriter *writer) { if (writer->obj == NULL) { return sizeof(writer->small_buffer); } else { return PyBytes_GET_SIZE(writer->obj); } } static inline int _PyBytesWriter_Resize_impl(PyBytesWriter *writer, Py_ssize_t size, int resize) { int overallocate = resize; assert(size >= 0); if (size <= _PyBytesWriter_GetAllocated(writer)) { return 0; } if (overallocate) { #ifdef MS_WINDOWS /* On Windows, overallocate by 50% is the best factor */ if (size <= (PY_SSIZE_T_MAX - size / 2)) { size += size / 2; } #else /* On Linux, overallocate by 25% is the best factor */ if (size <= (PY_SSIZE_T_MAX - size / 4)) { size += size / 4; } #endif } if (writer->obj != NULL) { if (_PyBytes_Resize(&writer->obj, size)) { return -1; } assert(writer->obj != NULL); } else { writer->obj = PyBytes_FromStringAndSize(NULL, size); if (writer->obj == NULL) { return -1; } if (resize) { assert((size_t)size > sizeof(writer->small_buffer)); memcpy(PyBytes_AS_STRING(writer->obj), writer->small_buffer, sizeof(writer->small_buffer)); } } return 0; } static inline void* PyBytesWriter_GetData(PyBytesWriter *writer) { if (writer->obj == NULL) { return writer->small_buffer; } else { return PyBytes_AS_STRING(writer->obj); } } static inline Py_ssize_t PyBytesWriter_GetSize(PyBytesWriter *writer) { return writer->size; } static inline void PyBytesWriter_Discard(PyBytesWriter *writer) { if (writer == NULL) { return; } Py_XDECREF(writer->obj); PyMem_Free(writer); } static inline PyBytesWriter* PyBytesWriter_Create(Py_ssize_t size) { if (size < 0) { PyErr_SetString(PyExc_ValueError, "size must be >= 0"); return NULL; } PyBytesWriter *writer = (PyBytesWriter*)PyMem_Malloc(sizeof(PyBytesWriter)); if (writer == NULL) { PyErr_NoMemory(); return NULL; } writer->obj = NULL; writer->size = 0; if (size >= 1) { if (_PyBytesWriter_Resize_impl(writer, size, 0) < 0) { PyBytesWriter_Discard(writer); return NULL; } writer->size = size; } return writer; } static inline PyObject* PyBytesWriter_FinishWithSize(PyBytesWriter *writer, Py_ssize_t size) { PyObject *result; if (size == 0) { result = PyBytes_FromStringAndSize("", 0); } else if (writer->obj != NULL) { if (size != PyBytes_GET_SIZE(writer->obj)) { if (_PyBytes_Resize(&writer->obj, size)) { goto error; } } result = writer->obj; writer->obj = NULL; } else { result = PyBytes_FromStringAndSize(writer->small_buffer, size); } PyBytesWriter_Discard(writer); return result; error: PyBytesWriter_Discard(writer); return NULL; } static inline PyObject* PyBytesWriter_Finish(PyBytesWriter *writer) { return PyBytesWriter_FinishWithSize(writer, writer->size); } static inline PyObject* PyBytesWriter_FinishWithPointer(PyBytesWriter *writer, void *buf) { Py_ssize_t size = (char*)buf - (char*)PyBytesWriter_GetData(writer); if (size < 0 || size > _PyBytesWriter_GetAllocated(writer)) { PyBytesWriter_Discard(writer); PyErr_SetString(PyExc_ValueError, "invalid end pointer"); return NULL; } return PyBytesWriter_FinishWithSize(writer, size); } static inline int PyBytesWriter_Resize(PyBytesWriter *writer, Py_ssize_t size) { if (size < 0) { PyErr_SetString(PyExc_ValueError, "size must be >= 0"); return -1; } if (_PyBytesWriter_Resize_impl(writer, size, 1) < 0) { return -1; } writer->size = size; return 0; } static inline int PyBytesWriter_Grow(PyBytesWriter *writer, Py_ssize_t size) { if (size < 0 && writer->size + size < 0) { PyErr_SetString(PyExc_ValueError, "invalid size"); return -1; } if (size > PY_SSIZE_T_MAX - writer->size) { PyErr_NoMemory(); return -1; } size = writer->size + size; if (_PyBytesWriter_Resize_impl(writer, size, 1) < 0) { return -1; } writer->size = size; return 0; } static inline void* PyBytesWriter_GrowAndUpdatePointer(PyBytesWriter *writer, Py_ssize_t size, void *buf) { Py_ssize_t pos = (char*)buf - (char*)PyBytesWriter_GetData(writer); if (PyBytesWriter_Grow(writer, size) < 0) { return NULL; } return (char*)PyBytesWriter_GetData(writer) + pos; } static inline int PyBytesWriter_WriteBytes(PyBytesWriter *writer, const void *bytes, Py_ssize_t size) { if (size < 0) { size_t len = strlen((const char*)bytes); if (len > (size_t)PY_SSIZE_T_MAX) { PyErr_NoMemory(); return -1; } size = (Py_ssize_t)len; } Py_ssize_t pos = writer->size; if (PyBytesWriter_Grow(writer, size) < 0) { return -1; } char *buf = (char*)PyBytesWriter_GetData(writer); memcpy(buf + pos, bytes, (size_t)size); return 0; } static inline int PyBytesWriter_Format(PyBytesWriter *writer, const char *format, ...) Py_GCC_ATTRIBUTE((format(printf, 2, 3))); static inline int PyBytesWriter_Format(PyBytesWriter *writer, const char *format, ...) { va_list vargs; va_start(vargs, format); PyObject *str = PyBytes_FromFormatV(format, vargs); va_end(vargs); if (str == NULL) { return -1; } int res = PyBytesWriter_WriteBytes(writer, PyBytes_AS_STRING(str), PyBytes_GET_SIZE(str)); Py_DECREF(str); return res; } #endif // PY_VERSION_HEX < 0x030F00A1 #ifdef __cplusplus } #endif #endif // PYTHONCAPI_COMPAT ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/record/pythoncapi_compat_extras.h0000644000175100017510000000365215111154235024754 0ustar00runnerrunner#ifndef PYTHONCAPI_COMPAT_EXTRAS #define PYTHONCAPI_COMPAT_EXTRAS #ifdef __cplusplus extern "C" { #endif #include // Python 3.11.0a6 added PyType_GetModuleByDef() to Python.h #if PY_VERSION_HEX < 0x030b00A6 PyObject * PyType_GetModuleByDef(PyTypeObject *type, PyModuleDef *def) { assert(PyType_Check(type)); if (!PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE)) { // type_ready_mro() ensures that no heap type is // contained in a static type MRO. goto error; } else { PyHeapTypeObject *ht = (PyHeapTypeObject*)type; PyObject *module = ht->ht_module; if (module && PyModule_GetDef(module) == def) { return module; } } PyObject *res = NULL; PyObject *mro = type->tp_mro; // The type must be ready assert(mro != NULL); assert(PyTuple_Check(mro)); // mro_invoke() ensures that the type MRO cannot be empty. assert(PyTuple_GET_SIZE(mro) >= 1); // Also, the first item in the MRO is the type itself, which // we already checked above. We skip it in the loop. assert(PyTuple_GET_ITEM(mro, 0) == (PyObject *)type); Py_ssize_t n = PyTuple_GET_SIZE(mro); for (Py_ssize_t i = 1; i < n; i++) { PyObject *super = PyTuple_GET_ITEM(mro, i); if (!PyType_HasFeature((PyTypeObject *)super, Py_TPFLAGS_HEAPTYPE)) { // Static types in the MRO need to be skipped continue; } PyHeapTypeObject *ht = (PyHeapTypeObject*)super; PyObject *module = ht->ht_module; if (module && PyModule_GetDef(module) == def) { res = module; break; } } if (res != NULL) { return res; } error: PyErr_Format( PyExc_TypeError, "PyType_GetModuleByDef: No superclass of '%s' has the given module", type->tp_name); return NULL; } #endif #ifdef __cplusplus } #endif #endif // PYTHONCAPI_COMPAT_EXTRAS ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/record/recordobj.c0000644000175100017510000010316715111154235021613 0ustar00runnerrunner/* 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 #include #include "pythoncapi_compat.h" #include "pythoncapi_compat_extras.h" #include "recordobj.h" #ifndef _PyCFunction_CAST #define _PyCFunction_CAST(func) ((PyCFunction)(void (*)(void))(func)) #endif static size_t ApgRecord_MAXSIZE = (((size_t)PY_SSIZE_T_MAX - sizeof(ApgRecordObject) - sizeof(PyObject *)) / sizeof(PyObject *)); /* 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 { ApgRecordObject *freelist[ApgRecord_MAXSAVESIZE]; int numfree[ApgRecord_MAXSAVESIZE]; } record_freelist_state; typedef struct { PyTypeObject *ApgRecord_Type; PyTypeObject *ApgRecordDesc_Type; PyTypeObject *ApgRecordIter_Type; PyTypeObject *ApgRecordItems_Type; Py_tss_t freelist_key; // TSS key for per-thread record_freelist_state } record_module_state; static inline record_module_state * get_module_state(PyObject *module) { void *state = PyModule_GetState(module); if (state == NULL) { PyErr_SetString(PyExc_SystemError, "failed to get record module state"); return NULL; } return (record_module_state *)state; } static inline record_module_state * get_module_state_from_type(PyTypeObject *type) { void *state = PyType_GetModuleState(type); if (state != NULL) { return (record_module_state *)state; } PyErr_Format(PyExc_SystemError, "could not get record module state from '%.100s'", type->tp_name); return NULL; } static struct PyModuleDef _recordmodule; static inline record_module_state * find_module_state_by_def(PyTypeObject *type) { PyObject *mod = PyType_GetModuleByDef(type, &_recordmodule); if (mod == NULL) return NULL; return get_module_state(mod); } static inline record_freelist_state * get_freelist_state(record_module_state *state) { record_freelist_state *freelist; freelist = (record_freelist_state *)PyThread_tss_get(&state->freelist_key); if (freelist == NULL) { freelist = (record_freelist_state *)PyMem_Calloc( 1, sizeof(record_freelist_state)); if (freelist == NULL) { PyErr_NoMemory(); return NULL; } if (PyThread_tss_set(&state->freelist_key, (void *)freelist) != 0) { PyMem_Free(freelist); PyErr_SetString( PyExc_SystemError, "failed to set thread-specific data"); return NULL; } } return freelist; } PyObject * make_record(PyTypeObject *type, PyObject *desc, Py_ssize_t size, record_module_state *state) { ApgRecordObject *o; Py_ssize_t i; int need_gc_track = 0; if (size < 0 || desc == NULL || Py_TYPE(desc) != state->ApgRecordDesc_Type) { PyErr_BadInternalCall(); return NULL; } if (type == state->ApgRecord_Type) { record_freelist_state *freelist = NULL; if (size < ApgRecord_MAXSAVESIZE) { freelist = get_freelist_state(state); if (freelist != NULL && freelist->freelist[size] != NULL) { o = freelist->freelist[size]; freelist->freelist[size] = (ApgRecordObject *)o->ob_item[0]; freelist->numfree[size]--; _Py_NewReference((PyObject *)o); } else { freelist = NULL; } } if (freelist == NULL) { if ((size_t)size > ApgRecord_MAXSIZE) { return PyErr_NoMemory(); } o = PyObject_GC_NewVar(ApgRecordObject, state->ApgRecord_Type, size); if (o == NULL) { return NULL; } } need_gc_track = 1; } else { assert(PyType_IsSubtype(type, state->ApgRecord_Type)); if ((size_t)size > ApgRecord_MAXSIZE) { return PyErr_NoMemory(); } o = (ApgRecordObject *)type->tp_alloc(type, size); if (!PyObject_GC_IsTracked((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(PyObject *self) { ApgRecordObject *o = (ApgRecordObject *)self; Py_ssize_t i; Py_ssize_t len = Py_SIZE(o); PyTypeObject *tp = Py_TYPE(o); record_module_state *state; int skip_dealloc = 0; state = find_module_state_by_def(tp); if (state == NULL) { return; } PyObject_GC_UnTrack(o); o->self_hash = -1; Py_CLEAR(o->desc); Py_TRASHCAN_BEGIN(o, record_dealloc) i = len; while (--i >= 0) { Py_XDECREF(o->ob_item[i]); } if (len < ApgRecord_MAXSAVESIZE && tp == state->ApgRecord_Type) { record_freelist_state *freelist = get_freelist_state(state); if (freelist != NULL && freelist->numfree[len] < ApgRecord_MAXFREELIST) { o->ob_item[0] = (PyObject *)freelist->freelist[len]; freelist->numfree[len]++; freelist->freelist[len] = o; skip_dealloc = 1; } } if (!skip_dealloc) { tp->tp_free(self); Py_DECREF(tp); } Py_TRASHCAN_END } static int record_traverse(PyObject *self, visitproc visit, void *arg) { ApgRecordObject *o = (ApgRecordObject *)self; for (Py_ssize_t i = Py_SIZE(o); --i >= 0;) { Py_VISIT(o->ob_item[i]); } return 0; } /* Below are the official constants from the xxHash specification. Optimizing compilers should emit a single "rotate" instruction for the _PyTuple_HASH_XXROTATE() expansion. If that doesn't happen for some important platform, the macro could be changed to expand to a platform-specific rotate spelling instead. */ #if SIZEOF_PY_UHASH_T > 4 #define _ApgRecord_HASH_XXPRIME_1 ((Py_uhash_t)11400714785074694791ULL) #define _ApgRecord_HASH_XXPRIME_2 ((Py_uhash_t)14029467366897019727ULL) #define _ApgRecord_HASH_XXPRIME_5 ((Py_uhash_t)2870177450012600261ULL) #define _ApgRecord_HASH_XXROTATE(x) ((x << 31) | (x >> 33)) /* Rotate left 31 bits */ #else #define _ApgRecord_HASH_XXPRIME_1 ((Py_uhash_t)2654435761UL) #define _ApgRecord_HASH_XXPRIME_2 ((Py_uhash_t)2246822519UL) #define _ApgRecord_HASH_XXPRIME_5 ((Py_uhash_t)374761393UL) #define _ApgRecord_HASH_XXROTATE(x) ((x << 13) | (x >> 19)) /* Rotate left 13 bits */ #endif static Py_hash_t record_hash(PyObject *op) { ApgRecordObject *v = (ApgRecordObject *)op; Py_uhash_t acc; Py_ssize_t len = Py_SIZE(v); PyObject **item = v->ob_item; acc = _ApgRecord_HASH_XXPRIME_5; for (Py_ssize_t i = 0; i < len; i++) { Py_uhash_t lane = (Py_uhash_t)PyObject_Hash(item[i]); if (lane == (Py_uhash_t)-1) { return -1; } acc += lane * _ApgRecord_HASH_XXPRIME_2; acc = _ApgRecord_HASH_XXROTATE(acc); acc *= _ApgRecord_HASH_XXPRIME_1; } /* Add input length, mangled to keep the historical value of hash(()). */ acc += (Py_uhash_t)len ^ (_ApgRecord_HASH_XXPRIME_5 ^ 3527539UL); if (acc == (Py_uhash_t)-1) { acc = 1546275796; } return (Py_hash_t)acc; } static Py_ssize_t record_length(PyObject *self) { ApgRecordObject *a = (ApgRecordObject *)self; return Py_SIZE(a); } static int record_contains(PyObject *self, PyObject *el) { ApgRecordObject *a = (ApgRecordObject *)self; if (a->desc == NULL || a->desc->keys == NULL) { return 0; } return PySequence_Contains(a->desc->keys, el); } static PyObject * record_item(ApgRecordObject *op, Py_ssize_t i) { ApgRecordObject *a = (ApgRecordObject *)op; if (i < 0 || i >= Py_SIZE(a)) { PyErr_SetString(PyExc_IndexError, "record index out of range"); return NULL; } return Py_NewRef(a->ob_item[i]); } 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; PyTypeObject *v_type = Py_TYPE(v); PyTypeObject *w_type = Py_TYPE(w); record_module_state *state; state = find_module_state_by_def(v_type); if (state == NULL) { PyErr_Clear(); state = find_module_state_by_def(w_type); } if (PyTuple_Check(v)) { v_is_tuple = 1; } else if (v_type == state->ApgRecord_Type) { v_is_record = 1; } else if (!PyObject_TypeCheck(v, state->ApgRecord_Type)) { Py_RETURN_NOTIMPLEMENTED; } if (PyTuple_Check(w)) { w_is_tuple = 1; } else if (w_type == state->ApgRecord_Type) { w_is_record = 1; } else if (!PyObject_TypeCheck(w, state->ApgRecord_Type)) { 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: Py_UNREACHABLE(); } 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 } 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(PyObject *op, PyObject *item) { ApgRecordObject *self = (ApgRecordObject *)op; 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(self); } return record_item(self, i); } else if (PySlice_Check(item)) { Py_ssize_t start, stop, step, cur, slicelength, i; PyObject *it; PyObject **src, **dest; if (PySlice_Unpack(item, &start, &stop, &step) < 0) { return NULL; } slicelength = PySlice_AdjustIndices(Py_SIZE(self), &start, &stop, step); if (slicelength <= 0) { return PyTuple_New(0); } else if (start == 0 && step == 1 && slicelength == Py_SIZE(self) && PyTuple_CheckExact(self)) { return Py_NewRef(self); } else { PyTupleObject *result = (PyTupleObject *)PyTuple_New(slicelength); if (!result) return NULL; src = self->ob_item; dest = result->ob_item; for (cur = start, i = 0; i < slicelength; cur += step, i++) { it = Py_NewRef(src[cur]); dest[i] = it; } return (PyObject *)result; } } else { PyObject *result; if (record_item_by_name(self, 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(PyObject *self) { ApgRecordObject *v = (ApgRecordObject *)self; Py_ssize_t i, n; PyObject *keys_iter; 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; } writer = PyUnicodeWriter_Create(12); /* */ if (PyUnicodeWriter_Format(writer, "<%s ", get_typename(Py_TYPE(v))) < 0) { goto error; } for (i = 0; i < n; ++i) { int res; PyObject *key; if (i > 0) if (PyUnicodeWriter_WriteChar(writer, ' ') < 0) goto error; key = PyIter_Next(keys_iter); if (key == NULL) { PyErr_SetString(PyExc_RuntimeError, "invalid record mapping"); goto error; } res = PyUnicodeWriter_WriteStr(writer, key); Py_DECREF(key); if (res < 0) goto error; if (PyUnicodeWriter_WriteChar(writer, '=') < 0) goto error; if (Py_EnterRecursiveCall(" while getting the repr of a record")) goto error; res = PyUnicodeWriter_WriteRepr(writer, v->ob_item[i]); Py_LeaveRecursiveCall(); if (res < 0) goto error; } 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_Discard(writer); Py_ReprLeave((PyObject *)v); return NULL; } static PyObject * record_new_iter(ApgRecordObject *, const record_module_state *); static PyObject * record_iter(PyObject *seq) { ApgRecordObject *r = (ApgRecordObject *)seq; record_module_state *state; state = find_module_state_by_def(Py_TYPE(seq)); if (state == NULL) { return NULL; } return record_new_iter(r, state); } static PyObject * record_values(PyObject *self, PyTypeObject *defcls, PyObject *const *args, size_t nargsf, PyObject *kwnames) { ApgRecordObject *r = (ApgRecordObject *)self; record_module_state *state = get_module_state_from_type(defcls); if (state == NULL) return NULL; return record_new_iter(r, state); } static PyObject * record_keys(PyObject *self, PyTypeObject *defcls, PyObject *const *args, size_t nargsf, PyObject *kwnames) { ApgRecordObject *r = (ApgRecordObject *)self; return PyObject_GetIter(r->desc->keys); } static PyObject * record_new_items_iter(ApgRecordObject *, const record_module_state *); static PyObject * record_items(PyObject *self, PyTypeObject *defcls, PyObject *const *args, size_t nargsf, PyObject *kwnames) { ApgRecordObject *r = (ApgRecordObject *)self; record_module_state *state = get_module_state_from_type(defcls); if (state == NULL) return NULL; return record_new_items_iter(r, state); } static PyObject * record_get(PyObject *self, PyTypeObject *defcls, PyObject *const *args, size_t nargsf, PyObject *kwnames) { Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); PyObject *key; PyObject *defval = Py_None; PyObject *val = NULL; int res; if (nargs == 2) { key = args[0]; defval = args[1]; } else if (nargs == 1) { key = args[0]; } else { PyErr_Format(PyExc_TypeError, "Record.get() expected 1 or 2 arguments, got %zd", nargs); } if (kwnames != NULL && PyTuple_GET_SIZE(kwnames) != 0) { PyErr_SetString(PyExc_TypeError, "Record.get() takes no keyword arguments"); return NULL; } res = record_item_by_name((ApgRecordObject *)self, key, &val); if (res == APG_ITEM_NOT_FOUND) { PyErr_Clear(); Py_INCREF(defval); val = defval; } return val; } static PyObject * record_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { record_module_state *state; state = get_module_state_from_type(type); if (state == NULL) { return NULL; } if (type == state->ApgRecord_Type) { PyErr_Format(PyExc_TypeError, "cannot create '%.100s' instances", type->tp_name); return NULL; } /* For subclasses, use the default allocation */ return type->tp_alloc(type, 0); } static PyMethodDef record_methods[] = { {"values", _PyCFunction_CAST(record_values), METH_METHOD | METH_FASTCALL | METH_KEYWORDS}, {"keys", _PyCFunction_CAST(record_keys), METH_METHOD | METH_FASTCALL | METH_KEYWORDS}, {"items", _PyCFunction_CAST(record_items), METH_METHOD | METH_FASTCALL | METH_KEYWORDS}, {"get", _PyCFunction_CAST(record_get), METH_METHOD | METH_FASTCALL | METH_KEYWORDS}, {NULL, NULL} /* sentinel */ }; static PyType_Slot ApgRecord_TypeSlots[] = { {Py_tp_dealloc, record_dealloc}, {Py_tp_repr, record_repr}, {Py_tp_hash, record_hash}, {Py_tp_getattro, PyObject_GenericGetAttr}, {Py_tp_traverse, record_traverse}, {Py_tp_richcompare, record_richcompare}, {Py_tp_iter, record_iter}, {Py_tp_methods, record_methods}, {Py_tp_new, record_new}, {Py_tp_free, PyObject_GC_Del}, {Py_sq_length, record_length}, {Py_sq_item, record_item}, {Py_sq_contains, record_contains}, {Py_mp_length, record_length}, {Py_mp_subscript, record_subscript}, {0, NULL}, }; #ifndef Py_TPFLAGS_IMMUTABLETYPE #define Py_TPFLAGS_IMMUTABLETYPE 0 #endif static PyType_Spec ApgRecord_TypeSpec = { .name = "asyncpg.protocol.record.Record", .basicsize = sizeof(ApgRecordObject) - sizeof(PyObject *), .itemsize = sizeof(PyObject *), .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_IMMUTABLETYPE), .slots = ApgRecord_TypeSlots, }; /* 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) { PyTypeObject *tp = Py_TYPE(it); PyObject_GC_UnTrack(it); Py_CLEAR(it->it_seq); PyObject_GC_Del(it); Py_DECREF(tp); } 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; 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 */ }; static PyType_Slot ApgRecordIter_TypeSlots[] = { {Py_tp_dealloc, (destructor)record_iter_dealloc}, {Py_tp_getattro, PyObject_GenericGetAttr}, {Py_tp_traverse, (traverseproc)record_iter_traverse}, {Py_tp_iter, PyObject_SelfIter}, {Py_tp_iternext, (iternextfunc)record_iter_next}, {Py_tp_methods, record_iter_methods}, {0, NULL}, }; static PyType_Spec ApgRecordIter_TypeSpec = { .name = "asyncpg.protocol.record.RecordIterator", .basicsize = sizeof(ApgRecordIterObject), .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, .slots = ApgRecordIter_TypeSlots, }; static PyObject * record_new_iter(ApgRecordObject *r, const record_module_state *state) { ApgRecordIterObject *it; it = PyObject_GC_New(ApgRecordIterObject, state->ApgRecordIter_Type); if (it == NULL) return NULL; it->it_index = 0; Py_INCREF(r); it->it_seq = r; 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) { PyTypeObject *tp = Py_TYPE(it); PyObject_GC_UnTrack(it); Py_CLEAR(it->it_key_iter); Py_CLEAR(it->it_seq); PyObject_GC_Del(it); Py_DECREF(tp); } 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(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 */ }; static PyType_Slot ApgRecordItems_TypeSlots[] = { {Py_tp_dealloc, (destructor)record_items_dealloc}, {Py_tp_getattro, PyObject_GenericGetAttr}, {Py_tp_traverse, (traverseproc)record_items_traverse}, {Py_tp_iter, PyObject_SelfIter}, {Py_tp_iternext, (iternextfunc)record_items_next}, {Py_tp_methods, record_items_methods}, {0, NULL}, }; static PyType_Spec ApgRecordItems_TypeSpec = { .name = "asyncpg.protocol.record.RecordItemsIterator", .basicsize = sizeof(ApgRecordItemsObject), .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, .slots = ApgRecordItems_TypeSlots, }; static PyObject * record_new_items_iter(ApgRecordObject *r, const record_module_state *state) { ApgRecordItemsObject *it; PyObject *key_iter; key_iter = PyObject_GetIter(r->desc->keys); if (key_iter == NULL) return NULL; it = PyObject_GC_New(ApgRecordItemsObject, state->ApgRecordItems_Type); if (it == NULL) { Py_DECREF(key_iter); return NULL; } it->it_key_iter = key_iter; it->it_index = 0; Py_INCREF(r); it->it_seq = r; PyObject_GC_Track(it); return (PyObject *)it; } /* ----------------- */ static void record_desc_dealloc(ApgRecordDescObject *o) { PyTypeObject *tp = Py_TYPE(o); PyObject_GC_UnTrack(o); Py_CLEAR(o->mapping); Py_CLEAR(o->keys); PyObject_GC_Del(o); Py_DECREF(tp); } static int record_desc_traverse(ApgRecordDescObject *o, visitproc visit, void *arg) { Py_VISIT(o->mapping); Py_VISIT(o->keys); return 0; } static PyObject * record_desc_vectorcall(PyObject *type, PyObject *const *args, size_t nargsf, PyObject *kwnames) { PyObject *mapping; PyObject *keys; ApgRecordDescObject *o; Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); if (kwnames != NULL && PyTuple_GET_SIZE(kwnames) != 0) { PyErr_SetString(PyExc_TypeError, "RecordDescriptor() takes no keyword arguments"); return NULL; } if (nargs != 2) { PyErr_Format(PyExc_TypeError, "RecordDescriptor() takes exactly 2 arguments (%zd given)", nargs); return NULL; } mapping = args[0]; keys = args[1]; if (!PyTuple_CheckExact(keys)) { PyErr_SetString(PyExc_TypeError, "keys must be a tuple"); return NULL; } o = PyObject_GC_New(ApgRecordDescObject, (PyTypeObject *)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; } /* Fallback wrapper for when there is no vectorcall support */ static PyObject * record_desc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *const *args_array; size_t nargsf; PyObject *kwnames = NULL; if (kwargs != NULL && PyDict_GET_SIZE(kwargs) != 0) { PyErr_SetString(PyExc_TypeError, "RecordDescriptor() takes no keyword arguments"); return NULL; } if (!PyTuple_Check(args)) { PyErr_SetString(PyExc_TypeError, "args must be a tuple"); return NULL; } nargsf = (size_t)PyTuple_GET_SIZE(args); args_array = &PyTuple_GET_ITEM(args, 0); return record_desc_vectorcall((PyObject *)type, args_array, nargsf, kwnames); } static PyObject * record_desc_make_record(PyObject *desc, PyTypeObject *desc_type, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *type_obj; Py_ssize_t size; record_module_state *state = get_module_state_from_type(desc_type); if (state == NULL) { return NULL; } if (nargs != 2) { PyErr_Format(PyExc_TypeError, "RecordDescriptor.make_record() takes exactly 2 arguments (%zd given)", nargs); return NULL; } if (kwnames != NULL && PyTuple_GET_SIZE(kwnames) != 0) { PyErr_SetString(PyExc_TypeError, "RecordDescriptor.make_record() takes no keyword arguments"); return NULL; } type_obj = args[0]; size = PyLong_AsSsize_t(args[1]); if (size == -1 && PyErr_Occurred()) { return NULL; } if (!PyType_Check(type_obj)) { PyErr_SetString(PyExc_TypeError, "RecordDescriptor.make_record(): first argument must be a type"); return NULL; } return make_record((PyTypeObject *)type_obj, desc, size, state); } static PyMethodDef record_desc_methods[] = { {"make_record", _PyCFunction_CAST(record_desc_make_record), METH_FASTCALL | METH_METHOD | METH_KEYWORDS}, {NULL, NULL} /* sentinel */ }; static PyType_Slot ApgRecordDesc_TypeSlots[] = { #ifdef Py_tp_vectorcall {Py_tp_vectorcall, (vectorcallfunc)record_desc_vectorcall}, #endif {Py_tp_new, (newfunc)record_desc_new}, {Py_tp_dealloc, (destructor)record_desc_dealloc}, {Py_tp_getattro, PyObject_GenericGetAttr}, {Py_tp_traverse, (traverseproc)record_desc_traverse}, {Py_tp_methods, record_desc_methods}, {0, NULL}, }; static PyType_Spec ApgRecordDesc_TypeSpec = { .name = "asyncpg.protocol.record.RecordDescriptor", .basicsize = sizeof(ApgRecordDescObject), .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE, .slots = ApgRecordDesc_TypeSlots, }; /* * Module init */ static PyMethodDef record_module_methods[] = {{NULL, NULL, 0, NULL}}; static int record_module_exec(PyObject *module) { record_module_state *state = get_module_state(module); if (state == NULL) { return -1; } if (PyThread_tss_create(&state->freelist_key) != 0) { PyErr_SetString( PyExc_SystemError, "failed to create TSS key for record freelist"); return -1; } #define CREATE_TYPE(m, tp, spec) \ do { \ tp = (PyTypeObject *)PyType_FromModuleAndSpec(m, spec, NULL); \ if (tp == NULL) \ goto error; \ if (PyModule_AddType(m, tp) < 0) \ goto error; \ } while (0) CREATE_TYPE(module, state->ApgRecord_Type, &ApgRecord_TypeSpec); CREATE_TYPE(module, state->ApgRecordDesc_Type, &ApgRecordDesc_TypeSpec); CREATE_TYPE(module, state->ApgRecordIter_Type, &ApgRecordIter_TypeSpec); CREATE_TYPE(module, state->ApgRecordItems_Type, &ApgRecordItems_TypeSpec); #undef CREATE_TYPE return 0; error: Py_CLEAR(state->ApgRecord_Type); Py_CLEAR(state->ApgRecordDesc_Type); Py_CLEAR(state->ApgRecordIter_Type); Py_CLEAR(state->ApgRecordItems_Type); return -1; } static int record_module_traverse(PyObject *module, visitproc visit, void *arg) { record_module_state *state = get_module_state(module); if (state == NULL) { return 0; } Py_VISIT(state->ApgRecord_Type); Py_VISIT(state->ApgRecordDesc_Type); Py_VISIT(state->ApgRecordIter_Type); Py_VISIT(state->ApgRecordItems_Type); return 0; } static int record_module_clear(PyObject *module) { record_module_state *state = get_module_state(module); if (state == NULL) { return 0; } if (PyThread_tss_is_created(&state->freelist_key)) { record_freelist_state *freelist = (record_freelist_state *)PyThread_tss_get(&state->freelist_key); if (freelist != NULL) { for (int i = 0; i < ApgRecord_MAXSAVESIZE; i++) { ApgRecordObject *op = freelist->freelist[i]; while (op != NULL) { ApgRecordObject *next = (ApgRecordObject *)(op->ob_item[0]); PyObject_GC_Del(op); op = next; } freelist->freelist[i] = NULL; freelist->numfree[i] = 0; } PyMem_Free(freelist); PyThread_tss_set(&state->freelist_key, NULL); } PyThread_tss_delete(&state->freelist_key); } Py_CLEAR(state->ApgRecord_Type); Py_CLEAR(state->ApgRecordDesc_Type); Py_CLEAR(state->ApgRecordIter_Type); Py_CLEAR(state->ApgRecordItems_Type); return 0; } static void record_module_free(void *module) { record_module_clear((PyObject *)module); } static PyModuleDef_Slot record_module_slots[] = { {Py_mod_exec, record_module_exec}, #ifdef Py_mod_multiple_interpreters {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED}, #endif #ifdef Py_mod_gil {Py_mod_gil, Py_MOD_GIL_NOT_USED}, #endif {0, NULL}, }; static struct PyModuleDef _recordmodule = { PyModuleDef_HEAD_INIT, .m_name = "asyncpg.protocol.record", .m_size = sizeof(record_module_state), .m_methods = record_module_methods, .m_slots = record_module_slots, .m_traverse = record_module_traverse, .m_clear = record_module_clear, .m_free = record_module_free, }; PyMODINIT_FUNC PyInit_record(void) { return PyModuleDef_Init(&_recordmodule); } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/record/recordobj.h0000644000175100017510000000127315111154235021613 0ustar00runnerrunner#ifndef APG_RECORDOBJ_H #define APG_RECORDOBJ_H #include 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; #define ApgRecord_SET_ITEM(op, i, v) \ (((ApgRecordObject *)(op))->ob_item[i] = v) #define ApgRecord_GET_ITEM(op, i) \ (((ApgRecordObject *)(op))->ob_item[i]) #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/record.pyi0000644000175100017510000000134515111154235020214 0ustar00runnerrunnerfrom typing import ( Any, TypeVar, overload, ) from collections.abc import Iterator _T = TypeVar("_T") 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: ... ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/recordcapi.pxd0000644000175100017510000000055015111154235021040 0ustar00runnerrunner# 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": void ApgRecord_SET_ITEM(object, int, object) object RecordDescriptor(object, object) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/scram.pxd0000644000175100017510000000242315111154235020033 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/scram.pyx0000644000175100017510000003440215111154235020062 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/settings.pxd0000644000175100017510000000205215111154235020564 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/protocol/settings.pyx0000644000175100017510000000730115111154235020613 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/serverversion.py0000644000175100017510000000412515111154235017637 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/transaction.py0000644000175100017510000002046115111154235017251 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/asyncpg/types.py0000644000175100017510000001261015111154235016065 0ustar00runnerrunner# 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: Self, /) -> bool: ... def __gt__(self, __other: Self, /) -> 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=1764022429.0 asyncpg-0.31.0/asyncpg/utils.py0000644000175100017510000000272715111154235016071 0ustar00runnerrunner# 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=1764022438.3028219 asyncpg-0.31.0/asyncpg.egg-info/0000755000175100017510000000000015111154246016043 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022434.0 asyncpg-0.31.0/asyncpg.egg-info/PKG-INFO0000644000175100017510000001047415111154242017142 0ustar00runnerrunnerMetadata-Version: 2.4 Name: asyncpg Version: 0.31.0 Summary: An asyncio PostgreSQL driver Author-email: MagicStack Inc License-Expression: Apache-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: 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.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3.14 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta Classifier: Topic :: Database :: Front-Ends Requires-Python: >=3.9.0 Description-Content-Type: text/x-rst License-File: LICENSE 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" Dynamic: license-file 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.9 or later and is supported for PostgreSQL versions 9.5 to 18. 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=1764022438.0 asyncpg-0.31.0/asyncpg.egg-info/SOURCES.txt0000644000175100017510000000756715111154246017746 0ustar00runnerrunner.flake8 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.pxi 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/record.pyi asyncpg/protocol/recordcapi.pxd 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/pythoncapi_compat.h asyncpg/protocol/record/pythoncapi_compat_extras.h 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_subinterpreters.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=1764022434.0 asyncpg-0.31.0/asyncpg.egg-info/dependency_links.txt0000644000175100017510000000000115111154242022105 0ustar00runnerrunner ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022434.0 asyncpg-0.31.0/asyncpg.egg-info/not-zip-safe0000644000175100017510000000000115111154242020265 0ustar00runnerrunner ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022434.0 asyncpg-0.31.0/asyncpg.egg-info/requires.txt0000644000175100017510000000023515111154242020437 0ustar00runnerrunner [:python_version < "3.11.0"] async_timeout>=4.0.3 [gssauth] [gssauth:platform_system != "Windows"] gssapi [gssauth:platform_system == "Windows"] sspilib ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022434.0 asyncpg-0.31.0/asyncpg.egg-info/top_level.txt0000644000175100017510000000001015111154242020560 0ustar00runnerrunnerasyncpg ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1764022438.295822 asyncpg-0.31.0/docs/0000755000175100017510000000000015111154246013635 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/docs/Makefile0000644000175100017510000001667615111154235015313 0ustar00runnerrunner# 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." ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1764022438.295822 asyncpg-0.31.0/docs/_static/0000755000175100017510000000000015111154246015263 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/docs/_static/theme_overrides.css0000644000175100017510000000041215111154235021154 0ustar00runnerrunner/* 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; } } ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1764022438.295822 asyncpg-0.31.0/docs/api/0000755000175100017510000000000015111154246014406 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/docs/api/index.rst0000644000175100017510000002204115111154235016244 0ustar00runnerrunner.. _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=1764022429.0 asyncpg-0.31.0/docs/conf.py0000644000175100017510000000451315111154235015135 0ustar00runnerrunner#!/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=1764022429.0 asyncpg-0.31.0/docs/faq.rst0000644000175100017510000000720115111154235015134 0ustar00runnerrunner.. _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=1764022429.0 asyncpg-0.31.0/docs/index.rst0000644000175100017510000000162515111154235015500 0ustar00runnerrunner.. 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.9 or later and is supported for PostgreSQL versions 9.5 to 18. 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=1764022429.0 asyncpg-0.31.0/docs/installation.rst0000644000175100017510000000412615111154235017071 0ustar00runnerrunner.. _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=1764022429.0 asyncpg-0.31.0/docs/usage.rst0000644000175100017510000004337615111154235015506 0ustar00runnerrunner.. _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=1764022429.0 asyncpg-0.31.0/performance.png0000644000175100017510000004272615111154235015725 0ustar00runnerrunner‰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·:txO�p^‹èÒÑ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~m�BýÀ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öÀz�H…”`‹ö°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åÑå_¤O�vV–.Ü—º™ù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ÁÄt�Wt€µêË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_=)އÊn�j›à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¯ÊU�Q]Ê{Þ,¯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=1764022429.0 asyncpg-0.31.0/pyproject.toml0000644000175100017510000000717615111154235015632 0ustar00runnerrunner[project] name = "asyncpg" description = "An asyncio PostgreSQL driver" authors = [{name = "MagicStack Inc", email = "hello@magic.io"}] requires-python = '>=3.9.0' readme = "README.rst" license = "Apache-2.0" license-files = ["LICENSE"] dynamic = ["version"] keywords = [ "database", "postgres", ] classifiers = [ "Development Status :: 5 - Production/Stable", "Framework :: AsyncIO", "Intended Audience :: Developers", "Operating System :: POSIX", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Free Threading :: 2 - Beta", "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"', ] [dependency-groups] test = [ 'flake8~=6.1', 'flake8-pyi~=24.1.0', 'distro~=1.9.0', 'uvloop>=0.22.1; platform_system != "Windows" and python_version < "3.15.0"', 'gssapi; platform_system == "Linux"', 'k5test; platform_system == "Linux"', 'sspilib; platform_system == "Windows"', 'mypy~=1.8.0', 'pytest', ] docs = [ 'Sphinx~=7.4', 'sphinx_rtd_theme>=1.2.2', ] [build-system] requires = [ "setuptools>=77.0.3", "Cython(>=3.2.1,<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-groups = "test" skip = "cp38-*" [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=1764022438.3038218 asyncpg-0.31.0/setup.cfg0000644000175100017510000000004615111154246014526 0ustar00runnerrunner[egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/setup.py0000644000175100017510000002064415111154235014423 0ustar00runnerrunner# 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, 9): raise RuntimeError('asyncpg requires Python 3.9 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(>=3.2.1,<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() defines = [ "CYTHON_USE_MODULE_STATE", "CYTHON_PEP489_MULTI_PHASE_INIT", "CYTHON_USE_TYPE_SPECS", ] if os.environ.get('ASYNCPG_DEBUG'): self.cython_always = True self.cython_annotate = True self.cython_directives = "linetrace=True" self.debug = True defines += ["PG_DEBUG", "CYTHON_TRACE", "CYTHON_TRACE_NOGIL"] else: self.cython_always = False self.cython_annotate = None self.cython_directives = None self.define = ",".join(defines) 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', 'freethreading_compatible': 'True', 'subinterpreters_compatible': 'own_gil', } 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.record", ["asyncpg/protocol/record/recordobj.c"], include_dirs=['asyncpg/protocol/record/'], extra_compile_args=CFLAGS, extra_link_args=LDFLAGS), setuptools.extension.Extension( "asyncpg.protocol.protocol", ["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=1764022438.3008218 asyncpg-0.31.0/tests/0000755000175100017510000000000015111154246014047 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/tests/__init__.py0000644000175100017510000000116315111154235016157 0ustar00runnerrunner# 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=1764022438.3028219 asyncpg-0.31.0/tests/certs/0000755000175100017510000000000015111154246015167 5ustar00runnerrunner././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/tests/certs/ca.cert.pem0000644000175100017510000000421715111154235017213 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/ca.crl.pem0000644000175100017510000000211115111154235017025 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/ca.key.pem0000644000175100017510000000625315111154235017050 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/client.cert.pem0000644000175100017510000000265415111154235020111 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/client.csr.pem0000644000175100017510000000205215111154235017733 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/client.key.pem0000644000175100017510000000321315111154235017734 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/client.key.protected.pem0000644000175100017510000000334615111154235021733 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/client_ca.cert.pem0000644000175100017510000000274115111154235020551 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/client_ca.key.pem0000644000175100017510000000321715111154235020403 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/gen.py0000644000175100017510000001542215111154235016314 0ustar00runnerrunnerimport 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=1764022429.0 asyncpg-0.31.0/tests/certs/server.cert.pem0000644000175100017510000000462315111154235020137 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/server.crl.pem0000644000175100017510000000211115111154235017750 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/certs/server.key.pem0000644000175100017510000000625315111154235017773 0ustar00runnerrunner-----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=1764022429.0 asyncpg-0.31.0/tests/test__environment.py0000644000175100017510000000264115111154235020164 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test__sourcecode.py0000644000175100017510000000424615111154235017756 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_adversity.py0000644000175100017510000000615015111154235017472 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_cache_invalidation.py0000644000175100017510000004025715111154235021272 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_cancellation.py0000644000175100017510000000605715111154235020122 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_codecs.py0000644000175100017510000020531615111154235016725 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_connect.py0000644000175100017510000024202215111154235017111 0ustar00runnerrunner# 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'" ), }, # broken by https://github.com/python/cpython/pull/129418 # { # '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', } ) }, { 'name': 'multi_host_single_port', 'dsn': 'postgres:///postgres?host=127.0.0.1,127.0.0.2&port=5432' '&user=postgres', 'result': ( [ ('127.0.0.1', 5432), ('127.0.0.2', 5432) ], { 'user': 'postgres', 'database': 'postgres', '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, 'PGSERVICE': 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') service = testcase.get('service') servicefile = testcase.get('servicefile') 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, service=service, servicefile=servicefile) 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_connection_service_file(self): connection_service_file = tempfile.NamedTemporaryFile( 'w+t', delete=False) connection_service_file.write(textwrap.dedent(''' [test_service_dbname] port=5433 host=somehost dbname=test_dbname user=admin password=test_password target_session_attrs=primary krbsrvname=fakekrbsrvname gsslib=sspi [test_service_database] port=5433 host=somehost database=test_dbname user=admin password=test_password target_session_attrs=primary krbsrvname=fakekrbsrvname gsslib=sspi ''')) connection_service_file.close() os.chmod(connection_service_file.name, stat.S_IWUSR | stat.S_IRUSR) try: # Test connection service file with dbname self.run_testcase({ 'dsn': 'postgresql://?service=test_service_dbname', 'env': { 'PGSERVICEFILE': connection_service_file.name }, 'result': ( [('somehost', 5433)], { 'user': 'admin', 'password': 'test_password', 'database': 'test_dbname', 'target_session_attrs': 'primary', 'krbsrvname': 'fakekrbsrvname', 'gsslib': 'sspi', } ) }) # Test connection service file with database self.run_testcase({ 'dsn': 'postgresql://?service=test_service_database', 'env': { 'PGSERVICEFILE': connection_service_file.name }, 'result': ( [('somehost', 5433)], { 'user': 'admin', 'password': 'test_password', 'database': 'test_dbname', 'target_session_attrs': 'primary', 'krbsrvname': 'fakekrbsrvname', 'gsslib': 'sspi', } ) }) # Test that envvars are overridden by service file self.run_testcase({ 'dsn': 'postgresql://?service=test_service_dbname', 'env': { 'PGUSER': 'user', 'PGSERVICEFILE': connection_service_file.name }, 'result': ( [('somehost', 5433)], { 'user': 'admin', 'password': 'test_password', 'database': 'test_dbname', 'target_session_attrs': 'primary', 'krbsrvname': 'fakekrbsrvname', 'gsslib': 'sspi', } ) }) # Test that dsn params overwrite service file self.run_testcase({ 'dsn': 'postgresql://?service={}&dbname={}'.format( "test_service_dbname", "test_dbname_dsn" ), 'env': { 'PGSERVICEFILE': connection_service_file.name }, 'result': ( [('somehost', 5433)], { 'user': 'admin', 'password': 'test_password', 'database': 'test_dbname_dsn', 'target_session_attrs': 'primary', 'krbsrvname': 'fakekrbsrvname', 'gsslib': 'sspi', } ) }) finally: os.unlink(connection_service_file.name) 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=1764022429.0 asyncpg-0.31.0/tests/test_copy.py0000644000175100017510000005270615111154235016442 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_cursor.py0000644000175100017510000001344315111154235017000 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_execute.py0000644000175100017510000002761215111154235017130 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_introspection.py0000644000175100017510000001656015111154235020366 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_listeners.py0000644000175100017510000002661015111154235017473 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_logging.py0000644000175100017510000000301615111154235017104 0ustar00runnerrunnerimport 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=1764022429.0 asyncpg-0.31.0/tests/test_pool.py0000644000175100017510000011341215111154235016431 0ustar00runnerrunner# 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.5 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=1764022429.0 asyncpg-0.31.0/tests/test_prepare.py0000644000175100017510000005426315111154235017126 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_record.py0000644000175100017510000004401715111154235016742 0ustar00runnerrunner# 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.protocol.record.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=1764022429.0 asyncpg-0.31.0/tests/test_subinterpreters.py0000644000175100017510000000400715111154235020717 0ustar00runnerrunner# 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 textwrap import threading import unittest try: from concurrent import interpreters except ImportError: pass else: class TestSubinterpreters(unittest.TestCase): def test_record_module_loads_in_subinterpreter(self) -> None: def run_in_subinterpreter() -> None: interp = interpreters.create() try: code = textwrap.dedent("""\ import asyncpg.protocol.record as record assert record.Record is not None """) interp.exec(code) finally: interp.close() thread = threading.Thread(target=run_in_subinterpreter) thread.start() thread.join() def test_record_module_state_isolation(self) -> None: import asyncpg.protocol.record main_record_id = id(asyncpg.protocol.record.Record) def run_in_subinterpreter() -> None: interp = interpreters.create() try: code = textwrap.dedent(f"""\ import asyncpg.protocol.record as record sub_record_id = id(record.Record) main_id = {main_record_id} assert sub_record_id != main_id, ( f"Record type objects are the same: " f"{{sub_record_id}} == {{main_id}}. " f"This indicates shared global state." ) """) interp.exec(code) finally: interp.close() thread = threading.Thread(target=run_in_subinterpreter) thread.start() thread.join() if __name__ == "__main__": _ = unittest.main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1764022429.0 asyncpg-0.31.0/tests/test_test.py0000644000175100017510000000241115111154235016433 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_timeout.py0000644000175100017510000001453515111154235017154 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_transaction.py0000644000175100017510000002262715111154235020014 0ustar00runnerrunner# 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=1764022429.0 asyncpg-0.31.0/tests/test_utils.py0000644000175100017510000000225615111154235016623 0ustar00runnerrunner# 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)