asyncpg-0.13.0/0000775000372000037200000000000013172407445014110 5ustar travistravis00000000000000asyncpg-0.13.0/MANIFEST.in0000664000372000037200000000032213172407302015633 0ustar travistravis00000000000000recursive-include docs *.py *.rst recursive-include examples *.py recursive-include tests *.py *.pem recursive-include asyncpg *.pyx *.pxd *.pxi *.py *.c *.h include LICENSE README.rst Makefile performance.png asyncpg-0.13.0/README.rst0000664000372000037200000000505413172407302015573 0ustar travistravis00000000000000asyncpg -- A fast PostgreSQL Database Client Library for Python/asyncio ======================================================================= .. image:: https://travis-ci.org/MagicStack/asyncpg.svg?branch=master :target: https://travis-ci.org/MagicStack/asyncpg .. image:: https://ci.appveyor.com/api/projects/status/9rwppnxphgc8bqoj/branch/master?svg=true :target: https://ci.appveyor.com/project/magicstack/asyncpg .. 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.5 or later and is supported for PostgreSQL versions 9.2 to 10. Documentation ------------- The project documentation can be found `here `_. Performance ----------- In our testing asyncpg is, on average, **3x** faster than psycopg2 (and its asyncio variant -- aiopg). .. image:: performance.png :target: http://magic.io/blog/asyncpg-1m-rows-from-postgres-to-python/ The above results are a geometric mean of benchmarks obtained with PostgreSQL `client driver benchmarking toolbench `_. 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 and has no dependencies. Use pip to install:: $ pip install asyncpg 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''') await conn.close() loop = asyncio.get_event_loop() loop.run_until_complete(run()) License ------- asyncpg is developed and distributed under the Apache 2.0 license. asyncpg-0.13.0/LICENSE0000664000372000037200000002631213172407302015111 0ustar travistravis00000000000000Copyright (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. asyncpg-0.13.0/tests/0000775000372000037200000000000013172407445015252 5ustar travistravis00000000000000asyncpg-0.13.0/tests/test__sourcecode.py0000664000372000037200000000230513172407302021145 0ustar travistravis00000000000000# 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 TestFlake8(unittest.TestCase): def test_flake8(self): 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: import flake8 # NoQA except ImportError: raise unittest.SkipTest('flake8 module is missing') 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 asyncpg-0.13.0/tests/test__environment.py0000664000372000037200000000162513172407302021362 0ustar travistravis00000000000000# 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) ) asyncpg-0.13.0/tests/test_cache_invalidation.py0000664000372000037200000000616113172407302022463 0ustar travistravis00000000000000# 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 TestCacheInvalidation(tb.ConnectedTestCase): 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)) 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')) 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)) 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') # 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)) 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')) 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.close() asyncpg-0.13.0/tests/test_exceptions.py0000664000372000037200000000335513172407302021042 0ustar travistravis00000000000000# 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 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: self.assertEqual( e.detail, "Function's final statement must be SELECT or " "INSERT/UPDATE/DELETE RETURNING.") self.assertIn( 'DETAIL: Function', str(e) ) else: self.fail('InvalidFunctionDefinitionError not raised') asyncpg-0.13.0/tests/test_cursor.py0000664000372000037200000001252313172407302020173 0ustar travistravis00000000000000# 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(): async for rec in self.con.cursor( 'SELECT generate_series(0, $1::int)', 10): recs.append(rec) self.assertEqual(recs, [(i,) for i in range(11)]) 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 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, loop=self.loop) 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.cluster.connect( database='postgres', loop=self.loop, 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): await asyncio.sleep(0.3, loop=self._loop) return await super()._get_statement(query, timeout) 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) asyncpg-0.13.0/tests/test_utils.py0000664000372000037200000000225613172407302020020 0ustar travistravis00000000000000# 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) asyncpg-0.13.0/tests/test_execute.py0000664000372000037200000001157413172407302020325 0ustar travistravis00000000000000# 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 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, loop=self.loop) self.assertFalse(self.con.is_closed()) await self.con.close() self.assertTrue(self.con.is_closed()) with self.assertRaisesRegex(asyncpg.ConnectionDoesNotExistError, 'closed in the middle'): 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, loop=self.loop) 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() async def test_execute_many_1(self): await self.con.execute('CREATE TEMP TABLE exmany (a text, b int)') try: 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 result = 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) ]) finally: await self.con.execute('DROP TABLE exmany') async def test_execute_many_2(self): await self.con.execute('CREATE TEMP TABLE exmany (b int)') try: 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 VALUES($1) ''', bad_data) good_data = ([v] for v in range(10)) async with self.con.transaction(): await self.con.executemany(''' INSERT INTO exmany VALUES($1) ''', good_data) finally: await self.con.execute('DROP TABLE exmany') asyncpg-0.13.0/tests/test_introspection.py0000664000372000037200000000612413172407302021556 0ustar travistravis00000000000000# 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 _testbase as tb MAX_RUNTIME = 0.1 class TestIntrospection(tb.ConnectedTestCase): @classmethod def setUpClass(cls): super().setUpClass() cls.adminconn = cls.loop.run_until_complete( cls.cluster.connect(database='postgres', loop=cls.loop)) 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() @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): 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(self.con._uid, 0) @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. 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(self.con._uid, 0) @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. await self.con.fetchval( "SELECT $1::int[], '{foo}'".format(foo='a' * 10000), [1, 2]) self.assertEqual(self.con._uid, 1) asyncpg-0.13.0/tests/test_cancellation.py0000664000372000037200000000615513172407302021316 0ustar travistravis00000000000000# 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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(loop=self.loop) self.con._cancel_current_command(waiter) await waiter self.assertEqual(await self.con.fetchval('SELECT 42'), 42) asyncpg-0.13.0/tests/test_transaction.py0000664000372000037200000001220413172407302021177 0ustar travistravis00000000000000# 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) tr = self.con.transaction() self.assertIsNone(self.con._top_xact) with self.assertRaises(ZeroDivisionError): async with tr as with_tr: self.assertIs(self.con._top_xact, tr) # 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) 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) tr = self.con.transaction() self.assertIsNone(self.con._top_xact) with self.assertRaises(ZeroDivisionError): async with tr: self.assertIs(self.con._top_xact, tr) await self.con.execute(''' CREATE TABLE mytab (a int); ''') async with self.con.transaction(): self.assertIs(self.con._top_xact, tr) await self.con.execute(''' INSERT INTO mytab (a) VALUES (1), (2); ''') self.assertIs(self.con._top_xact, tr) with self.assertRaises(ZeroDivisionError): in_tr = self.con.transaction() async with in_tr: self.assertIs(self.con._top_xact, tr) 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) 1 / 0 self.assertIs(self.con._top_xact, None) 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) 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 import asyncio import datetime import io import tempfile import asyncpg from asyncpg import _testbase as tb from asyncpg import compat 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 FROM generate_series(1, 5) AS i WHERE i = $1 ''', 3, output=f) self.assertEqual(res, 'COPY 1') output = f.getvalue().decode().split('\n') self.assertEqual( output, [ '3\t30', '' ] ) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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 @compat.aiter_compat 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 @compat.aiter_compat 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 @compat.aiter_compat 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 @compat.aiter_compat def __aiter__(self): return self async def __anext__(self): self.rowcount += 1 await asyncio.sleep(60, loop=self.loop) 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_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_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') asyncpg-0.13.0/tests/test_record.py0000664000372000037200000002431013172407302020131 0ustar travistravis00000000000000# 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 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(KeyError): r[key] del r key = 'spam' val = 'ham' mapping = {key: val} with self.checkref(key, val): r = Record(mapping, (0,)) with self.assertRaises(KeyError): 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(KeyError, 'spam'): Record({'spam': 123}, (1,))['spam'] def test_record_slice(self): r = Record(R_ABC, (1, 2, 3)) self.assertEqual(r[:], (1, 2, 3)) self.assertEqual(r[:1], (1,)) self.assertEqual(r[::-1], (3, 2, 1)) self.assertEqual(r[::-2], (3, 1)) self.assertEqual(r[1:2], (2,)) self.assertEqual(r[2:2], ()) def test_record_immutable(self): r = Record(R_A, (42,)) with self.assertRaisesRegex(TypeError, 'does not support item'): r[0] = 1 def test_record_repr(self): self.assertEqual( repr(Record(R_A, (42,))), '') self.assertEqual( repr(Record(R_AB, (42, -1))), '') # test invalid records just in case with self.assertRaisesRegex(RuntimeError, 'invalid .* mapping'): repr(Record(R_A, (42, 43))) self.assertEqual(repr(Record(R_AB, (42,))), '') class Key: def __str__(self): 1 / 0 def __repr__(self): 1 / 0 with self.assertRaises(ZeroDivisionError): repr(Record({Key(): 0}, (42,))) with self.assertRaises(ZeroDivisionError): repr(Record(R_A, (Key(),))) def test_record_iter(self): r = Record(R_AB, (42, 43)) with self.checkref(r): self.assertEqual(iter(r).__length_hint__(), 2) self.assertEqual(tuple(r), (42, 43)) def test_record_values(self): r = Record(R_AB, (42, 43)) vv = r.values() self.assertEqual(tuple(vv), (42, 43)) self.assertTrue(repr(vv).startswith('') self.assertEqual(str(r), '') with self.assertRaisesRegex(KeyError, 'aaa'): r['aaa'] self.assertEqual(dict(r.items()), {}) self.assertEqual(list(r.keys()), []) self.assertEqual(list(r.values()), []) async def test_record_duplicate_colnames(self): """Test that Record handles duplicate column names.""" records_descs = [ [('a', 1)], [('a', 1), ('a', 2)], [('a', 1), ('b', 2), ('a', 3)], [('a', 1), ('b', 2), ('a', 3), ('c', 4), ('b', 5)], ] for desc in records_descs: items = collections.OrderedDict(desc) query = 'SELECT ' + ', '.join( ['{} as {}'.format(p[1], p[0]) for p in desc]) with self.subTest(query=query): r = await self.con.fetchrow(query) for idx, (field, val) in enumerate(desc): self.assertEqual(r[idx], val) self.assertEqual(r[field], items[field]) expected_repr = ''.format( ' '.join('{}={}'.format(p[0], p[1]) for p in desc)) self.assertEqual(repr(r), expected_repr) self.assertEqual(list(r.items()), desc) self.assertEqual(list(r.values()), [p[1] for p in desc]) self.assertEqual(list(r.keys()), [p[0] for p in desc]) async def test_record_isinstance(self): """Test that Record works with isinstance.""" r = await self.con.fetchrow('SELECT 1 as a, 2 as b') self.assertTrue(isinstance(r, asyncpg.Record)) async def test_record_no_new(self): """Instances of Record cannot be directly created.""" with self.assertRaisesRegex( TypeError, "cannot create 'asyncpg.Record' instances"): asyncpg.Record() asyncpg-0.13.0/tests/certs/0000775000372000037200000000000013172407445016372 5ustar travistravis00000000000000asyncpg-0.13.0/tests/certs/ca.cert.pem0000664000372000037200000000417313172407302020411 0ustar travistravis00000000000000-----BEGIN CERTIFICATE----- MIIGFzCCA/+gAwIBAgIJAPTCST3Z/WinMA0GCSqGSIb3DQEBCwUAMIGhMQswCQYD VQQGEwJDQTEQMA4GA1UECAwHT250YXJpbzEQMA4GA1UEBwwHVG9yb250bzEYMBYG A1UECgwPTWFnaWNTdGFjayBJbmMuMRYwFAYDVQQLDA1hc3luY3BnIHRlc3RzMR0w GwYDVQQDDBRhc3luY3BnIHRlc3Qgcm9vdCBjYTEdMBsGCSqGSIb3DQEJARYOaGVs bG9AbWFnaWMuaW8wHhcNMTcwNDAzMTYxMzMwWhcNMzcwMzI5MTYxMzMwWjCBoTEL MAkGA1UEBhMCQ0ExEDAOBgNVBAgMB09udGFyaW8xEDAOBgNVBAcMB1Rvcm9udG8x GDAWBgNVBAoMD01hZ2ljU3RhY2sgSW5jLjEWMBQGA1UECwwNYXN5bmNwZyB0ZXN0 czEdMBsGA1UEAwwUYXN5bmNwZyB0ZXN0IHJvb3QgY2ExHTAbBgkqhkiG9w0BCQEW DmhlbGxvQG1hZ2ljLmlvMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA zxreg1IEqX/g1IFwpNCc9hKa7YYMPk8mo4l+pE4CKXA9cQreaIiDg+l7+pJL3FMa a/7cuUsBlVOq/T+9gmjzdWDTHTdq55PQx6co4OlRyPGad2kMwYlAERB6s2jGfuwM sS0JJ3VPxUBXwB5ljq18L+HPsZXZhZOl6pBW74dfQE5SJZLTGIX6mbtwR+uQgaow 1RsMwFAGvwDu8c8+3lmUinGhlHXRJAhbncnlOWmAqa3Yf8rny0JeX7wz5x3vbxnX 9p9XMaXtV+hQWFHn21nAYjsCnDin6oyC2zUi9ahN5njKu+tUYA+K0ImliTAQNQ39 m9SZvGNS2uIj/ryYVsI9FjgyJgV6JGcb0q1j2BPUmpPKwHN+sPkdKZy+Z4mVBiel mc7X6J9aEXxrvFIjhZOwhYn3RwpwguDFU5qY1Y9wzTg1HMLfQfzWdyInNEi4s96z biicisVMnR84syClg2RN56U+0hTJeYKTnYh/xV959EqoFfpUI2GZIxNmHr5p8S3M 7uSeBxoovmUYadhF9SlKx+dABd/K1HBKfMC4z2iw9z6r4QGOnKoMy0eAn5wzL7wL +h6znRPm28Qr9NEg8qJ9r1pfF3uhwgZw8hL8iytNfdUIneQVqoHApd33SxHFaO29 2Nuc19ucySNsMFBIVSg1D5LGjcJYz3NZpleQsIwLhvMCAwEAAaNQME4wHQYDVR0O BBYEFOcVk1n/NisD3qXqtpSsWm+pXd0XMB8GA1UdIwQYMBaAFOcVk1n/NisD3qXq tpSsWm+pXd0XMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggIBAEFyCFmn vc6EjKRld+G8Q1UBRCviNwAvTUyn6LfGFKeimCGlrXEIj08e15oSMVtbWYrs1vWk x9JJIJYSbaWJM6eaWmbPYgYzQaiDdWnZb/fXg20gDaFtTamDrqws44yPHgkF8B+k fBdkG6w59lGuwz2n8shag4ATDRambJBW1TV+6WAOH2FRQ6Mn/yz4qFGlI/r7yeCJ CcQ3KWcrmbqA+GeNCNFyP1CHh+1DXYydVJULZ8hO7TcAkHgKZuHA37N5WGr2Yb+1 wVH8v2vXpka1wosENU5dMPgtJQ9raEVZEh6HQY81G5/rtUIEuLuHFGkMv9LiuV2/ FhXGjwyfmDaRADIEH0j0e2NeKk3tLlHb+2cZgKRvwL0a/RkovgUtKN3/ZGHsuPFe YTk7RXn3DFpnhVltrg1vRPgR3euKKSVyw/DTPo1sQN205Lgcot+zshUIER/ELZBu 77AeDK9wbjxG34vdPaNz+bpVpJxZWHyO0CSKpXYwUcdr5iU2VrWJrj4Mnvat9Elo BV6lkgdM47ngJ+bS4QpbvZG0YBzaN6mnXEQf3Zw1TkR+31m7vhRKilnObhG+Ylzq H6E/a1MVtTRu1FkhTHdHJmolMVSHAytZZnee5PC/1AlMcKdWEv8A5up9sTjGesFM ztcZLWC9GiyC/TFSJ1hDylkvvwcCX6PD7fLu -----END CERTIFICATE----- asyncpg-0.13.0/tests/certs/server.cert.pem0000664000372000037200000000472413172407302021336 0ustar travistravis00000000000000-----BEGIN CERTIFICATE----- MIIHFjCCBP6gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgaExCzAJBgNVBAYTAkNB MRAwDgYDVQQIDAdPbnRhcmlvMRAwDgYDVQQHDAdUb3JvbnRvMRgwFgYDVQQKDA9N YWdpY1N0YWNrIEluYy4xFjAUBgNVBAsMDWFzeW5jcGcgdGVzdHMxHTAbBgNVBAMM FGFzeW5jcGcgdGVzdCByb290IGNhMR0wGwYJKoZIhvcNAQkBFg5oZWxsb0BtYWdp Yy5pbzAeFw0xNzA0MDMxNjIxMjhaFw0zNzAzMjkxNjIxMjhaMIGEMQswCQYDVQQG EwJDQTEQMA4GA1UECAwHT250YXJpbzEYMBYGA1UECgwPTWFnaWNTdGFjayBJbmMu MRYwFAYDVQQLDA1hc3luY3BnIHRlc3RzMRIwEAYDVQQDDAlsb2NhbGhvc3QxHTAb BgkqhkiG9w0BCQEWDmhlbGxvQG1hZ2ljLmlvMIICIjANBgkqhkiG9w0BAQEFAAOC Ag8AMIICCgKCAgEA+0WH9PX4a6Tsnp7xtUbZ51c77aqVagdfj9xYJPqD3X7u2Odf yyYivZ91DiS23acfLOEQOfBNn2ZFcrLaXy33UAXo1VcvCsKNJY4FfS9A5OBZ4UTL peagrTnZuRS4KMadg0V9jb5au6+s7jExPty9c+nZ59Kd6IbkPn31l9K5rj4/2WvG pIj9k5YaXswJVBiTWGKxP9a3xMb9CG9bqNCD5kXo+1K2oDJyGE3mj6QSjlnFw6NN f+dCOGWSs7JHMNZVVtRG2qsEIssZgpHseu9he684ZqdqrMCG6wBDW58sUBp6Dt6z jyTLefs8ht0tT+ZcmPno2G3mgs1bLyQsQB8a7fqzzaW6wPwdZJBGO/qI7Zr/30VD I7InLmxbg62tdrTP4CibXWfe6Qoi6xSNZd7FvP2OoCA7Nk6HahdwDocInB9fWV2j jkqyeIdDSd9QUItCUSgyVm+XefO/T8B75PNCykyWAMMDGOBE706KZh4oXeMORoYp LxsbtL0/7n/JPwQDHeLQHHRjiw2ydxH2/940jngnL1YCqWiUq06FPvl3zn+Qgim+ kIhfJeYuQ8zxdh8P7Ay4i5neuum+FQZspPiSzx6jMQIOu+e+iBP2AIdu/UQK+JPU epE2Pt5aEyuzgNEbg0cR6tQ3rJCbj0DdtU26ale5EeD8y1JYCXEYkED88bMCAwEA AaOCAXEwggFtMAkGA1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgZAMDMGCWCGSAGG +EIBDQQmFiRPcGVuU1NMIEdlbmVyYXRlZCBTZXJ2ZXIgQ2VydGlmaWNhdGUwHQYD VR0OBBYEFHWtuEuKYLSw/iqmyBEyjcSxq0LHMIHWBgNVHSMEgc4wgcuAFOcVk1n/ NisD3qXqtpSsWm+pXd0XoYGnpIGkMIGhMQswCQYDVQQGEwJDQTEQMA4GA1UECAwH T250YXJpbzEQMA4GA1UEBwwHVG9yb250bzEYMBYGA1UECgwPTWFnaWNTdGFjayBJ bmMuMRYwFAYDVQQLDA1hc3luY3BnIHRlc3RzMR0wGwYDVQQDDBRhc3luY3BnIHRl c3Qgcm9vdCBjYTEdMBsGCSqGSIb3DQEJARYOaGVsbG9AbWFnaWMuaW+CCQD0wkk9 2f1opzATBgNVHSUEDDAKBggrBgEFBQcDATALBgNVHQ8EBAMCBaAwDQYJKoZIhvcN AQELBQADggIBAFUik2de0QH9gjHb0DeNRUpzHf67sVejqJoB0YCAlwhMTCwnMasR YQVeD6+L1KCoyynhwZE99B9LlWcL5V/uR++S88azc35mFVJ6j5b0zxT6nTOQE2Oe oOZrjhFDmdRQDyZl3oOQZD0CD2VoRZK2uGG1Isv8cC17ImC1bMNHbU+0Sc5twUtj jLvyoJNASQess35c+V/w6rdlXy2g19vSiR3nQPsh/HMv2Kx0sJaSIVKTdVBlH3FH o+v7tR2YRMxNw4olalxXJzvt1KgbNGczi4Yd/XnTQKCJx4xvJLhE/9R6Cj6vLeFZ YpSp1ftXBAQCQn6lv0fMe7az3fmXRJ692514F00zmJUI6EW1wqD4yx2Q8JgqmQ4k 2oz4HBk/6Sh6Hf43KZAnLUMZ0VvkzhUTTp5/BwlhLjbWQdR6Lrf/8SRdEVzdco6F zmawidqeQCASHKbLfFfWbh+A0mzHhkcnvczM803oX1iOnaDQVIYWqZwJxmB+bsB9 99/yBCxJw1YGIcHss97olsx2HReCVmcUZA3TBBG/WFATYV0DlVdApEPcR6a+NWE/ W3EhPsZhUdSzjdlP1Yt9awq+V5eHHVA/ve0PufPW6nmxIXXpIuX2YGIRqEmWWSO8 +sKguObZvWZnj/D04GPjJTozy82vebiWGG1NODGO/4vCB0Zp/MbjYQb8 -----END CERTIFICATE----- asyncpg-0.13.0/tests/certs/server.key.pem0000664000372000037200000000625713172407302021174 0ustar travistravis00000000000000-----BEGIN RSA PRIVATE KEY----- MIIJKgIBAAKCAgEA+0WH9PX4a6Tsnp7xtUbZ51c77aqVagdfj9xYJPqD3X7u2Odf yyYivZ91DiS23acfLOEQOfBNn2ZFcrLaXy33UAXo1VcvCsKNJY4FfS9A5OBZ4UTL peagrTnZuRS4KMadg0V9jb5au6+s7jExPty9c+nZ59Kd6IbkPn31l9K5rj4/2WvG pIj9k5YaXswJVBiTWGKxP9a3xMb9CG9bqNCD5kXo+1K2oDJyGE3mj6QSjlnFw6NN f+dCOGWSs7JHMNZVVtRG2qsEIssZgpHseu9he684ZqdqrMCG6wBDW58sUBp6Dt6z jyTLefs8ht0tT+ZcmPno2G3mgs1bLyQsQB8a7fqzzaW6wPwdZJBGO/qI7Zr/30VD I7InLmxbg62tdrTP4CibXWfe6Qoi6xSNZd7FvP2OoCA7Nk6HahdwDocInB9fWV2j jkqyeIdDSd9QUItCUSgyVm+XefO/T8B75PNCykyWAMMDGOBE706KZh4oXeMORoYp LxsbtL0/7n/JPwQDHeLQHHRjiw2ydxH2/940jngnL1YCqWiUq06FPvl3zn+Qgim+ kIhfJeYuQ8zxdh8P7Ay4i5neuum+FQZspPiSzx6jMQIOu+e+iBP2AIdu/UQK+JPU epE2Pt5aEyuzgNEbg0cR6tQ3rJCbj0DdtU26ale5EeD8y1JYCXEYkED88bMCAwEA AQKCAgEAtof0E8b7B3dvTGs6Ou2VLbD5H9VjZPqmOONgRLyXPjgPWhH6TKEPa6CC cBvLm4jj5L46A1zFhp3MpV23tJy3o7InSZNj4PUjg7x/0EibY6h2omZPadz3q97y grjCbxyZH9tDMcyuLNmZTg7+LyQ7nBCs8vLVMy2KcLsfxYKW0DT4PQFF9BBv5N6N mX+u5yBTKUnIaQ+Zv6Ct/4qlkySmLIlsjeWwNP9wUqeEbaRKto4QU+Y1Tky4li9z OoavoJKSu9jI/+BryLqxdWB74XIz5p2K40eK/qN9Xwl55PzkO+x/7n1pAvs/tQUF GxNg70Hw0k/5DgAIC80SCFTGsG3oKLgPm1BS7Njoz8xcQvtZrYOKfEg/NOjUAWTE SvXoLRqTQ4bUS6F6VgSA+qEEXrKFGt+ViddXrfuyXow5ZXjstgwuuZSzjLTM9LPF tKEeB+hYbjpg0C7KuRGG5MfQ6eY8TjB3JCBGSBPw/4gv4DzkRoI2e2Qvgon6pNUT ZiQMmuQHX3d+5QQErzUgAYF401DBi+9kG6e78hZ5uG3lTUOW372jcAkdkD/DdC1B GMt7esIoyrO/57gFQXaFIQjSneWPiaxtYxUqpjbc0lCIfwYr3QFYzumZwUErJljl CxDJ2ejW6ONUXDPRbzprHFDi0y71G7WRT7ZmwoQY/q/Yxwg3mAECggEBAP8+cgZl 001Np3M78KUYuUhDt+6J+ZujJnpCdsWqf0H0cxIA/FL6zpnyYP7nkum/QphE9CST jFew1/JnuCtHHzE9BryChjL+kjXswFAhGncsP+UjPI1AEliFhPHIfBF25N3LYBvU IO4syLLUsJsWlAaUbXBD29bSRUYwNPkspmblluZaKdS5fJQR9tiEUkNlPeUcjaMl Mhblo4r3lZYMkJqm11DGlNUnXb5/kCMq0D+kvhVvoHfRqk5G30m9Yu0QSR6dVlgi HiPXodNJSz0BZpfM/FXdnhAYnIANgPZS/St9JjpFeDTvo6vZgF9be+Tt29Zm7gxZ 4hvoPCUwE5LhKjMCggEBAPwEEssXK3qkrIYRe1gJjxAkpTHWj5w18QNRRsDvNIT3 Ode2MtloeOl2csIRtvVZWEHWuFiQyvDbVXQvmoeJT+K1acw0mOOkXLME2BLOHTkJ bYU5zd+dnF3W3CaOUagpesP7QZYiqdso88EugFDt5KtonFRtp/YNY4HxmEahE2I2 KGVN6rFV5WIZsJyXhNCvacci1ZnJqwN/43Vx5ejsqjtypi1XAKlYzGj0ktDbOFGR vZQdR5Q8rYQ+V7Bypwzbchq9+Udh3Xd8VmosADE0OoATDU6m1SHvsZMxZ83vcs/8 pkwtzMlzo3q/yPSG+jTU7kq0PE8z628ol5sFZrFMmoECggEATQpHFmFDnvCSWzi7 UMmemw49hRVGLtDWu042VUE5+elTlhqQDme/Vj4PQsEY2c6txhIB8sxKLumktHjT 4NQtuQnnb5yh7uBhtz8HaOgk+dV0T7AMBcJSBz/9uZC+yfKt77gEAUJM0jbYOQnz aEwvT7EbOyhwQW3kFORWCOOOMj6YBl0uhRObY4HslLuTrN3xCadNpPGEJd8YNsi1 8L1IJDW5hZr6rz+bjvUnx0WT57HM4eF4eNHi6o9/s90i79TbjQ8GUcGygTUDlido OziiA62OeEhU/hy/l/L7et3fpnG2yR3Qw4GVUDhtA9s0EQwuL4+PyFCU68Fz7fGN 5uZpewKCAQEAvBAmHhwaPBlrDVk6XEY11mwiQoDFBmNSiZE7ZXqcDKWZKpoyc/78 S+wyUxR5HbognHEpfB4A86AZsuxbOs2DKcELRHHzrdzXuFfjDpV1RTz91699LGQn bfeKrdMCqKTbkiiLlwgjDQMQc5bJ9pqwTCFyl6aE8p6nJS8u3XYSSvXzSzXL764T 0RMusox3dmuQWiRqlarizWfAS8JFOX5ywo4Z6DfGrJkxYRkx/l25N1W0zTTUV5C4 Q7lqIqhMdNHF4qLlxRkI9cN5kR1ov08kYLLW+VySLBL8xsTVm94WJZN6XdrHuYVr 94vq4F9hk89aS7EYWFp8VKVMDUkIi0KJAQKCAQEAmt1zJ9MP2xDIbNCY1Kuk3Zoy oYcCqijK6i/9Aeu+9w8U1hSrcU5SOF4VQbDwB00RzzDPL7K4e77GulEDnanKnEpX eu4lYuhCgG/G7uECU8jLOUQUVp8c4Fcyp29T0pTkow15TLifUOXAfQGfe8jK/SvI jpAAwxBDwQ4HNGA3y3HOzmIt5riRLGahASxDpyTDBmFiuRPwyXNxEoO6ZMtaSL9t ThhMc74EU8qFBBnzfaKkUZshB9jkcpQq800M99Wj5t31A4mNwz1tmAEM/Wvvbhea Yx2I+nS6CQhg0DMAxGqalTTLWxjY4NK+j6Mb5FVpXGJ5yUef2TWVRUymm5XlSA== -----END RSA PRIVATE KEY----- asyncpg-0.13.0/tests/test_test.py0000664000372000037200000000243113172407302017632 0ustar travistravis00000000000000# 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, loop=self.loop) 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'}) asyncpg-0.13.0/tests/test_prepare.py0000664000372000037200000005000013172407302020304 0ustar travistravis00000000000000# 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, loop=self.loop) self.assertFalse(self.con.is_closed()) await self.con.close() self.assertTrue(self.con.is_closed()) with self.assertRaisesRegex(asyncpg.ConnectionDoesNotExistError, 'closed in the middle'): 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, loop=self.loop) 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)) 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') 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') 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)) 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') 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') 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, loop=self.loop) 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, loop=self.loop) 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') state = s._state s = await self.con.prepare('SELECT 1') self.assertIs(s._state, state) s = await self.con.prepare('SELECT 1') self.assertIs(s._state, state) await asyncio.sleep(1, loop=self.loop) s = await self.con.prepare('SELECT 1') 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') state = s._state # Disable max_lifetime cache.set_max_lifetime(0) await asyncio.sleep(1, loop=self.loop) # The statement should still be cached (as we disabled the timeout). s = await self.con.prepare('SELECT 1') 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') state = s._state # Disable max_lifetime cache.set_max_size(0) s = await self.con.prepare('SELECT 1') self.assertIsNot(s._state, state) # Check that nothing crashes after the initial timeout await asyncio.sleep(1, loop=self.loop) @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') self.assertEqual(len(cache), 1) # Test that long and explicitly created prepared statements # are not cached. await self.con.prepare("SELECT \'" + "a" * 50 + "\'") 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') 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) asyncpg-0.13.0/tests/test_pool.py0000664000372000037200000006167313172407302017641 0ustar travistravis00000000000000# 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 inspect import os import platform import random import time import unittest from asyncpg import _testbase as tb from asyncpg import connection as pg_connection from asyncpg import cluster as pg_cluster from asyncpg import pool as pg_pool _system = platform.uname().system if os.environ.get('TRAVIS_OS_NAME') == 'osx': # Travis' macOS is _slow_. POOL_NOMINAL_TIMEOUT = 0.5 else: POOL_NOMINAL_TIMEOUT = 0.1 class SlowResetConnection(pg_connection.Connection): """Connection class to simulate races with Connection.reset().""" async def reset(self): await asyncio.sleep(0.2, loop=self._loop) return await super().reset() class SlowResetConnectionPool(pg_pool.Pool): async def _connect(self, *args, **kwargs): return await pg_connection.connect( *args, connection_class=SlowResetConnection, **kwargs) 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, loop=self.loop) 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, loop=self.loop) 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) con.terminate() await pool.release(con) async with pool.acquire(timeout=POOL_NOMINAL_TIMEOUT) as con: con.terminate() con = await pool.acquire(timeout=POOL_NOMINAL_TIMEOUT) self.assertEqual(await con.fetchval('SELECT 1'), 1) await pool.close() 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, loop=self.loop) await pool.close() async def test_pool_06(self): fut = asyncio.Future(loop=self.loop) 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: con = await pool.acquire() self.assertIs(con, await fut) async def test_pool_07(self): cons = set() async def setup(con): if con._con not in cons: # `con` is `PoolConnectionProxy`. raise RuntimeError('init was not called before setup') async def init(con): if con in cons: raise RuntimeError('init was called more than once') cons.add(con) 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, init=init, setup=setup) as pool: users = asyncio.gather(*[user(pool) for _ in range(10)], loop=self.loop) await users self.assertEqual(len(cons), 5) 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) con = await pool1.acquire(timeout=POOL_NOMINAL_TIMEOUT) with self.assertRaisesRegex(asyncpg.InterfaceError, 'is not a member'): await pool2.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') 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'.format(meth=meth)): c.forward(1) 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 setup_calls += 1 if setup_calls > 1: cons.append(con) else: cons.append('error') raise Error with self.subTest(method='setup'): setup_calls = 0 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() con = await pool.acquire() self.assertEqual(cons, ['error', con]) with self.subTest(method='init'): setup_calls = 0 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() con = await pool.acquire() 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, loop=self.loop) 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_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, pool_class=SlowResetConnectionPool) async def worker(): async with pool.acquire(): pass task = self.loop.create_task(worker()) # Let the worker() run. await asyncio.sleep(0.1, loop=self.loop) # Cancel the worker. task.cancel() # Wait to make sure the cleanup has completed. await asyncio.sleep(0.4, loop=self.loop) # 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(), loop=self.loop) await asyncio.sleep(0.5, loop=self.loop) 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)], loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) self.assertEqual(res, [1] * N) methods = [test_fetch, test_fetchrow, test_fetchval, test_execute, test_execute_with_arg] 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) 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, loop=self.loop) self.assertGreaterEqual(N, 50) 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 con = await pool.acquire(timeout=POOL_NOMINAL_TIMEOUT) self.assertEqual(await con.fetchval('SELECT 1'), 1) await con.close() await pool.close() @unittest.skipIf(os.environ.get('PGHOST'), 'using remote cluster for testing') class TestHotStandby(tb.ConnectedTestCase): @classmethod def setUpClass(cls): super().setUpClass() cls.master_cluster = cls.start_cluster( pg_cluster.TempCluster, 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', 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.start_cluster( pg_cluster.HotStandbyCluster, cluster_kwargs={ 'master': conn_spec, 'replication_user': 'replication' }, server_settings={ 'hot_standby': True }) finally: if con is not None: cls.loop.run_until_complete(con.close()) @classmethod def tearDownMethod(cls): cls.standby_cluster.stop() cls.standby_cluster.destroy() cls.master_cluster.stop() cls.master_cluster.destroy() 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', 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, loop=self.loop) await pool.close() async def test_standby_cursors(self): con = await self.standby_cluster.connect( database='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() asyncpg-0.13.0/tests/__init__.py0000664000372000037200000000102413172407302017350 0ustar travistravis00000000000000# 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 import unittest def suite(): test_loader = unittest.TestLoader() test_suite = test_loader.discover('.', pattern='test_*.py') return test_suite if __name__ == '__main__': runner = unittest.runner.TextTestRunner() result = runner.run(suite()) sys.exit(not result.wasSuccessful()) asyncpg-0.13.0/tests/test_codecs.py0000664000372000037200000013543413172407302020125 0ustar travistravis00000000000000# 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 random import struct import uuid import asyncpg from asyncpg import _testbase as tb def _timezone(offset): minutes = offset // 60 return datetime.timezone(datetime.timedelta(minutes=minutes)) 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) 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("-0.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("1.0E1000"), 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"), )), ('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}, ]), ('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, ]), ('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', [ # no months :( datetime.timedelta(40, 10, 1234), datetime.timedelta(0, 0, 4321), datetime.timedelta(0, 0), datetime.timedelta(-100, 0), datetime.timedelta(-100, -400), ]), ('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)), ('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('::'), dict( input='127.0.0.0/8', output=ipaddress.IPv4Network('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.IPv4Network('10.11.12.13'), textoutput='10.11.12.13/32' ), dict( textinput='10.11.12.13', output=ipaddress.IPv4Address('10.11.12.13'), ), dict( # Non-zero address bits after the network prefix are permitted # by postgres, but are invalid in Python # (and zeroed out by supernet()). textinput='10.11.12.13/0', output=ipaddress.IPv4Network('0.0.0.0/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)) ]), ('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), ]), ] 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'] 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) 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 TYPEMAP for oid, typename in TYPEMAP.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) 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) 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()) with self.assertRaisesRegex(ValueError, 'numeric type does not ' 'support infinite values'): await self.con.fetchval( "SELECT $1::numeric", decimal.Decimal('-Inf')) with self.assertRaisesRegex(ValueError, 'numeric type does not ' 'support infinite values'): await self.con.fetchval( "SELECT $1::numeric", decimal.Decimal('+Inf')) with self.assertRaises(decimal.InvalidOperation): 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): cases = [ ('bytea', TypeError, 'a bytes-like object is required', [ 1, 'aaa' ]), ('bool', TypeError, 'a boolean is required', [ 1, ]), ('int2', TypeError, 'an integer is required', [ '2', 'aa', ]), ('smallint', OverflowError, 'int too big to be encoded as INT2', [ 2**256, # check for the same exception for any big numbers decimal.Decimal("2000000000000000000000000000000"), 0xffff, 0xffffffff, 32768, -32769 ]), ('float4', ValueError, 'float value too large', [ 4.1 * 10 ** 40, -4.1 * 10 ** 40, ]), ('int4', TypeError, 'an integer is required', [ '2', 'aa', ]), ('int', OverflowError, 'int too big to be encoded as INT4', [ 2**256, # check for the same exception for any big numbers decimal.Decimal("2000000000000000000000000000000"), 0xffffffff, 2**31, -2**31 - 1, ]), ('int8', TypeError, 'an integer is required', [ '2', 'aa', ]), ('bigint', OverflowError, 'int too big to be encoded as INT8', [ 2**256, # check for the same exception for any big numbers decimal.Decimal("2000000000000000000000000000000"), 0xffffffffffffffff, 2**63, -2**63 - 1, ]), ('text', TypeError, 'expected str, got bytes', [ b'foo' ]), ('text', TypeError, 'expected str, got list', [ [1] ]) ] for typname, errcls, errmsg, data in cases: stmt = await self.con.prepare("SELECT $1::" + typname) for sample in data: with self.subTest(sample=sample, typname=typname): with self.assertRaisesRegex(errcls, 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) with self.assertRaisesRegex(ValueError, 'dimensions'): await self.con.fetchval( "SELECT $1::int[]", [[[[[[[1]]]]]]]) with self.assertRaisesRegex(ValueError, 'non-homogeneous'): await self.con.fetchval( "SELECT $1::int[]", [1, [1]]) with self.assertRaisesRegex(ValueError, 'non-homogeneous'): await self.con.fetchval( "SELECT $1::int[]", [[1], 1, [2]]) with self.assertRaisesRegex(ValueError, 'invalid array element'): await self.con.fetchval( "SELECT $1::int[]", [1, 't', 2]) with self.assertRaisesRegex(ValueError, 'invalid array element'): await self.con.fetchval( "SELECT $1::int[]", [[1], ['t'], [2]]) with self.assertRaisesRegex(TypeError, 'non-trivial iterable 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'))) 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) 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( TypeError, 'list, tuple or Range object expected'): await self.con.fetch("SELECT $1::int4range", 'aa') with self.assertRaisesRegex( ValueError, 'expected 0, 1 or 2 elements'): await self.con.fetch("SELECT $1::int4range", (0, 2, 3)) async def test_extra_codec_alias(self): """Test encoding/decoding of a builtin non-pg_catalog codec.""" await self.con.execute(''' CREATE EXTENSION IF NOT EXISTS 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(ValueError, 'null value not allowed'): await self.con.fetchval(''' SELECT $1::hstore AS result ''', {None: '1'}) finally: await self.con.execute(''' DROP EXTENSION hstore ''') 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 non-scalar type public._hstore' with self.assertRaisesRegex(ValueError, err): await self.con.set_type_codec('_hstore', encoder=hstore_encoder, decoder=hstore_decoder) await self.con.execute(''' CREATE TYPE mytype AS (a int); ''') try: err = 'cannot use custom codec on non-scalar type ' + \ 'public.mytype' with self.assertRaisesRegex(ValueError, err): await self.con.set_type_codec( 'mytype', encoder=hstore_encoder, decoder=hstore_decoder) finally: await self.con.execute(''' DROP TYPE mytype; ''') 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_override_binary(self): """Test overriding core codecs.""" import json conn = await self.cluster.connect(database='postgres', loop=self.loop) 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.cluster.connect(database='postgres', loop=self.loop) 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) 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.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.cluster.connect(database='postgres', loop=self.loop) 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_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( RuntimeError, 'text encoding of range types is not supported'): await self.con.fetchval(''' SELECT $1::citext_range ''', ['a', 'z']) with self.assertRaisesRegex( RuntimeError, '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_no_result(self): st = await self.con.prepare('rollback') self.assertTupleEqual(st.get_attributes(), ()) asyncpg-0.13.0/tests/test_connect.py0000664000372000037200000005063113172407302020311 0ustar travistravis00000000000000# 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 ipaddress import os import platform import ssl import unittest import asyncpg from asyncpg import _testbase as tb from asyncpg import connection from asyncpg import connect_utils from asyncpg import cluster as pg_cluster 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_CERT_FILE = os.path.join(CERTS, 'server.cert.pem') SSL_KEY_FILE = os.path.join(CERTS, 'server.key.pem') 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),), ("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),), # Despite the fact after version 10 Postgre's second number # means "micro", it is parsed "as is" to be # less confusing in comparisons. ("10.1", (10, 1, 0, 'final', 0),), ] for version, expected in versions: result = split_server_version_string(version) self.assertEqual(expected, result) class TestAuthentication(tb.ConnectedTestCase): def setUp(self): super().setUp() if not self.cluster.is_managed(): self.skipTest('unmanaged cluster') methods = [ ('trust', None), ('reject', None), ('md5', 'correctpassword'), ('password', 'correctpassword'), ] self.cluster.reset_hba() create_script = [] for method, password in methods: create_script.append( 'CREATE ROLE {}_user WITH LOGIN{};'.format( method, ' PASSWORD {!r}'.format(password) if password else '' ) ) if _system != 'Windows': self.cluster.add_hba_entry( type='local', database='postgres', user='{}_user'.format(method), auth_method=method) self.cluster.add_hba_entry( type='host', address=ipaddress.ip_network('127.0.0.0/24'), database='postgres', user='{}_user'.format(method), auth_method=method) self.cluster.add_hba_entry( type='host', address=ipaddress.ip_network('::1/128'), database='postgres', user='{}_user'.format(method), 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() methods = [ 'trust', 'reject', 'md5', 'password', ] drop_script = [] for method in methods: drop_script.append('DROP ROLE {}_user;'.format(method)) drop_script = '\n'.join(drop_script) self.loop.run_until_complete(self.con.execute(drop_script)) super().tearDown() 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.cluster.connect(**kwargs) except asyncpg.ConnectionDoesNotExistError: pass return await self.cluster.connect(**kwargs) async def test_auth_bad_user(self): with self.assertRaises( asyncpg.InvalidAuthorizationSpecificationError): await self._try_connect(user='__nonexistent__', database='postgres', loop=self.loop) async def test_auth_trust(self): conn = await self.cluster.connect( user='trust_user', database='postgres', loop=self.loop) 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', database='postgres', loop=self.loop) async def test_auth_password_cleartext(self): conn = await self.cluster.connect( user='password_user', database='postgres', password='correctpassword', loop=self.loop) await conn.close() with self.assertRaisesRegex( asyncpg.InvalidPasswordError, 'password authentication failed for user "password_user"'): await self._try_connect( user='password_user', database='postgres', password='wrongpassword', loop=self.loop) async def test_auth_password_md5(self): conn = await self.cluster.connect( user='md5_user', database='postgres', password='correctpassword', loop=self.loop) await conn.close() with self.assertRaisesRegex( asyncpg.InvalidPasswordError, 'password authentication failed for user "md5_user"'): await self._try_connect( user='md5_user', database='postgres', password='wrongpassword', loop=self.loop) async def test_auth_unsupported(self): pass class TestConnectParams(tb.TestCase): TESTS = [ { 'env': { 'PGUSER': 'user', 'PGDATABASE': 'testdb', 'PGPASSWORD': 'passw', 'PGHOST': 'host', 'PGPORT': '123' }, 'result': ([('host', 123)], { 'user': 'user', 'password': 'passw', 'database': 'testdb'}) }, { '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'}) }, { 'env': { 'PGUSER': 'user', 'PGDATABASE': 'testdb', 'PGPASSWORD': 'passw', 'PGHOST': 'host', 'PGPORT': '123' }, 'dsn': 'postgres://user3:123123@localhost/abcdef', 'host': 'host2', 'port': '456', 'user': 'user2', 'password': 'passw2', 'database': 'db2', 'result': ([('host2', 456)], { 'user': 'user2', 'password': 'passw2', 'database': 'db2'}) }, { 'env': { 'PGUSER': 'user', 'PGDATABASE': 'testdb', 'PGPASSWORD': 'passw', 'PGHOST': 'host', 'PGPORT': '123' }, 'dsn': 'postgres://user3:123123@localhost:5555/abcdef', 'result': ([('localhost', 5555)], { 'user': 'user3', 'password': '123123', 'database': 'abcdef'}) }, { 'dsn': 'postgres://user3:123123@localhost:5555/abcdef', 'result': ([('localhost', 5555)], { 'user': 'user3', 'password': '123123', 'database': 'abcdef'}) }, { 'dsn': 'postgresql://user3:123123@localhost:5555/' 'abcdef?param=sss¶m=123&host=testhost&user=testuser' '&port=2222&database=testdb', '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'}) }, { 'dsn': 'postgresql://user3:123123@localhost:5555/' 'abcdef?param=sss¶m=123&host=testhost&user=testuser' '&port=2222&database=testdb', 'host': '127.0.0.1', 'port': '888', 'user': 'me', 'password': 'ask', 'database': 'db', 'server_settings': {'aa': 'bb'}, 'result': ([('127.0.0.1', 888)], { 'server_settings': {'aa': 'bb', 'param': '123'}, 'user': 'me', 'password': 'ask', 'database': 'db'}) }, { 'dsn': 'postgresql:///dbname?host=/unix_sock/test&user=spam', 'result': ([os.path.join('/unix_sock/test', '.s.PGSQL.5432')], { 'user': 'spam', 'database': 'dbname'}) }, { 'dsn': 'pq:///dbname?host=/unix_sock/test&user=spam', 'error': (ValueError, 'invalid DSN') }, ] @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} test_env.update(env) dsn = testcase.get('dsn') user = testcase.get('user') port = testcase.get('port') host = testcase.get('host') password = testcase.get('password') database = testcase.get('database') server_settings = testcase.get('server_settings') 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, database=database, ssl=None, connect_timeout=None, server_settings=server_settings) params = {k: v for k, v in params._asdict().items() if v is not None} result = (addrs, params) if expected is not None: self.assertEqual(expected, result) 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__'} ) }) def test_connect_params(self): for testcase in self.TESTS: self.run_testcase(testcase) 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, loop=self.loop) 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}, loop=self.loop) class TestConnection(tb.ConnectedTestCase): async def test_connection_isinstance(self): self.assertTrue(isinstance(self.con, 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_SSLv23) ssl_context.load_verify_locations(SSL_CA_CERT_FILE) with self.assertRaisesRegex(ConnectionError, 'rejected SSL'): await self.cluster.connect( host='localhost', user='ssl_user', database='postgres', loop=self.loop, ssl=ssl_context) async def test_connection_ssl_unix(self): ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ssl_context.load_verify_locations(SSL_CA_CERT_FILE) with self.assertRaisesRegex(asyncpg.InterfaceError, 'can only be enabled for TCP addresses'): await self.cluster.connect( host='/tmp', loop=self.loop, ssl=ssl_context) async def test_connection_implicit_host(self): conn_spec = self.cluster.get_connection_spec() con = await asyncpg.connect( port=conn_spec.get('port'), database='postgres', loop=self.loop) await con.close() @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster') class TestSSLConnection(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, }) return conf @classmethod def setup_cluster(cls): cls.cluster = cls.start_cluster( pg_cluster.TempCluster, 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;') 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') # 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('DROP ROLE ssl_user;') drop_script = '\n'.join(drop_script) self.loop.run_until_complete(self.con.execute(drop_script)) super().tearDown() async def test_ssl_connection_custom_context(self): ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ssl_context.load_verify_locations(SSL_CA_CERT_FILE) con = await self.cluster.connect( host='localhost', user='ssl_user', database='postgres', loop=self.loop, 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_default_context(self): with self.assertRaisesRegex(ssl.SSLError, 'verify failed'): await self.cluster.connect( host='localhost', user='ssl_user', database='postgres', loop=self.loop, ssl=True) async def test_ssl_connection_pool(self): ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) 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, loop=self.loop) await pool.close() asyncpg-0.13.0/tests/test_listeners.py0000664000372000037200000002076413172407302020674 0ustar travistravis00000000000000# 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 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(loop=self.loop) q2 = asyncio.Queue(loop=self.loop) def listener1(*args): q1.put_nowait(args) def listener2(*args): q2.put_nowait(args) await con.add_listener('test', listener1) await con.add_listener('test', listener2) 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')) await con.remove_listener('test', listener2) 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, loop=self.loop) 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, loop=self.loop) with self.assertRaises(asyncio.TimeoutError): await asyncio.wait_for(q2.get(), timeout=0.05, loop=self.loop) 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(loop=self.loop) 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_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(loop=self.loop) 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 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) expected_msg = { 'context': 'PL/pgSQL function inline_code_block line 2 at RAISE', 'message': 'catch me!', 'server_source_filename': 'pl_exec.c', '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() self.assertEqual( await q1.get(), (con, exceptions.PostgresLogMessage, expected_msg_notice)) self.assertEqual( await q1.get(), (con, exceptions.PostgresWarning, expected_msg_warn)) con.remove_log_listener(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(loop=self.loop) 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(loop=self.loop) 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) asyncpg-0.13.0/docs/0000775000372000037200000000000013172407445015040 5ustar travistravis00000000000000asyncpg-0.13.0/docs/installation.rst0000664000372000037200000000250413172407302020264 0ustar travistravis00000000000000.. _asyncpg-installation: Installation ============ **asyncpg** has no external dependencies and the recommended way to install it is to use **pip**: .. code-block:: bash $ pip install asyncpg .. note:: It is recommended to use **pip** version **8.1** or later to take advantage of the precompiled wheel packages. Older versions of pip will ignore the wheel packages and install asyncpg from the source package. In that case a working C compiler is required. Building from source -------------------- If you want to build **asyncpg** from a Git checkout you will need: * 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. * Cython version 0.24 or later. The easiest way to install it to use virtualenv and pip, however a system package should also suffice. * GNU make Once the above requirements are satisfied, run: .. code-block:: bash $ make At this point you can run the usual ``setup.py`` commands or ``pip install -e .`` to install the newly built version. .. note:: A debug build can be created by running ``make debug``. Running tests ------------- To execute the testsuite simply run: .. code-block:: bash $ make test asyncpg-0.13.0/docs/faq.rst0000664000372000037200000000347513172407302016342 0ustar travistravis00000000000000.. _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? Short answer: no. asyncpg uses asynchronous execution model and API, which is fundamentally incompatible with SQLAlchemy. However, it is possible to use asyncpg and SQLAlchemy Core with the help of a third-party adapter, such as asyncpgsa_. 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. 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. 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 asyncpg-0.13.0/docs/usage.rst0000664000372000037200000003065113172407302016673 0ustar travistravis00000000000000.. _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.get_event_loop().run_until_complete(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 ` | +----------------------+-----------------------------------------------------+ | ``record`` | :class:`asyncpg.Record`, | | | :class:`tuple ` | +----------------------+-----------------------------------------------------+ | ``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.IPv4Network\ | | | `, | | | :class:`ipaddress.IPv6Network\ | | | `, | | | :class:`ipaddress.IPv4Address\ | | | `, | | | :class:`ipaddress.IPv6Address\ | | | ` | +----------------------+-----------------------------------------------------+ | ``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 \ | | timezone`` | ` | +----------------------+-----------------------------------------------------+ | ``timestamp`` | offset-naïve :class:`datetime.datetime \ | | | ` | +----------------------+-----------------------------------------------------+ | ``timestamp with | offset-aware :class:`datetime.datetime \ | | timezone`` | ` | +----------------------+-----------------------------------------------------+ | ``interval`` | :class:`datetime.timedelta \ | | | ` | +----------------------+-----------------------------------------------------+ | ``float``, | :class:`float ` | | ``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 ` | +----------------------+-----------------------------------------------------+ All other types are encoded and decoded as text by default. .. _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. 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('postgresql://postgres@localhost/test') 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', binary=True ) data = {'foo': 'bar', 'spam': 1} res = await conn.fetchval('SELECT $1::json', data) finally: await conn.close() asyncio.get_event_loop().run_until_complete(main()) 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. 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_app(): """Initialize the application server.""" app = web.Application() # Create a database connection pool app['pool'] = await asyncpg.create_pool(database='postgres', user='postgres') # Configure service routes app.router.add_route('GET', '/{power:\d+}', handle) app.router.add_route('GET', '/', handle) return app loop = asyncio.get_event_loop() app = loop.run_until_complete(init_app()) web.run_app(app) See :ref:`asyncpg-api-pool` API documentation for more information. asyncpg-0.13.0/docs/api/0000775000372000037200000000000013172407445015611 5ustar travistravis00000000000000asyncpg-0.13.0/docs/api/index.rst0000664000372000037200000002135513172407302017450 0ustar travistravis00000000000000.. _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 >>> loop = asyncio.get_event_loop() >>> async def run(): ... conn = await asyncpg.connect() ... stmt = await conn.prepare('''SELECT 2 ^ $1''') ... print(await stmt.fetchval(10)) ... print(await stmt.fetchval(20)) ... >>> loop.run_until_complete(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. .. 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 finally: 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. async with con.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*. .. 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: asyncpg-0.13.0/docs/conf.py0000664000372000037200000000524213172407302016332 0ustar travistravis00000000000000#!/usr/bin/env python3 import alabaster import os import sys sys.path.insert(0, os.path.abspath('..')) version_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'asyncpg', '__init__.py') with open(version_file, 'r') as f: for line in f: if line.startswith('__version__ ='): _, _, version = line.partition('=') version = version.strip(" \n'\"") break else: raise RuntimeError( 'unable to read the version from asyncpg/__init__.py') # -- General configuration ------------------------------------------------ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.viewcode', 'sphinx.ext.githubpages', 'sphinx.ext.intersphinx', 'sphinxcontrib.asyncio', ] 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 = None 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_theme_options = { # 'description': 'asyncpg is a fast PostgreSQL client library for the ' # 'Python asyncio framework', # 'show_powered_by': False, # } html_theme_path = [alabaster.get_path()] 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 html_context = { 'css_files': [ '_static/theme_overrides.css', ], } 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)} asyncpg-0.13.0/docs/index.rst0000664000372000037200000000130413172407302016667 0ustar travistravis00000000000000.. image:: https://travis-ci.org/MagicStack/asyncpg.svg?branch=master :target: https://travis-ci.org/MagicStack/asyncpg .. 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.5 or later and is supported for PostgreSQL versions 9.2 to 10. Contents -------- .. toctree:: :maxdepth: 2 installation usage api/index faq asyncpg-0.13.0/performance.png0000664000372000037200000004400113172407302017106 0ustar travistravis00000000000000‰PNG  IHDRæì(ñ…tEXtSoftwareAdobe ImageReadyqÉe<&iTXtXML:com.adobe.xmp Qšª0PLTElllåçêVVV†††ÕÖׯºÎ¶¶¶ÇÇÇÛÞæïðò¦¦¦–––ùùù»ÄÖž«Äþþþ-C^D5IDATxÚìÝ‹b£:¶hQ^Íû\ÿÿß^#ÄK¶³³w¥LÆìsº²‡¶,ÁôÊn\–ÌG 9hš€æ 9h@sÐ4Í@sÐ4 9hš€æ 9h@sÐ4Í@sÐ4 ¹c[åã¾ «ªî£øUù˜”Æ|·æÚ¬¸“õ«šPPV¯âWå]?¨{ðíš«‹H9&õóøácy—Å8ëžÆ|»æÚÉSyW•E1„‚*äõ]RÕ³xá¡ü~„²éšáþÏÓx.LÐ:€¿©¹»ŒÚ˶š¨§4^š”/ÿŽåü‹4¦9øqÆêýøçÁ4—/IÜ­+Š~NÒbÁ= ëã]2w,¿Û,_Ù?‰ÿ…æª>üAÝWº$|%Ýÿ{?ò?ÒÜÝVÍšžM/ìׂ:ÜuKã…‡ò¢ÈJãg™äSÍMé_ÿ'J·õ€æþ@sõ6¢˜Åœ„ûD/WE%åÕ–³ S—ÆŸ×ÜýÈóÿPmú ÐÜŸi®Ùgs“¶Ôk IUßR´¹¼ÞÔOwùÒøÓš«¶5 í°ïÐÜ¿Õ\»Šäž”M6ÚÆoA_i¼ÇòÖÂiüiÍõE6î‚B¯šûÏš›r¸y\p+¬)Û”°¥ñíIjÊûmô3h-7³ýÔr?4Ú¦½hî_j®º§eu›7“åŠ|òÊA_Ý Í=”ÛÈdÐZÿ7ÍÝ’ÅzšûWš»õ˳J†0©d§¯8hyŒŸáÇcöV=ÄŸÖ\¿Ÿ—™Ëæ€æþHs·é(wÉåC¸öãSPšý¼¾°½ÐÜinJ博ò ¯y¡@?jn]P°¬ª ëÅÓøÓš›îös¥:3-€æ¾@s¡î³R¶EnsZ•Æ·Í]‡òƒÓøóšËçICÈ2uJ ¹ÿ®¹<˶ÚYZ±`^žÆ åÙ² ®QHãOk.î 4ËÎ9 ¹?Éæ–ncXVäÛ£›ñØuã³òzIßâË4þ¼æî-'Óe¥Y–@s¦¹rÎʺu?:<…d¬²h§4b—–OG¨»p?­|ÿÍ}J䀿þXs“²pl™12­0ÈvÛ¥&ñ¢¹‡×åY,ˆÏ¡Lã©9Í}Á”¶œ—Ím»ôIÁ1þÛ¿.ÞS[ï§¥ñç5×ÕCYŽ·fÔ%€æþLs·[ÕôõÁ(cU÷û‚c<®‹½Ó×ݺû‘ÚâÏinç,¦;Ù~çÍý'ÍýKª/{0Éëýæf͇•zšûûšËË/;ÞsÍÝs¹¡ÃóÒ#-€æ¾WsC–Õ¡žj..SËî‰I*@sßšÍ}Ý¡^<Ó2¼ßyU^ûrÍ€æþ†æ¾;”›æn¯vdÐÜ›jn˜ýŸµBs@sÒ\½´ìÖDhî šËçåç³ææ=ð4wÍMjëÇ ¹|{⠀殡¹1> 3ìRPzÞÐÜ¥4·<ìkb°MÐÜÅ4w»UCÈè@š» æB[èŽ@s×Հ殩¹1 V6C9X4w5ÍÕá (õ<E§𻔿&¿·qšƒ’Y74w-ÍåEQ6AvÍ´T<³phîBš«‹lšdY†G[¶ži 4w)Í­;ÄÌBš»æÊ°yxýVº94w%Í !ë×mU= hîBš ûÍÙ¼ëœ{s@s×Ò\^Y]Î+ ªÌLK ¹Kin¯œÖÌu÷7^˜4w1Í…õáY{ š3hîbš»ÝòvÎëjÛÍ]Osš£9ÍÑ€æhhŽæhhŽæhhŽæhhŽæ4wÍe½í€æ.«¹é!_CåYÍ@s—Ô\3Lk.††é€æ®xon¬ú`º²ñ4K ¹KNAi£é<·hî¢;ÔÁtYmëp ¹?ÖÜØ6íávXWµÝGñ«ò1¯òñƒø³š›=í >™N¯šû͵Á'E¹¨™ «Wñ«ònÞ÷»_ÄÿJsÓß7÷w–é•@s ¹¦Xˆ¾ª—¸~/¤å]ã¬{ÿkÍMé`Óë•@sÿ]sù]Fu>¶Ã¢£jWÞNwǪgñÂCy&H6÷•Oãÿ¢9Íý‘æú¢h–BZ¶h«‰zJãõ¨IùôïõV=‰ihîû5w—PLëŠb˜“´a.¸§aÝc¼KæŽå÷Ío¥-ŠþILs@s߯¹l™ä5·fwÓ½·ú1~Ècù¸Í¹r|ˆihî4wÏÅÚ½ÅîIظ÷^ï²ÀCyµål!½Kcššû͵÷¬«š-r®5»›ò±ò1~Ècy½fwS¢W=Ä44÷ ªì.¸l]8·[©ô•Æ[p,ßi­N4WÓÐÜOi®âò¶°Œ{Ÿ²M [ßž¤v¡|—²…áÏ4ÞÌv@ŸšûÛëæ²¾Ÿ¶À™ÖÍu‰¾ºš{(_ïñÅÄ.ÿ‹æ<»hîgZÎSEÆaža²ÓW´<ÆO‚eÐr—½Uñ3^i®™Ëé ƒç€æþ@sÕ¦«,Lˆüš)(íCüyÍY˜Ä9|ü 0Íý³æv÷Íæ»i›¾æ…iü¨¹¹¼Ù¤ñç57ù-5«ûÃÿ$€æþ¥æŽ3Eš ™xÄæi¼“Ñ¡|'Á`À4þ´æªy2̜֯  ¹Oh®9dsù¾`^žÆËËe€q}Ø×1þ¬æêYŠeø§{5Þ  ¹Oh./–'qusÒ5ÝËãoÊ'ñmìºñYy½Ø,αLãÏjnÖÅ¿Îö$€æþæÂv9“…¦ÍU먫i§ÔiÕxû,^¼nÚ^®îÂ2¼òYüYÍ•ÁoUL¥9 ¹?ÑÜ”•Ùü”¹dÚó;Ûm—šÄ‹æ^×f±`¬LâOj®ïcˆ#¤/7ñÐÜ'4wûtsð¹ {ÿí_×ÎÛ…—Ý‹øsš«§ÁÐÝH¨)(@s ¹{­›º¯«ýB쪯›—ñ¸%Xé뺦¯ÛâÏhnZ¿WaöfÕ¿ðÐÜç4÷/©¾,Áz®¹jÎgá¹^ 4÷šë²/K°^<ì+²,‚¾Òx Žå;­Õ‰æêÏjn·†ÁÌ ¹¯ÓÜš›íS¶©0o·ç¯Û§láf]of;ðJs²9 ¹/Ó\µ¦^]¢¯î…æʇívZHäÒø_jN64÷eš+ŸŽLÆAËòɯËëCöV=Ä44÷CšÛÍŠü¢)(íCüÔ®44÷÷5Wîfüoúš ¤ñ«×m“Xæiü/5çÞÐÜinŸmrR«¹÷“ÀÿhŽæ€æhŽæ€æhŽæÐÍÑÍ 9š£9š@s4Gs@s4Gs@s4Gs@s4GshŽæ.¢¹1¯šÃaºªê>Š_•ß”Ä4€æhîÛ5×dÅD=Ⲻ½ˆ_•wýg}÷"¦94Gs߯¹ £ ¬9®—¸~/¤å]ã¬{Óš£¹ï×ÜÝVY5ÞÚ»”š)®&qåy}«gñÂCyyeÓ5ÃâË4¦94Gsß®¹1+²pˆ.êhÑVó"^š”/ÿŽåü‹4¦94Gs߯¹:&q!ûš“´aŽïiX÷ï’¹cùýÏç·’Eÿ$¦94Gs߯¹²È–©'ãôC¿j¯wÝÒx᡼(²5ÏËžÄ4€æhîû5—-IÙª½"j/ùZ¿z]µålÔǥ1Í 9šû~Í…ÅzÈŠ2ÎûßR¯1Ü\KãÛCŠ6—oƒŸS¢×>Ä4€æhîû5wOº¦¹ ¥m¬ñô•Æ[p,ßi-ü˜Æ4€æhîû5×ÜuUd}Ý—E˜¹OÙ¦„-oOR»PÞoó)ƒÖÒx3Û'š£¹¿«¹¢Ì£Œ²mYÁ¢¯î…æʇmd2h-iÍÑÜ÷knz”I<¼`§¯8hY¾´<–³·ê!6h €æhîGîÍ•‡¤Ë4Gs—ši9lÆ«÷úš•Æš[,«êÂzñ4¦94Gs߯¹]ŠÖ„ük[äö<¾mî:”ï$ ˜Æ4€æhîG–‡gÛØb¤³°yxß6)˳åq*í¼0î‹E{u¸ë–Ư^w+Šlgö$¦94Gs߯¹¶(Æ{Åwc˜E\‡|-_½®Úr¶aÊãÒ˜æÐÍý€æš"«Êlš÷?&©×n®¥ñí!E›Ëë5»›½ö!¦94Gs? ¹m=Á¼lnk¼}¥ñËwZ ?¦1Í 9šûÍ wÁ M5­ ˜f’ìS¶)aKãÛ“Ô.”÷Û|Ê µ4ÞÌvÀI€æhîoj®,²vIëÊ0#å ¯î…æʇmd2h-iÍÑÜhnìâL’1 éÜN_qв|1hy,?foÕCLshŽæ~bÝÜÊ,&SPÐÍ]Rs³˜6}Í ÒøQsë‚‚eU]X/žÆ4€æhîû5×µíítm‹Üš ½4¾mî:”ï$ ˜Æ4€æhîû5·[œ|7kö<^x(¿Ëlþu;/ Ocš@s4÷íšË×nËC*³8Ęon>Äc7OZIËë%}‹s,Ó˜æÐÍýÄ‚‚b˜ÖËݳ³y²;¥ŽUí”ÆCLãÒòi{¹º»uËÆ;iLshŽæ¾_saóÓ,ì€G/§ç¢d»íR“xÑÜÃëò,ÄmTÓ˜æÐÍ}ÿLË)Ý ÏúZ4?ÿ+«ŸÇÃÁû×µóváe÷"¦94Gs?°  kêºÚ»h¬ê¾_ÅãºØ;}ÝýH}Ý~Óš£¹ŸZ7÷Yª¢û¢#Ñ𣹳i./¿ìx4€æhîlš²ü«EshŽæN—Í}Ý¡hÍÑÜéîÍÑš£9š£94Gs4àèþ÷~ü»©á4Gs4üfÍ]òIs4GshŽæhŽæš£9š£9šhŽæhŽæÐÍÑÍ 9š£9š@s4Gs4€æhŽæh 9š£9š£9€æhŽæhÍÑÍÑš£9š£94Gs4GshŽæhŽæÐÍÑÍ4Gs4Gs4ÐÍÑÍ 9š£9š@s4Gs4€æhŽæhÍÑÍÑ@s4Gs4GsÍÑÍÑÍ4Gs4GshŽæhŽæÐÍÑÍ 9š£9š@s4Gs4ÐÍÑÍÑ@s4Gs4€æhŽæhÍÑÍÑš£9š£94Gs¿FsmSí>‡ªíŸK¿*ó*?ˆi 9š£¹Ñ\^«rš¬¸SV¯âWå]?ÅE?¾ˆi 9š£¹ŸÑÜXnš«‹Hý<¾½x]—Å8ëžÆ4ÐÍÑÜinÊ»¢rªI\y[ß%U=‹Ê'S6]3,GJcšhŽæhîg4W›æm5±$×£&åÓ¿cÔ[õ$¦9€æhŽæ~Fs]VôY”ØÝxÃ\zOúÇxgÆcùÝfó[i‹¢Ó@s4Gs?£¹òžw-šë‹¢™Këp×-w܇ò±(²5ÏËÆ‡˜æš£9šûÍÕSÞ•mwÔ¢“ò¯¥ñ¦Æcyµål!½KcšhŽæhîG4—‡¼lÑ\¶&ac¸é–Æ·-E;”×kv7%zÕCLsÍÑÍý„æÆ,$i‹æ¶±Æ[ÐWoÁ±|§µ:Ñ\MsÍÑÍý”æúy][ÔÜ>e›¶4¾=IíBù.e 7ëÒx3Û— €æhŽæþ¦æš¨£¨¹.ÑW÷BsåCQ´›Öš‡˜æš£9šû~ÍMk n·Ã e™ Z–/-ËtвJ-+ƒ–ÍÑÍý¬æÊ"kwWµmþUSPÚ‡˜æš£9šû ÍíöúÊŸÆš›Ë›í\X@Æ4ÐÍÑÜOk® NŠGlB>–Æ·Í]‡òƒӘ暣9šû~ÍÝ8“åý¿÷YÙ¼<ÊËe'‚õa_ǘ暣9šûkÊ5+çî»9M‹;Ð¥ñ]ŒÝø¬¼^lçX¦1Í4Gs4÷óš›ô4í”ZeÑNi<Ä4.-Ÿ¶—«»[·l¼“Æ4ÐÍÑÜ 4öžËvÛ¥&ñ¢¹‡×µY,X+“˜æš£9š;æ‚¿îrªŸÇÃÁû×µóváe÷"¦9€æhŽæ~Jsª¾nÆWñ¸-öN_×5}Ý~Ó@s4Gs'ÐÜÇ,º/:Í4Gs4w6ÍuÙ—¹‰æš£9š;›æ†,ÿªCÑ@s4Gs§Ëæ¾îP4ÐÍÑÜéîÍÑ@s4Gs4GsÍÑÍÑš£9š£94Gs4GshŽæhŽæÐÍÑÍ 9š£9šhŽæhŽæh 9š£9š@s4Gs4€æhŽæhÍÑÍÑš£9š£94Gs4GsÍÑÍÑÍ4Gs4GshŽæhŽæÐÍÑÍ 9š£9š@s4Gs4ÐÍÑÍÑ@s4Gs4€æhŽæhÍÑÍÑš£9š£94Gs4GshŽæhŽæš£9š£9šhŽæhŽæÐÍÑÍ 9š£9š@s4Gs4€æhŽæh 9š£9š£9€æhŽæhŽæš£9š£94Gs4÷'šk«|<|UÕ}¿*óãҘ暣9šûnÍ5e11¬j²).«Wñ«ò®Ÿâ¬ï^Ä4ÐÍÑÜ·k®)¢¯ê%®ŸÇ iy—Å8ëžÆ4ÐÍÑÜ·kn²\Óví°è¨šÄ•çu½—Æ å÷¤°lºæ~ òiLsÍÑÍ}»æÊ"kÃw5áÕQ[MÔS¯GMÊ—ÇrþEÓ@s4Gsß®¹n•W[ýœ¤ ·Å{Ýc¼KæŽåw›Ío%Ÿ”Æ4ÐÍÑÜ·k®Zo­Eõ1© ÷ÞêÇx᡼(²5ÏËžÄ4ÐÍÑÜ÷gsuÐÌÞº'aãê½á1Þ;åÕ–³ S—Æ4ÐÍÑÜ,(XÇ,³ñza<3o)Ú\^¯ÙÝ”èµ1Í4Gs4÷CšËû!+âT”m¬ñô•Æ[p,ßi-ü˜Æ4ÐÍÑÜin^:–qïS¶)aKãÛ“Ô.”÷Û|Ê µ4ÞÌvÀe 9š£¹¿žÍ å´”;Ë÷3/g}u/4÷P>l#“AkiLsÍÑÍýཹ®œÅµÓW´,_ ZËÙ[õ´hŽæhî5w³0!Ò4Gs×Ñ\[­šWÂmúš ¤ñ£æÖ˪º°^‹3i4Gs4Gs߯¹ÕVS^×Ün}øï×ñÂCù=ÜÌù$¦9ÐÍÑÍ}»æÆ,ëâº'a1»ËƒÓxUTR^m9Û0åqiLs 9š£9šûln'¼0ø¸¥^c¸¹–Æ·‡m.¯×ìnòeûÓhŽæhŽæ~Rsܬmc· ¯4Þ‚cùNkáÇ4¦9ÐÍÑÍýœæºr^ß¶OÙ¦„-oOR»PÞoó)ƒÖÒx3Û×EÐÍÑÍýuÍÓRïl:R—è«{¡¹‡òa™ ZKcšÍÑÍÑÜi®šžWÒéÈd´,_ ZËÙ[õ´ÍÑÍÑÜhn¦}å)›)(ÍÑͽ¿æ¦§}eÕ}Í ÒøÕëªmU]X/žÆ4š£9š£¹ÐÜô,®~·Yζȭ ùX¿zÝN‚Á€iLs 9š£9šûÍõÉÎÍÏ ÀÓøÕë¶§†µóÂð4¦9ÐÍÑÍ}¿æ²tÿ€,1æÛ£›ñØuã³òzIßâË4¦9ÐÍÑÍ}»æ¦'0×+ù¬§²ºÓìËöö$b—–O÷øêîÖ-ï¤1ÍæhŽæhîÛ5·îhâ0f‘í¶KMâEs¯ û³fÛ6ªiLs 9š£9šûnÍõš‹eY}|Íÿí_×ÎÛ…—Ý‹˜æ@s4Gs4÷Ý÷æž1Vuߌ¯âq]ì¾îÖ5}Ý~ÓhŽæhŽæ~^sS݉æ@s4Gs4w6Íåå—æ@s4Gs4w6Í YNsÍÑÍ]6›ûºCÑhŽæhŽæNwoŽæš£9š£9šÍÑÍÑÍ4Gs4Gs4ÐÍÑÍÑ@s4Gs4GsÍÑÍÑÍ4Gs4Gs4ÐÍÑÍÑhŽæhŽæh 9š£9š£9€æhŽæhŽæš£9š£9šhŽæhŽæh 9š£9š£9ÐÍÑÍÑÍæhŽæhŽæš£9š£9šhŽæhŽæh 9š£9š£9€æhŽæhŽæš£9š£9šÍÑÍÑÍ4Gs4Gs4ÐÍÑÍÑ@s4Gs4GsÍÑÍÑÍ4Gs4Gs4ÐÍÑÍÑhŽæhŽæh 9š£9š£9€æhŽæhŽæš£9š£9šhŽæhŽæh 9š£9š£9ÐÍÑÍÑÍý2ºÿ½ÍÑÍÑÍásäox‚ÑÍÑÜ%47¶‡ÃtUÛ}¿*ó*?ˆiŽæhŽæhŽæ~Bs}±N“wÊêUüª¼ë§¸èÇ1ÍÑÍÑÍÑÜÏh.+¶ÕE¤~¿z]—Å8ëžÆ4š£9š£¹ÑÜ8[6WMâÊÛú.©êYüêu·ò~¦kÖc¥1ÍæhŽæhîû5Wõå”v•[b7k«‰eiüêuÓ¿cÔ[õ$¦9ÐÍÑÍý€æÊ8²¸%iÃüÓ= ëãÛ‹×MÇ™ßJ[ý“˜æ@s4Gs4÷š«‡¡Ü ,öEѬ÷ÞêÇøöâuãfÊ¬ÈÆ‡˜æ@s4Gs4÷C÷æn·Ms÷$,:)ùZß^¼®Úr¶Þ¥1ÍæhŽæhîšÛæ\Ž¡0o/^W¯ÙÝ”èU1ÍæhŽæhî5—=ü4»/o/^·ÓZh®¦9ÐÍÑÍ#›s.³‡øv{þº}ÊnÖ¥ñf¶®ü4Gs4Gs4÷šë}u/4÷P>E»i­yˆi4Gs4Gs'¸7·ÓW´,_ Z–é e• ZV-As4Gs4w²{s_3¥}ˆi4Gs4Gs'Èæ6}Í ÒøöâuÍv., Hcšûÿ»ú5’æhŽæhîÇ57,/™DÕ<Æ·¯ÛI00iŽæhŽæhŽæN ¹- ›€§ñíÅëîÿÄÖ‡}cš£9š£9š£¹Ÿ¿77f1MËgõ¥ñmìºñYy½Ø,αLcš£9š£9š£¹ŸÏæ&=M;¥VY´S1K˧íåêîÖ-ÏÇLcš£9š£9š£¹hnšYd»íR“xÑÜÃëÚ,,ƒ•ILs4Gs4Gs4wÍÝåT?‡ƒÿö¯kçíÂËîELs4Gs4Gs4÷3šK¨úº_Åã¶Ø;}]×ôuûALs4Gs4Gs4wÍ}ìÀ¢û¢#ÑÍÑÍÑÍMs]öen¢9š£9š£9š;›æ†,§9š£9š£9š»l6÷u‡¢9š£9š£9š;›æn4Gs4Gs4Gs4Gs4Gs4Gs4Gs 9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š£9š»šæÆ6Ïó7ûÿ‘æhŽæhŽæhÎ5’æhŽæhŽæhŽæhŽæhŽæhŽæhŽæhŽæhŽæhŽæhŽæhŽæhŽæhŽæhŽæhŽæhŽæ4!ÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑœk$ÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÍÑÜeÌ«|¤9š£9š£9𻢿º¾˜èGš£9š£9š£¹Ëi®ËŠ™¬£9š£9š£9š»šæÊ¢(›®îÿÐÍÑÍÑÍ]LsÍ]ocÔ]Es4Gs4Gs4w-ÍÝí6¿µ¶(zš£9š£9š£¹Kin,Šå7+²‘æhŽæhŽæhîJš«¶n(ŠŽæhŽæhŽæhîJš«‹¢‰?ö¯nÎÑÍÑÍÑͽ¿æjš£9š£9𣹋in—ÂÝ5WïÌvÀ5’æhŽæhŽæÞQsCQ´‰Ýi®kÿÃ0ü­Cÿί†ëÈÿî 2jBM¨ 5ῦ;§æêC6W}…æþÞÚ‡“¼¿YÃËWPjBMø‹›ðSPZ­ãÓ„šPjÂ+i®ÙnȽ\P uœ`šPjBMø¦šË‹bXþ÷‹Lë8Á4¡&Ô„šðRš»•Ëίö¥uœ`šPjBMø®š«» g¿5çs‚iBM¨ iî_3m7Ww·îƒx´ŽLjBM¨ ßUs·vÚV5ûh[U­ãÓ„šPj·ÕÜì¹{.×i'˜&Ô„šP^Os·[×ôu«uœ`šPjBMxMÍi'˜&Ô„šPÒœÌ ¦ 5¡&Ô„4çs‚iBM¨ 5!Í9Áœ`šPjBšà"Ѐæ 9hš€æ ¹ÿDŸý‚¨Í²öiÝËkװ˲æ•˯QgteV_ûÜ«Ëßqþá )Í=e¬çÇJÅ/ø€ª¢¨ž_¨îÏk˜Å[_D«º¾B5>ÒÜu«¶\þ‹Â…”æ~êr<¿hŽæNË0_"¯­¹þÚçÞpqÍäBJsÿÐ:Åõ+ûBs]ž_»†cžwï\«ëkn¼¼æú_£¹­'ÍÉæ^hN iN6Gs²¹7>ºnº¹ÑWó÷ù{ë›æîõëëæƒ³.=Ìykx裛æÚ{C7íë&»ŸšSt¶&ô¤Òߪ¹¬ºûe¢ˆ_6êíqVdmøÅÔ0÷Ö‡9ˆíÑdsXÝ–/)õ\p¶ñ¯ûկ鲭Š÷^4פ–®>€¬^%?‘]ݦ¿êç¿*O7À÷øáçI ›¹.ý¸ÿ¦YÍUœm¾âýͶóÎÂÉ_¬ßˆ§î:·Õ½S5bšg ýØÎTÇlî[e1³¹Pïa:ËŠüÕ¹zò½¥Û3wÒ“^H¯æîŸo7­¨š;ÒtáXºe{¸s.‰SZÐÌ—ÄpµŸÚ¯]®›í´ët—<~ûë˜Ü«Psv6Äxè¢Ü¦Ëçë0Tk6WÅ~اû¢œ~øiã<Ô°ŽÙ¯ßmêùUáÒ²v]A—Ý.¶àÒÓÕ¿¼íïÍaå\ó¼¡:Ây¨¦w>ÎI÷ðä­G͵ñ{I›(mø‡Ãœ·†iš‹—— çnŸÇÁˆüÔôœÒ_¬¹ù[G;}X“í,4Ö®u²åeþÛõJ“­ß]Χ¹fýî¿»HNoºÙ½ã6J _’…|þͬ¹~©qyºÙ8釟6NZÃû)4“œþ2_y«ÎöM¥)–™[lê›cüEsÔ\³¼ìIC§áD”ËE»\[ìðÖcÛ4ËËš5­Mþp˜×0í£QsÙrõÈ–/`é¹»õäüÔôœÒ_¬¹ö¶ûÖ1ƤZ¿N-­ljÂïÛmæ×ÜNëïÇÓ`ÛðÁ\Ãí7×q‹c%¶Ü5î4oܵíÉÚ0ùð'­áZ•ø ÌÜ-Ã(·¶=]6Ïøn½&V[ûì4÷aC§¿?[‹¥¿øÖc6×Á¯ßD^6|{¶/›é[{v™‚ºoo»/“OštL´yÖNzÎ é/Ö\ü©^OnîVù±uòÝ׬f›±7_r†µÿe'Ô\¿Ö°Ú¿Á¹'mq³Œª×·ýÌgàômmhOنɇÿÐ8i wkwÂ'k<Ýiθ€®Ù®óWãxqèÖ[TÅ.ù~ÙÐiG8U«ÛþôIßúqAAWeë¹ú¢áÏv¦oí¡Œy_,š{qîÖg¼7w褧¼þ^Í-5¯æ†h–k^y»=[Õ~Ño£>óë“ߟSssŸÚ}Ñ*?nñ<qº³“•á?óÕ$δ ó£²²>ߊ‚hœ‡†‰óÂÕd™‚2ß'ïO7ß¾ÙFQËel+Û];7Í®‰IC?t„ó°k±yÔ.}ëë€r[»é°¯>;Y6—¾µ‡ È¢¹±™' ¤š[ÎÝ~û«üÜô”Ò_<Óò¶æÚSCŒYL¦ëcëdû?ØåUlìÄš«w§J¾ûb<Œì† òp*ÕÅžMsËÌßó­(ø‡Æy¨a¶¯à¦¹[/¡g{r³}s_ƶB=Êx‹îayxý¬¡ÓŽpÊï)·ò˜wÆ·³¹uM˰hîUßm¦eúÖ. QsqAÈ4õ0{í­N˜Í}Ü8i ·%9ýnnév½<_6[dnÝ…ç`Ôj.mèójn\æqkúÖÍåÙSÍ=æ¼5|裋沵cf»ÓMÊöìô„Òßü”:>!#_½°}Œã$é§ßÄÅûÓ2ÍîöN÷æB•Ã\›!ö¼l7Ѱšÿ 챞‚Ò/÷’O·¶ø硆Ãö„¥í)(c|°ÔØœíqøM|2ÄÔbÃ6hµ¶CÌmþ©¡Ï{o.´X{ëÂ$§áöøÖ·AËéch²â©æsÞ>^@â åô˜Õ|(Šg÷æÂŠîW«ª?éSPŽô„Ò_|onyh\½WßòU©\ž8š ‡òr¹n¾Ó½¹`ôù­Ï£tU˜¼6@±2õZ·Ýpúþj8ãÿ©qjž†;?1q÷LË:Ìá‹ ~²+H™>ç¯)¶„¥gÍ=̉k˜ôÑ~‚:j9¥sõósw^örÂlî¡“žïBú‹gZÆçŠn7œöÏü«Ök'Ÿ~œwŸåOŠ3k.$dÛcÞãó`ï¿ë–«ß¼‚¬(Û}Ý–¿:ÛtûnœÇÆ™éY}Ø¡ Ž×ádÙêÔnó.óÝ(Øöu£\w(8fkdž>³ænM9ŸƒË›ã[?.(¸ ÓÏ>=̉kxì£qAÁ²v3|ëŸ4Ù8„/ys¯>tÒó]Hõ‚‚®©÷¿h÷“,ƼzÞŸ¦m’š÷ÜuzÌ×}¡bëúpÝÛº¯ÛÔ"mÓ÷'ݬì'­á½É׬“©ð„;êŰë.dQmÙ~²üs }êN9ŸýGo}Úz­›ûbû©Ãœ¹†O/ U=?€a¬^\wnaûÇz›‰ÞNz¾ ©usýÙºÐY’¥‹röm·Ÿ%_ã•öÓ»|ü‚¦ø¢Ãœ¸†]—Ÿõ¤|ÖIÏw!¥¹Ûn<¨¿aŸ7\»‚íj®>ÝD ?‘À~–s÷Ó‡9q ·ÍC²α©Î!¥¹ø})ÏO·òòG©šìÚšëªá|³j>¾‚´ÓdÃáBm7[·@üÙÜ·†Õü¨½1?ݲ¹‡NzÎ )Í­­U\ê òç_COžëü)ý w|ÿÍeç›OþgäëÄÊá‡9q ×¹¦E{òNzÎ )Ím­Ó»3·×\viË…ÅsçVÆ3ÍeÕ¥¡-ã<ùñ ‡9o Ç8¸¬ÎÞIÏy!ý­šÇcSŒy{Ã~ðáêλ7è¤I›´ÝõúYUWÝisÞŽmÓ´oÐIÏy!ý­šü h@sÐ4Í@s_J—eO§¦ÏÊ Öª.³í,3ÞÍý%ò‹?û`ÛœëRòµŠ'àù6ŽÍÑ@s^«Usž¼šû[t]çCÀ©/ÙGã£ó Hs 9—Ô\¼.Ñhî+¿7u_7ãšÍÅŸ¦Ím×=³ÃWÌ{Áþátm3m8=¾á³¯U›çéÎxo×Ã6ÔӣǷ­á¡“n#y³m{þî•^³¹qÑ\»m/ý¬ËvM}ÿõØæã¥N¿6_0ÏO\µãe3T(^.óµÓÓ£Xóp9m¶'¥ß£¡®¾¯ÛÒ\_ÌÌ3»Ö{sÍüHðøDøûY×Í_îÜÍ¿/ï¥ï÷µóZµyBSm3·_<µº!„Mûž;Ù;éronœ+U ã*Ü›+»ù œwÿØe—°}²ùì[Ÿ~ò‘Mu梎=òVÍ6׫·Š…=+§Ïë¹cvëù¹^\¿¥ÛþzÍõÓFNe¹l’´h.lð4dK;ÞϺi”).·V{I½á”°kÕæ¹æúXÁù8mûU„]¿Î·c׿ï¤Qsó^fårx÷J'3-§Š„ÚÊñY—ÝW®ºÔé7fq+ÖìÄ5Kzd.—ålî|Ý2½*fogKÇœµ=ïž—Íýö[ºío×\;ï˾vÛYÖÆoÓGÞÞæ -û{A»àôEëž°wå[nÆz­Ú<×\øªØÝ¿D†~¯YŸÇo‘ùÛwÒ¨¹{TÛÎÔï^éDss—Ç.švÙP¹iðk½:^çô«æ‹O¿¦Jçï‘åÜÃò9Œ…¡ mè®E6 ^îêÛÎY_ùMÝö·k®Y>ʸ=`>÷­µ¡Úù›I¶|Aiço$åògeñ–ÙÜ•jóBsÕ2Ö,ß*ã·Îüí;鬹j½ Ε|÷J¯šëç.:W®›»hÚe×ÊWo©¹O¿ð½¥ŠWýwè‘ã®5šÝ¨e³œºc¶Kî¦j¶ËñMÝö·k®ªëÛ®â—Évû"5 /[óçðeû}û¦ÙÜ…jóü,Œõè•ãÞˆãÚœùÛwÒYsëW±xÍ÷J'÷æ–ÛRóÐUÒe§Òn­\u±Ó/ Wfgn´¤Gvqhù^…içß1ê:~Y‡•çòÕc÷{Ïê¾¥Ûš‚2ÂU¶×Ünç÷>ü˜­“ëéu»ßgï™Í]¨6Ï5ׯ5ÊöÕªßòÞ\ÒIg!l•—ÑŸ·®ô‹§ 4¡ÎI—Ýý¾GÍýÃéW&¨¼Aœî³5ÝþK77M>Gã®~Íq0ö[º-͵õ°›%4Ÿeýú]qj…zɾc¬÷¿ÏÞ2›»Rmžk®Ù²ñÛm;“š÷œiy줳æv™whÐw¯tÿü)(í³pWùú 5÷§__œýöÁ±G¶áç¬ °šÃw•í¡=¡ ßúé·«¿]scœ[«æúÃÓ”ªx–-®›âÝïßt¦å…jó\sín(¬ÛNê³¹´“†Ëw_ŠË¨¹·®tronyósAÒe•«.wúU'OæÒyË£ôæß¡Šm¬Ã°j=G{}K·ýíš›æ²öM>ïÍõkš‡¶ž^·ûý{fsWªÍsÍU;ŒÛ©S¿c6—vÒpaÜUjÍæÞºÒ/žiY%ƒ”!‹ýÐVuµÓoÌN>;6í‘¡2}¹$wó¨å’¦&šë4÷÷»í/×\·®ÀlöšÛ ϲ3„Lzû}÷ž3-¯T›çš«÷WŽíÂ2¼¡æ:é“{sÃûWúõ½¹ê¡Ëîâþ-_~÷:•묎wè‘KG¬·É'Íچɠåö½¤kêî{ºí/×\µ~Æý^sÕþ£/æùÌÝúÙ»ß7o:ÓòBµy®¹~?äU®óö²7ÔÜC']gZŽ{«¿{¥ÓusÛ|»Çðøûêb§_3É¢<ñ°eÚ#ë²·„, ­] ˜ds‡…0Ý÷t[š›Û+Ïö÷æÆly.Mµ.ã–¦˜T0·Ež½éº¹ Õæ¹æâ2Of^òL·ڷ盧æ¶g*Í&x÷J§ëæ†Ýµ/í²Såúµ©«k~]XqÐeçmµ´Gn9]¹å£Ãâ«Dsëŵ[—‡ÿõnkÐrZ?†‡ÊmÙÜôÙ‡¦˜–(Îû‚ÜË»ùÑmñÁJ÷¿ëŸ½çSP®S›š íŸ8Ýë¸W¸êßò)(4Žes_*Ù_ ÒÃÃSPò¹‹>;CåÆ÷} ÊG§ßÖžg}¤eÚ#Çø¼¹±Ù=x½–$š[.®]¹ Büýnk Jx”ܽ±²0¾<Ó²\»6ŸCó#öƒ×ê圜Ÿ\úžëæ®T›çš+OÑ[ž,›õï8Ó2í¤QsU¶ôÑ0dôî•NïÍ-]´yÚeƒßÊùÿ«K~ÍòÐò¼OûJ{df]†‹æÎåíþû˦¹ù¯©K·µ `ž›‡Ï~·CA]쟚}oŸ|^²>T¼œ£7iy¡Ú<×\µ6ìÜÎCpBÞl‹”Þ·“.×¼Ü?%þÝ+h®k±ª]6V¾iÞq¦å§_·>±¹;o¢šöÈ[Ý4,­ÞŒ—fsËY=~W·µ<zéJ_YsW<ýŠO×å[º-Í}Šq|hµ®ŠSÔæŒ5|(i›¦½z'½n¥ŸtÙ×ÕvúýpóödÝ–æ†æ4Í@sÐ4ü#]–5×®a]:—šÃÃÓpß÷©¸±ÿH¿îê€æð{ˆ{³½¯æ†Oêk 9€æð{5wëºî½+ ›h¸`’CsÍáÓµyØè}·oñØÔ}ÝÌÊËó²(ò¼›²¹ñ6¶ùò²1ocv7ïA}VÖ Üß{·«òm Úm¾ÓܱJysØÖ 9à­rìVÏÏwïÖË} ìê8?ú½¨ç{s÷ÿZú{ïÕ5ñÅg}üïZv½¹8ïË|ãíüæ³ü˜õ«4ÆÏ£ìtÐð–š»_dziëŽlŒÈʲŒ^ áE§ ”ëNå¼QóPÄ?>«Ö <ÑÜRñy#“%›Kª4…å´™YÆs 9à5w¿€·Óº¸y æ6^Þ»è±ãLË&&y·±{~Õó«»¾x¹Ùjx›+–j®Èî~ë꘢FÍ%Uªb›ËìÙ Ð~›ææ.\Í×ñfÉ×–Ý7ÍõÁnÙòÛ&¸±—Ãäç­á+ÍUË šUsi•úhû{úêTÍo©¹jŸŸ­‹©«ù⟬›[t6_ôûuãâ%éy+ÍÅô¬›k>¿.­Òwm«·€æ€wÔ\œ=’íÇ»*{ª¹¨³nþg7Wÿ¼£–¯5·ˆ9[œý¤JSÒ7hxcÍÝŽškë0m£xª¹¨„º(ÚY9ÿ§8í˜ÞkÍ-é,—<îY•†0³¬­(Í啕젹uþüð ¹>:"_oTEμŸæÚÃ+VÍ%Uj2+ @sÀe47M²ï›||qonþ·ÛR»j¥=m Í ‹æª5›ËÖ×=«Rׄü¶uÐð~š; ZvËò¹uP/}ts9¯'ïæŸ‹·©á¦¹rÑ\½Ö|X³¹WUj³M‹ÍïšÍUû¡½§š»+./ã$Å~øëʲ>m £®Ó”Òã”ø›~ºÜWi\ëõ¾[44š{Ô\ž=¿7&Y.³7ªuR~Þ\gÉW—)6ê¹b}ÊWµj.­R¶|>•l4¼¿æºù™(c˜wÑ첺|?æ·þͰML9íSP)—á1•y˜b³<eªêÅu˜T©_îI.O…hx/Íôaúüä¸lžtÑÎK 6Í5Ŷ⬠S3ÊâÌO|Œ˜ŸÈ<­XgZ–éÃ<ŸTi + †ÕúÍïœÍ- Ê<oÉÞêæ¦ ÿ:«2¾<«O< q®@v 5«×™–k]wšK«”Ç=2–Í— oê*¤fm3Û¬«>ZÝ5ußœ{8o­@ÞlûÆÍ ªºiÿ©JmÓ÷ue5hÀјRÐ@sh 9€æÐ@sh 9Èhî$@sšóhš€æ 9hšÐ4Í@sÐ4Íhš€æ 9hšÐ4Í@sÐ4Í~ÿ_€ A&CŽÁIEND®B`‚asyncpg-0.13.0/setup.cfg0000664000372000037200000000004613172407445015731 0ustar travistravis00000000000000[egg_info] tag_build = tag_date = 0 asyncpg-0.13.0/asyncpg/0000775000372000037200000000000013172407445015554 5ustar travistravis00000000000000asyncpg-0.13.0/asyncpg/connresource.py0000664000372000037200000000216213172407302020624 0ustar travistravis00000000000000 # 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)) asyncpg-0.13.0/asyncpg/introspection.py0000664000372000037200000001140113172407302021013 0ustar travistravis00000000000000# 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 _TYPEINFO = '''\ ( 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.typreceive::oid != 0 AND t.typsend::oid != 0 AS has_bin_io, t.typelem AS elemtype, elem_t.typdelim AS elemdelim, range_t.rngsubtype AS range_subtype, (CASE WHEN t.typtype = 'r' THEN (SELECT range_elem_t.typreceive::oid != 0 AND range_elem_t.typsend::oid != 0 FROM pg_catalog.pg_type AS range_elem_t WHERE range_elem_t.oid = range_t.rngsubtype) ELSE elem_t.typreceive::oid != 0 AND elem_t.typsend::oid != 0 END) AS elem_has_bin_io, (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 = '''\ WITH RECURSIVE typeinfo_tree( oid, ns, name, kind, basetype, has_bin_io, elemtype, elemdelim, range_subtype, elem_has_bin_io, attrtypoids, attrnames, depth) AS ( SELECT ti.oid, ti.ns, ti.name, ti.kind, ti.basetype, ti.has_bin_io, ti.elemtype, ti.elemdelim, ti.range_subtype, ti.elem_has_bin_io, 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.has_bin_io, ti.elemtype, ti.elemdelim, ti.range_subtype, ti.elem_has_bin_io, 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) ) SELECT DISTINCT * FROM typeinfo_tree ORDER BY depth DESC '''.format(typeinfo=_TYPEINFO) TYPE_BY_NAME = '''\ 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 ''' asyncpg-0.13.0/asyncpg/types.py0000664000372000037200000002375713172407302017300 0ustar travistravis00000000000000# 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 __all__ = ( 'Type', 'Attribute', 'Range', 'BitString', 'Point', 'Path', 'Polygon', 'Box', 'Line', 'LineSegment', 'Circle', 'ServerVersion', ) Type = collections.namedtuple('Type', ['oid', 'name', 'kind', 'schema']) 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.' Attribute = collections.namedtuple('Attribute', ['name', 'type']) Attribute.__doc__ = 'Database relation attribute.' Attribute.name.__doc__ = 'Attribute name.' Attribute.type.__doc__ = 'Attribute data type :class:`asyncpg.types.Type`.' ServerVersion = collections.namedtuple( 'ServerVersion', ['major', 'minor', 'micro', 'releaselevel', 'serial']) ServerVersion.__doc__ = 'PostgreSQL server version tuple.' class Range: """Immutable representation of PostgreSQL `range` type.""" __slots__ = '_lower', '_upper', '_lower_inc', '_upper_inc', '_empty' def __init__(self, lower=None, upper=None, *, lower_inc=True, upper_inc=False, empty=False): 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): return self._lower @property def lower_inc(self): return self._lower_inc @property def lower_inf(self): return self._lower is None and not self._empty @property def upper(self): return self._upper @property def upper_inc(self): return self._upper_inc @property def upper_inf(self): return self._upper is None and not self._empty @property def isempty(self): return self._empty def __bool__(self): return not self._empty def __eq__(self, other): if not isinstance(other, Range): return NotImplemented return ( self._lower, self._upper, self._lower_inc, self._upper_inc, self._empty ) == ( other._lower, other._upper, other._lower_inc, other._upper_inc, other._empty ) def __hash__(self, other): return hash(( self._lower, self._upper, self._lower_inc, self._upper_inc, self._empty )) def __repr__(self): 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__ class BitString: """Immutable representation of PostgreSQL `bit` and `varbit` types.""" __slots__ = '_bytes', '_bitlength' def __init__(self, bitstring=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 == ' ': 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_=None, bitlength=None): if bitlength is None and bytes_ is None: bytes_ = bytes() bitlength = 0 elif bitlength is None: 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): return self._bytes def as_string(self): s = '' for i in range(self._bitlength): s += str(self._getitem(i)) if i % 4 == 3: s += ' ' return s.strip() def __repr__(self): return ''.format(self.as_string()) __str__ = __repr__ def __eq__(self, other): if not isinstance(other, BitString): return NotImplemented return (self._bytes == other._bytes and self._bitlength == other._bitlength) def __hash__(self): return hash((self._bytes, self._bitlength)) def _getitem(self, i): byte = self._bytes[i // 8] shift = 8 - i % 8 - 1 return (byte >> shift) & 0x1 def __getitem__(self, i): 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): return self._bitlength class Point(tuple): """Immutable representation of PostgreSQL `point` type.""" __slots__ = () def __new__(cls, x, y): return super().__new__(cls, (float(x), float(y))) def __repr__(self): return '{}.{}({})'.format( type(self).__module__, type(self).__name__, tuple.__repr__(self) ) @property def x(self): return self[0] @property def y(self): return self[1] class Box(tuple): """Immutable representation of PostgreSQL `box` type.""" __slots__ = () def __new__(cls, high, low): return super().__new__(cls, (Point(*high), Point(*low))) def __repr__(self): return '{}.{}({})'.format( type(self).__module__, type(self).__name__, tuple.__repr__(self) ) @property def high(self): return self[0] @property def low(self): return self[1] class Line(tuple): """Immutable representation of PostgreSQL `line` type.""" __slots__ = () def __new__(cls, A, B, C): return super().__new__(cls, (A, B, C)) @property def A(self): return self[0] @property def B(self): return self[1] @property def C(self): return self[2] class LineSegment(tuple): """Immutable representation of PostgreSQL `lseg` type.""" __slots__ = () def __new__(cls, p1, p2): return super().__new__(cls, (Point(*p1), Point(*p2))) def __repr__(self): return '{}.{}({})'.format( type(self).__module__, type(self).__name__, tuple.__repr__(self) ) @property def p1(self): return self[0] @property def p2(self): return self[1] class Path: """Immutable representation of PostgreSQL `path` type.""" __slots__ = '_is_closed', 'points' def __init__(self, *points, is_closed=False): self.points = tuple(Point(*p) for p in points) self._is_closed = is_closed @property def is_closed(self): return self._is_closed def __eq__(self, other): if not isinstance(other, Path): return NotImplemented return (self.points == other.points and self._is_closed == other._is_closed) def __hash__(self): return hash((self.points, self.is_closed)) def __iter__(self): return iter(self.points) def __len__(self): return len(self.points) def __getitem__(self, i): return self.points[i] def __contains__(self, point): return point in self.points class Polygon(Path): """Immutable representation of PostgreSQL `polygon` type.""" __slots__ = () def __init__(self, *points): # polygon is always closed super().__init__(*points, is_closed=True) class Circle(tuple): """Immutable representation of PostgreSQL `circle` type.""" __slots__ = () def __new__(cls, center, radius): return super().__new__(cls, (center, radius)) @property def center(self): return self[0] @property def radius(self): return self[1] asyncpg-0.13.0/asyncpg/pool.py0000664000372000037200000005471213172407302017100 0ustar travistravis00000000000000# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import functools import inspect from . import connection from . import connect_utils from . import exceptions class PoolConnectionProxyMeta(type): def __new__(mcls, name, bases, dct, *, wrap=False): if wrap: for attrname in dir(connection.Connection): if attrname.startswith('_') or attrname in dct: continue meth = getattr(connection.Connection, attrname) if not inspect.isfunction(meth): continue wrapper = mcls._wrap_connection_method(attrname) 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) def __init__(cls, name, bases, dct, *, wrap=False): # Needed for Python 3.5 to handle `wrap` class keyword argument. super().__init__(name, bases, dct) @staticmethod def _wrap_connection_method(meth_name): def call_con_method(self, *args, **kwargs): # This method will be owned by PoolConnectionProxy class. if self._con is None: raise exceptions.InterfaceError( 'cannot call Connection.{}(): ' 'connection has been released back to the pool'.format( meth_name)) meth = getattr(self._con.__class__, meth_name) return meth(self._con, *args, **kwargs) return call_con_method class PoolConnectionProxy(connection._ConnectionProxy, metaclass=PoolConnectionProxyMeta, wrap=True): __slots__ = ('_con', '_holder') def __init__(self, holder: 'PoolConnectionHolder', con: connection.Connection): self._con = con self._holder = holder con._set_proxy(self) def __getattr__(self, attr): # Proxy all unresolved attributes to the wrapped Connection object. return getattr(self._con, attr) def _detach(self): if self._con is None: raise exceptions.InterfaceError( 'cannot detach PoolConnectionProxy: already detached') con, self._con = self._con, None con._set_proxy(None) def __repr__(self): if self._con is None: return '<{classname} [released] {id:#x}>'.format( classname=self.__class__.__name__, id=id(self)) else: return '<{classname} {con!r} {id:#x}>'.format( classname=self.__class__.__name__, con=self._con, id=id(self)) class PoolConnectionHolder: __slots__ = ('_con', '_pool', '_loop', '_connect_args', '_connect_kwargs', '_max_queries', '_setup', '_init', '_max_inactive_time', '_in_use', '_inactive_callback') def __init__(self, pool, *, connect_args, connect_kwargs, max_queries, setup, init, max_inactive_time): self._pool = pool self._con = None self._connect_args = connect_args self._connect_kwargs = connect_kwargs self._max_queries = max_queries self._max_inactive_time = max_inactive_time self._setup = setup self._init = init self._inactive_callback = None self._in_use = False async def connect(self): assert self._con is None if self._pool._working_addr is None: # First connection attempt on this pool. con = await connection.connect( *self._connect_args, loop=self._pool._loop, connection_class=self._pool._connection_class, **self._connect_kwargs) self._pool._working_addr = con._addr self._pool._working_config = con._config self._pool._working_params = con._params else: # We've connected before and have a resolved address, # and parsed options and config. con = await connect_utils._connect_addr( loop=self._pool._loop, addr=self._pool._working_addr, timeout=self._pool._working_params.connect_timeout, config=self._pool._working_config, params=self._pool._working_params, connection_class=self._pool._connection_class) if self._init is not None: await self._init(con) self._con = con async def acquire(self) -> PoolConnectionProxy: if self._con is None or self._con.is_closed(): self._con = None await self.connect() self._maybe_cancel_inactive_callback() proxy = PoolConnectionProxy(self, self._con) if self._setup is not None: try: await self._setup(proxy) except Exception 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: proxy._detach() # Use `close` to close the connection gracefully. # An exception in `setup` isn't necessarily caused # by an IO or a protocol error. await self._con.close() finally: self._con = None raise ex self._in_use = True return proxy async def release(self): assert self._in_use self._in_use = False self._con._on_release() if self._con.is_closed(): self._con = None elif self._con._protocol.queries_count >= self._max_queries: try: await self._con.close() finally: self._con = None else: try: await self._con.reset() except Exception 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: self._con = None raise ex assert self._inactive_callback is None if self._max_inactive_time and self._con is not None: self._inactive_callback = self._pool._loop.call_later( self._max_inactive_time, self._deactivate_connection) async def close(self): self._maybe_cancel_inactive_callback() if self._con is None: return if self._con.is_closed(): self._con = None return try: await self._con.close() finally: self._con = None def terminate(self): self._maybe_cancel_inactive_callback() if self._con is None: return if self._con.is_closed(): self._con = None return try: self._con.terminate() finally: self._con = None def _maybe_cancel_inactive_callback(self): if self._inactive_callback is not None: self._inactive_callback.cancel() self._inactive_callback = None def _deactivate_connection(self): assert not self._in_use if self._con is None or self._con.is_closed(): return self._con.terminate() self._con = None 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', '_working_addr', '_working_config', '_working_params', '_holders', '_initialized', '_closed', '_connection_class') def __init__(self, *connect_args, min_size, max_size, max_queries, max_inactive_connection_lifetime, setup, init, loop, connection_class, **connect_kwargs): 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') self._minsize = min_size self._maxsize = max_size self._holders = [] self._initialized = False self._queue = asyncio.LifoQueue(maxsize=self._maxsize, loop=self._loop) self._working_addr = None self._working_config = None self._working_params = None self._connection_class = connection_class self._closed = False for _ in range(max_size): ch = PoolConnectionHolder( self, connect_args=connect_args, connect_kwargs=connect_kwargs, max_queries=max_queries, max_inactive_time=max_inactive_connection_lifetime, setup=setup, init=init) self._holders.append(ch) self._queue.put_nowait(ch) async def _async__init__(self): if self._initialized: return if self._closed: raise exceptions.InterfaceError('pool is closed') 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 it # can record `_working_addr` and `_working_opts`, which will # speed up successive connection attempts. 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, loop=self._loop) self._initialized = True return self async def execute(self, query: str, *args, timeout: float=None) -> str: """Execute an SQL command (or commands). Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.execute() `. .. versionadded:: 0.10.0 """ async with self.acquire() as con: return await con.execute(query, *args, timeout=timeout) async def executemany(self, command: str, args, *, timeout: float=None): """Execute an SQL *command* for each sequence of arguments in *args*. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.executemany() `. .. versionadded:: 0.10.0 """ async with self.acquire() as con: return await con.executemany(command, args, timeout=timeout) async def fetch(self, query, *args, timeout=None) -> 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) 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): """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) 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: self._queue.put_nowait(ch) raise else: return proxy self._check_init() if timeout is None: return await _acquire_impl() else: return await asyncio.wait_for( _acquire_impl(), timeout=timeout, loop=self._loop) async def release(self, connection): """Release a database connection back to the pool.""" async def _release_impl(ch: PoolConnectionHolder): try: await ch.release() finally: self._queue.put_nowait(ch) self._check_init() 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 connection._detach() # Use asyncio.shield() to guarantee that task cancellation # does not prevent the connection from being returned to the # pool properly. return await asyncio.shield(_release_impl(connection._holder), loop=self._loop) async def close(self): """Gracefully close all connections in the pool.""" if self._closed: return self._check_init() self._closed = True coros = [ch.close() for ch in self._holders] await asyncio.gather(*coros, loop=self._loop) def terminate(self): """Terminate all connections in the pool.""" if self._closed: return self._check_init() self._closed = True for ch in self._holders: ch.terminate() def _check_init(self): if not self._initialized: 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 __await__(self): return self._async__init__().__await__() async def __aenter__(self): await self._async__init__() return self async def __aexit__(self, *exc): await self.close() class PoolAcquireContext: __slots__ = ('timeout', 'connection', 'done', 'pool') def __init__(self, pool, timeout): self.pool = pool self.timeout = timeout self.connection = None self.done = False async def __aenter__(self): if self.connection is not None or self.done: raise exceptions.InterfaceError('a connection is already acquired') self.connection = await self.pool._acquire(self.timeout) return self.connection async def __aexit__(self, *exc): self.done = True con = self.connection self.connection = None await self.pool.release(con) def __await__(self): self.done = True return self.pool._acquire(self.timeout).__await__() def create_pool(dsn=None, *, min_size=10, max_size=10, max_queries=50000, max_inactive_connection_lifetime=300.0, setup=None, init=None, loop=None, connection_class=connection.Connection, **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: async with pool.acquire() as con: await con.fetch('SELECT 1') Or directly with ``await``: .. 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 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 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 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. """ 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)) return Pool( dsn, connection_class=connection_class, min_size=min_size, max_size=max_size, max_queries=max_queries, loop=loop, setup=setup, init=init, max_inactive_connection_lifetime=max_inactive_connection_lifetime, **connect_kwargs) asyncpg-0.13.0/asyncpg/exceptions/0000775000372000037200000000000013172407445017735 5ustar travistravis00000000000000asyncpg-0.13.0/asyncpg/exceptions/__init__.py0000664000372000037200000006377613172407302022061 0ustar travistravis00000000000000# 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 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 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 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 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 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 PostgresSystemError(_base.PostgresError): sqlstate = '58000' class PostgresIOError(PostgresSystemError): sqlstate = '58030' class UndefinedFileError(PostgresSystemError): sqlstate = '58P01' class DuplicateFileError(PostgresSystemError): sqlstate = '58P02' 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__ = _base.__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', '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', 'ForeignKeyViolationError', 'FunctionExecutedNoReturnStatementError', 'GeneratedAlwaysError', 'GroupingError', 'HeldCursorRequiresSameIsolationLevelError', 'IdleInTransactionSessionTimeoutError', 'ImplicitZeroBitPadding', 'InFailedSQLTransactionError', 'InappropriateAccessModeForBranchTransactionError', 'InappropriateIsolationLevelForBranchTransactionError', 'IndeterminateCollationError', 'IndeterminateDatatypeError', 'IndexCorruptedError', 'IndicatorOverflowError', 'InsufficientPrivilegeError', 'InsufficientResourcesError', 'IntegrityConstraintViolationError', 'InternalServerError', 'IntervalFieldOverflowError', 'InvalidArgumentForLogarithmError', 'InvalidArgumentForNthValueFunctionError', 'InvalidArgumentForNtileFunctionError', 'InvalidArgumentForPowerFunctionError', 'InvalidArgumentForWidthBucketFunctionError', 'InvalidAuthorizationSpecificationError', 'InvalidBinaryRepresentationError', 'InvalidCachedStatementError', 'InvalidCatalogNameError', 'InvalidCharacterValueForCastError', 'InvalidColumnDefinitionError', 'InvalidColumnReferenceError', 'InvalidCursorDefinitionError', 'InvalidCursorNameError', 'InvalidCursorStateError', 'InvalidDatabaseDefinitionError', 'InvalidDatetimeFormatError', 'InvalidEscapeCharacterError', 'InvalidEscapeOctetError', 'InvalidEscapeSequenceError', 'InvalidForeignKeyError', 'InvalidFunctionDefinitionError', 'InvalidGrantOperationError', 'InvalidGrantorError', 'InvalidIndicatorParameterValueError', 'InvalidLocatorSpecificationError', 'InvalidNameError', 'InvalidObjectDefinitionError', 'InvalidParameterValueError', 'InvalidPasswordError', 'InvalidPreparedStatementDefinitionError', 'InvalidRecursionError', 'InvalidRegularExpressionError', 'InvalidRoleSpecificationError', 'InvalidRowCountInLimitClauseError', 'InvalidRowCountInResultOffsetClauseError', 'InvalidSQLStatementNameError', 'InvalidSavepointSpecificationError', 'InvalidSchemaDefinitionError', 'InvalidSchemaNameError', 'InvalidSqlstateReturnedError', 'InvalidTableDefinitionError', 'InvalidTablesampleArgumentError', 'InvalidTablesampleRepeatError', 'InvalidTextRepresentationError', 'InvalidTimeZoneDisplacementValueError', 'InvalidTransactionInitiationError', 'InvalidTransactionStateError', 'InvalidTransactionTerminationError', 'InvalidUseOfEscapeCharacterError', 'InvalidXmlCommentError', 'InvalidXmlContentError', 'InvalidXmlDocumentError', 'InvalidXmlProcessingInstructionError', 'LocatorError', 'LockFileExistsError', 'LockNotAvailableError', 'ModifyingExternalRoutineSQLDataNotPermittedError', 'ModifyingSQLDataNotPermittedError', 'MostSpecificTypeMismatchError', 'NameTooLongError', 'NoActiveSQLTransactionError', 'NoActiveSQLTransactionForBranchTransactionError', 'NoAdditionalDynamicResultSetsReturned', 'NoData', 'NoDataFoundError', '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', 'SQLRoutineError', 'SQLStatementNotYetCompleteError', 'SavepointError', 'SchemaAndDataStatementMixingNotSupportedError', 'SequenceGeneratorLimitExceededError', 'SerializationError', 'SnapshotTooOldError', 'SrfProtocolViolatedError', 'StackedDiagnosticsAccessedWithoutActiveHandlerError', 'StatementCompletionUnknownError', 'StatementTooComplexError', 'StringDataLengthMismatchError', 'StringDataRightTruncation', 'StringDataRightTruncationError', 'SubstringError', 'SyntaxOrAccessError', 'TooManyArgumentsError', 'TooManyColumnsError', 'TooManyConnectionsError', 'TooManyRowsError', 'TransactionIntegrityConstraintViolationError', 'TransactionResolutionUnknownError', 'TransactionRollbackError', 'TriggerProtocolViolatedError', 'TriggeredActionError', 'TriggeredDataChangeViolationError', 'TrimError', 'UndefinedColumnError', 'UndefinedFileError', 'UndefinedFunctionError', 'UndefinedObjectError', 'UndefinedParameterError', 'UndefinedTableError', 'UniqueViolationError', 'UnterminatedCStringError', 'UntranslatableCharacterError', 'WindowingError', 'WithCheckOptionViolationError', 'WrongObjectTypeError', 'ZeroLengthCharacterStringError' ) asyncpg-0.13.0/asyncpg/exceptions/_base.py0000664000372000037200000001506113172407302021353 0ustar travistravis00000000000000# 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 __all__ = ('PostgresError', 'FatalPostgresError', 'UnknownPostgresError', 'InterfaceError', 'InterfaceWarning', 'PostgresLogMessage', 'InternalClientError') 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') 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) 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): pass 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 asyncpg-0.13.0/asyncpg/utils.py0000664000372000037200000000252713172407302017264 0ustar travistravis00000000000000# 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], query) asyncpg-0.13.0/asyncpg/connection.py0000664000372000037200000016170013172407302020262 0ustar travistravis00000000000000# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import collections import collections.abc import itertools import struct import time import warnings 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', '_uid', '_aborted', '_pool_release_ctr', '_stmt_cache', '_stmts_to_close', '_listeners', '_server_version', '_server_caps', '_intro_query', '_reset_query', '_proxy', '_stmt_exclusive_section', '_config', '_params', '_addr', '_log_listeners') def __init__(self, protocol, transport, loop, addr: (str, int) or str, config: connect_utils._ClientConfiguration, params: connect_utils._ConnectionParameters): self._protocol = protocol self._transport = transport self._loop = loop self._top_xact = None self._uid = 0 self._aborted = False # Incremented very 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=self._maybe_gc_stmt, max_lifetime=config.max_cached_statement_lifetime) self._stmts_to_close = set() self._listeners = {} self._log_listeners = 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) 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() 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 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. """ self._check_open() if channel not in self._listeners: await self.fetch('LISTEN {}'.format(channel)) self._listeners[channel] = set() self._listeners[channel].add(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 if callback not in self._listeners[channel]: return self._listeners[channel].remove(callback) if not self._listeners[channel]: del self._listeners[channel] await self.fetch('UNLISTEN {}'.format(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 receiving the following arguments: **connection**: a Connection the callback is registered with; **message**: the `exceptions.PostgresLogMessage` message. .. versionadded:: 0.12.0 """ if self.is_closed(): raise exceptions.InterfaceError('connection is closed') self._log_listeners.add(callback) def remove_log_listener(self, callback): """Remove a listening callback for log messages. .. versionadded:: 0.12.0 """ self._log_listeners.discard(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='read_committed', 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_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) async def execute(self, query: str, *args, timeout: float=None) -> str: """Execute an SQL command (or commands). This method can execute many SQL commands at once, when no arguments are provided. Example: .. code-block:: pycon >>> await con.execute(''' ... CREATE TABLE mytab (a int); ... INSERT INTO mytab (a) VALUES (100), (200), (300); ... ''') INSERT 0 3 >>> await con.execute(''' ... INSERT INTO mytab (a) VALUES ($1), ($2) ... ''', 10, 20) INSERT 0 2 :param args: Query arguments. :param float timeout: Optional timeout value in seconds. :return str: Status of the last SQL command. .. versionchanged:: 0.5.4 Made it possible to pass query arguments. """ self._check_open() if not args: return await self._protocol.query(query, timeout) _, status, _ = await self._execute(query, args, 0, timeout, True) return status.decode() async def executemany(self, command: str, args, *, timeout: float=None): """Execute an SQL *command* for each sequence of arguments in *args*. Example: .. code-block:: pycon >>> await con.executemany(''' ... INSERT INTO mytab (a) VALUES ($1, $2, $3); ... ''', [(1, 2, 3), (4, 5, 6)]) :param command: Command to execute. :param args: An iterable containing sequences of arguments. :param float timeout: Optional timeout value in seconds. :return None: This method discards the results of the operations. .. versionadded:: 0.7.0 .. versionchanged:: 0.11.0 `timeout` became a keyword-only parameter. """ self._check_open() return await self._executemany(command, args, timeout) async def _get_statement(self, query, timeout, *, named: bool=False): statement = self._stmt_cache.get(query) 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.get_max_size() > 0 if (use_cache and self._config.max_cacheable_statement_size and len(query) > self._config.max_cacheable_statement_size): use_cache = False if use_cache or named: stmt_name = self._get_unique_id('stmt') else: stmt_name = '' statement = await self._protocol.prepare(stmt_name, query, timeout) ready = statement._init_types() if ready is not True: types, intro_stmt = await self.__execute( self._intro_query, (list(ready),), 0, timeout) self._protocol.get_settings().register_data_types(types) if not intro_stmt.name and not statement.name: # 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. statement = await self._protocol.prepare( stmt_name, query, timeout) if use_cache: self._stmt_cache.put(query, 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 def cursor(self, query, *args, prefetch=None, timeout=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. :return: A :class:`~cursor.CursorFactory` object. """ self._check_open() return cursor.CursorFactory(self, query, None, args, prefetch, timeout) async def prepare(self, query, *, timeout=None): """Create a *prepared statement* for the specified query. :param str query: Text of the query to create a prepared statement for. :param float timeout: Optional timeout value in seconds. :return: A :class:`~prepared_stmt.PreparedStatement` instance. """ self._check_open() stmt = await self._get_statement(query, timeout, named=True) return prepared_stmt.PreparedStatement(self, query, stmt) async def fetch(self, query, *args, timeout=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. :return list: A list of :class:`Record` instances. """ self._check_open() return await self._execute(query, args, 0, timeout) 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): """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. :return: The first row as a :class:`Record` instance, 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] 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.get_event_loop().run_until_complete(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.get_event_loop().run_until_complete(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): """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 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.get_event_loop().run_until_complete(run()) 'COPY 140000' .. _`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, 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}'.format( tab=tabname, cols=cols, opts=opts) 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): """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. :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. :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.get_event_loop().run_until_complete(run()) 'COPY 2' .. versionadded:: 0.11.0 """ 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) opts = '(FORMAT binary)' copy_stmt = 'COPY {tab}{cols} FROM STDIN {opts}'.format( tab=tabname, cols=cols, opts=opts) return await self._copy_in_records( copy_stmt, records, intro_ps._state, timeout) 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 = compat.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 = compat.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, 'wb') opened_by_us = True elif hasattr(source, 'read'): # file-like f = source elif isinstance(source, collections.abc.AsyncIterable): # assuming calling output returns an awaitable. 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: @compat.aiter_compat 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 _copy_in_records(self, copy_stmt, records, intro_stmt, timeout): return await self._protocol.copy_in( copy_stmt, None, None, records, intro_stmt, timeout) async def set_type_codec(self, typename, *, schema='public', encoder, decoder, binary=None, 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``) | +-----------------+---------------------------------------------+ :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.get_event_loop().run_until_complete(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``. """ self._check_open() typeinfo = await self.fetchrow( introspection.TYPE_BY_NAME, typename, schema) if not typeinfo: raise ValueError('unknown type: {}.{}'.format(schema, typename)) oid = typeinfo['oid'] if typeinfo['kind'] != b'b' or typeinfo['elemtype']: raise ValueError( 'cannot use custom codec on non-scalar type {}.{}'.format( schema, typename)) self._protocol.get_settings().add_python_codec( oid, typename, schema, 'scalar', 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.fetchrow( introspection.TYPE_BY_NAME, typename, schema) if not typeinfo: raise ValueError('unknown type: {}.{}'.format(schema, typename)) oid = typeinfo['oid'] self._protocol.get_settings().remove_python_codec( 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): """Set a builtin codec 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 codec_name: The name of the builtin codec. """ self._check_open() typeinfo = await self.fetchrow( introspection.TYPE_BY_NAME, typename, schema) if not typeinfo: raise ValueError('unknown type: {}.{}'.format(schema, typename)) oid = typeinfo['oid'] if typeinfo['kind'] != b'b' or typeinfo['elemtype']: raise ValueError( 'cannot alias non-scalar type {}.{}'.format( schema, typename)) self._protocol.get_settings().set_builtin_type_codec( oid, typename, schema, 'scalar', codec_name) # 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 not self._protocol.is_connected() or self._aborted async def close(self): """Close the connection gracefully.""" if self.is_closed(): return self._mark_stmts_as_closed() self._listeners.clear() self._log_listeners.clear() self._aborted = True await self._protocol.close() def terminate(self): """Terminate the connection without waiting for pending data.""" self._mark_stmts_as_closed() self._listeners.clear() self._log_listeners.clear() self._aborted = True self._protocol.abort() async def reset(self): self._check_open() self._listeners.clear() self._log_listeners.clear() reset_query = self._get_reset_query() if reset_query: await self.execute(reset_query) def _check_open(self): if self.is_closed(): raise exceptions.InterfaceError('connection is closed') def _get_unique_id(self, prefix): self._uid += 1 return '__asyncpg_{}_{}__'.format(prefix, self._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 not self._stmt_cache.has(stmt.query): # 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) def _cancel_current_command(self, waiter): async def cancel(): try: # Open new connection to the server r, w = await connect_utils._open_connection( loop=self._loop, addr=self._addr, params=self._params) except Exception as ex: waiter.set_exception(ex) return try: # Pack CancelRequest message msg = struct.pack('!llll', 16, 80877102, self._protocol.backend_pid, self._protocol.backend_secret) w.write(msg) await r.read() # Wait until EOF except ConnectionResetError: # On some systems Postgres will reset the connection # after processing the cancellation command. pass except Exception as ex: waiter.set_exception(ex) finally: if not waiter.done(): # Ensure set_exception wasn't called. waiter.set_result(None) w.close() self._loop.create_task(cancel()) 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: self._loop.call_soon( self._call_log_listener, cb, con_ref, message) def _call_log_listener(self, cb, con_ref, message): try: cb(con_ref, message) except Exception as ex: self._loop.call_exception_handler({ 'message': 'Unhandled exception in asyncpg log message ' 'listener callback {!r}'.format(cb), 'exception': ex }) def _process_notification(self, pid, channel, payload): if channel not in self._listeners: return con_ref = self._unwrap() for cb in self._listeners[channel]: self._loop.call_soon( self._call_listener, cb, con_ref, pid, channel, payload) def _call_listener(self, cb, con_ref, pid, channel, payload): try: cb(con_ref, pid, channel, payload) except Exception as ex: self._loop.call_exception_handler({ 'message': 'Unhandled exception in asyncpg notification ' 'listener callback {!r}'.format(cb), 'exception': ex }) 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): if self._reset_query is not None: return self._reset_query caps = self._server_caps _reset_query = [] if self._protocol.is_in_transaction() or self._top_xact is not None: self._loop.call_exception_handler({ 'message': 'Resetting connection with an ' 'active transaction {!r}'.format(self) }) self._top_xact = None _reset_query.append('ROLLBACK;') 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(''' DO $$ BEGIN PERFORM * FROM pg_listening_channels() LIMIT 1; IF FOUND THEN UNLISTEN *; END IF; END; $$; ''') 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() async def _execute(self, query, args, limit, timeout, return_status=False): with self._stmt_exclusive_section: result, _ = await self.__execute( query, args, limit, timeout, return_status=return_status) return result async def __execute(self, query, args, limit, timeout, return_status=False): executor = lambda stmt, timeout: self._protocol.bind_execute( stmt, args, '', limit, return_status, timeout) timeout = self._protocol._get_timeout(timeout) return await self._do_execute(query, executor, timeout) async def _executemany(self, query, args, timeout): executor = lambda stmt, timeout: self._protocol.bind_execute_many( stmt, args, '', timeout) timeout = self._protocol._get_timeout(timeout) with self._stmt_exclusive_section: result, _ = await self._do_execute(query, executor, timeout) return result async def _do_execute(self, query, executor, timeout, retry=True): if timeout is None: stmt = await self._get_statement(query, None) else: before = time.monotonic() stmt = await self._get_statement(query, timeout) 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.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, 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, connection_class=Connection, server_settings=None): r"""A coroutine to establish a connection to a PostgreSQL server. Returns a new :class:`~asyncpg.connection.Connection` object. :param dsn: Connection arguments specified using as a single string in the following format: ``postgres://user:pass@host:port/database?option=value`` :param host: database host address or a path to the directory containing database server UNIX socket (defaults to the default UNIX socket, or the value of the ``PGHOST`` environment variable, if set). :param port: connection port number (defaults to ``5432``, or the value of the ``PGPORT`` environment variable, if set) :param user: the name of the database role used for authentication (defaults to the name of the effective user of the process making the connection, or the value of ``PGUSER`` environment variable, if set) :param database: the name of the database (defaults to the value of ``PGDATABASE`` environment variable, if set.) :param password: password used for authentication :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. :param dict server_settings: an optional dict of server parameters. :param Connection connection_class: class of the returned connection object. Must be a subclass of :class:`~asyncpg.connection.Connection`. :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.get_event_loop().run_until_complete(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. 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): # First, make sure that we cancel all scheduled callbacks. for entry in self._entries.values(): self._clear_entry_callback(entry) # Clear the entries dict. self._entries.clear() 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 _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__ = () ServerCapabilities = collections.namedtuple( 'ServerCapabilities', ['advisory_locks', 'notifications', 'plpgsql', 'sql_reset', 'sql_close_all']) 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 elif hasattr(connection_settings, 'crdb_version'): # CockroachDB detected. advisory_locks = False notifications = False plpgsql = False sql_reset = False sql_close_all = False else: # Standard PostgreSQL server assumed. advisory_locks = True notifications = True plpgsql = True sql_reset = True sql_close_all = True return ServerCapabilities( advisory_locks=advisory_locks, notifications=notifications, plpgsql=plpgsql, sql_reset=sql_reset, sql_close_all=sql_close_all ) asyncpg-0.13.0/asyncpg/transaction.py0000664000372000037200000001604213172407302020446 0ustar travistravis00000000000000# 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 exceptions as apg_errors class TransactionState(enum.Enum): NEW = 0 STARTED = 1 COMMITTED = 2 ROLLEDBACK = 3 FAILED = 4 ISOLATION_LEVELS = {'read_committed', 'serializable', 'repeatable_read'} class Transaction: """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): if isolation not in ISOLATION_LEVELS: raise ValueError( 'isolation is expected to be either of {}, ' 'got {!r}'.format(ISOLATION_LEVELS, isolation)) if isolation != 'serializable': if readonly: raise ValueError( '"readonly" is only supported for ' 'serializable transactions') if deferrable and not readonly: raise ValueError( '"deferrable" is only supported for ' 'serializable readonly transactions') self._connection = connection 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: if extype is not None: await self.__rollback() else: await self.__commit() finally: self._managed = False 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 top_xact = con._top_xact 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: if self._isolation == 'read_committed': query = 'BEGIN;' elif self._isolation == 'repeatable_read': query = 'BEGIN ISOLATION LEVEL REPEATABLE READ;' else: query = 'BEGIN ISOLATION LEVEL SERIALIZABLE' if self._readonly: query += ' READ ONLY' if self._deferrable: query += ' DEFERRABLE' query += ';' try: await self._connection.execute(query) except: 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: 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: self._state = TransactionState.FAILED raise else: self._state = TransactionState.ROLLEDBACK 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() 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())) 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)) asyncpg-0.13.0/asyncpg/prepared_stmt.py0000664000372000037200000001663013172407302020775 0ustar travistravis00000000000000# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import json from . import connresource from . import cursor from . import exceptions class PreparedStatement(connresource.ConnectionResource): """A representation of a prepared statement.""" __slots__ = ('_state', '_query', '_last_status') def __init__(self, connection, query, state): super().__init__(connection) self._state = state self._query = query state.attach() self._last_status = None @connresource.guarded def get_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) @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, # 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] async def __bind_execute(self, args, limit, timeout): protocol = self._connection._protocol data, status, _ = await 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) asyncpg-0.13.0/asyncpg/_testbase.py0000664000372000037200000001507613172407302020100 0ustar travistravis00000000000000# 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 time import unittest from asyncpg import cluster as pg_cluster from asyncpg import connection as pg_connection from asyncpg import pool as pg_pool @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) class TestCaseMeta(type(unittest.TestCase)): @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): self.loop.run_until_complete(__meth__(self, *args, **kwargs)) 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) @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) _default_cluster = None def _start_cluster(ClusterCls, cluster_kwargs, server_settings): cluster = ClusterCls(**cluster_kwargs) cluster.init() cluster.trust_local_connections() cluster.start(port='dynamic', server_settings=server_settings) atexit.register(_shutdown_cluster, cluster) return cluster def _start_default_cluster(server_settings={}): 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 = _start_cluster( pg_cluster.TempCluster, {}, server_settings) return _default_cluster def _shutdown_cluster(cluster): cluster.stop() cluster.destroy() def create_pool(dsn=None, *, min_size=10, max_size=10, max_queries=50000, max_inactive_connection_lifetime=60.0, setup=None, init=None, loop=None, pool_class=pg_pool.Pool, connection_class=pg_connection.Connection, **connect_kwargs): return pool_class( dsn, min_size=min_size, max_size=max_size, max_queries=max_queries, loop=loop, setup=setup, init=init, max_inactive_connection_lifetime=max_inactive_connection_lifetime, connection_class=connection_class, **connect_kwargs) class ClusterTestCase(TestCase): @classmethod def get_server_settings(cls): return { 'log_connections': 'on' } @classmethod def setup_cluster(cls): cls.cluster = _start_default_cluster(cls.get_server_settings()) @classmethod def setUpClass(cls): super().setUpClass() cls.setup_cluster() def create_pool(self, pool_class=pg_pool.Pool, **kwargs): conn_spec = self.cluster.get_connection_spec() conn_spec.update(kwargs) return create_pool(loop=self.loop, pool_class=pool_class, **conn_spec) @classmethod def start_cluster(cls, ClusterCls, *, cluster_kwargs={}, server_settings={}): return _start_cluster(ClusterCls, cluster_kwargs, server_settings) 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__', {}) if 'database' not in opts: opts = dict(opts) opts['database'] = 'postgres' self.con = self.loop.run_until_complete( self.cluster.connect(loop=self.loop, **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() asyncpg-0.13.0/asyncpg/cluster.py0000664000372000037200000005117113172407302017604 0ustar travistravis00000000000000# 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 errno import os import os.path import platform import random import re import shutil import socket 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 if _system == 'Linux': def ensure_dead_with_parent(): import ctypes import signal try: PR_SET_PDEATHSIG = 1 libc = ctypes.CDLL(ctypes.util.find_library('c')) libc.prctl(PR_SET_PDEATHSIG, signal.SIGKILL) except Exception as e: print(e) else: ensure_dead_with_parent = None def find_available_port(port_range=(49152, 65535), max_tries=1000): low, high = port_range port = low try_no = 0 while try_no < max_tries: try_no += 1 port = random.randint(low, high) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: sock.bind(('127.0.0.1', port)) except socket.error as e: if e.errno == errno.EADDRINUSE: continue finally: sock.close() break else: port = None return port 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') self._pg_ctl = None self._daemon_pid = None self._daemon_process = None self._connection_addr = None self._connection_spec_override = None 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.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)) if settings: settings_args = ['--{}={}'.format(k, v) for k, v in settings.items()] extra_args = ['-o'] + [' '.join(settings_args)] else: extra_args = [] process = subprocess.run( [self._pg_ctl, 'init', '-D', self._data_dir] + extra_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 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: sockdir = '/tmp' 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, 0o400) server_settings = server_settings.copy() server_settings['ssl_key_file'] = keyfile 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. process = subprocess.run( [self._pg_ctl, 'start', '-D', self._data_dir, '-o', ' '.join(extra_args)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) stderr = process.stderr if process.returncode != 0: raise ClusterError( 'pg_ctl start exited with status {:d}: {}'.format( process.returncode, stderr.decode())) 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, preexec_fn=ensure_dead_with_parent) 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) 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) 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_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', 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') 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') 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 = tempfile.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())) 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))) return output.decode() 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') asyncpg-0.13.0/asyncpg/compat.py0000664000372000037200000000232013172407302017376 0ustar travistravis00000000000000# 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 import os import sys PY_36 = sys.version_info >= (3, 6) if sys.version_info < (3, 5, 2): def aiter_compat(func): @functools.wraps(func) async def wrapper(self): return func(self) return wrapper else: def aiter_compat(func): return func if PY_36: fspath = os.fspath else: def fspath(path): fsp = getattr(path, '__fspath__', None) if fsp is not None and callable(fsp): path = fsp() if not isinstance(path, (str, bytes)): raise TypeError( 'expected {}() to return str or bytes, not {}'.format( fsp.__qualname__, type(path).__name__ )) return path elif isinstance(path, (str, bytes)): return path else: raise TypeError( 'expected str, bytes or path-like object, not {}'.format( type(path).__name__ ) ) asyncpg-0.13.0/asyncpg/serverversion.py0000664000372000037200000000243413172407302021035 0ustar travistravis00000000000000# 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 . import types def split_server_version_string(version_string): version_string = version_string.strip() if version_string.startswith('PostgreSQL '): version_string = version_string[len('PostgreSQL '):] if version_string.startswith('Postgres-XL'): version_string = version_string[len('Postgre-XL '):] parts = version_string.strip().split('.') if not parts[-1].isdigit(): # release level specified lastitem = parts[-1] levelpart = lastitem.rstrip('0123456789').lower() if levelpart != lastitem: serial = int(lastitem[len(levelpart):]) else: serial = 0 level = levelpart.lstrip('0123456789') if level != levelpart: parts[-1] = levelpart[:-len(level)] else: parts[-1] = 0 else: level = 'final' serial = 0 versions = [int(p) for p in parts][:3] if len(versions) < 3: versions += [0] * (3 - len(versions)) versions.append(level) versions.append(serial) return types.ServerVersion(*versions) asyncpg-0.13.0/asyncpg/connect_utils.py0000664000372000037200000002732713172407302021002 0ustar travistravis00000000000000# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import collections import getpass import os import platform import socket import struct import time import urllib.parse from . import exceptions from . import protocol _ConnectionParameters = collections.namedtuple( 'ConnectionParameters', [ 'user', 'password', 'database', 'ssl', 'connect_timeout', 'server_settings', ]) _ClientConfiguration = collections.namedtuple( 'ConnectionConfiguration', [ 'command_timeout', 'statement_cache_size', 'max_cached_statement_lifetime', 'max_cacheable_statement_size', ]) _system = platform.uname().system def _parse_connect_dsn_and_args(*, dsn, host, port, user, password, database, ssl, connect_timeout, server_settings): if host is not None and not isinstance(host, str): raise TypeError( 'host argument is expected to be str, got {!r}'.format( type(host))) if dsn: parsed = urllib.parse.urlparse(dsn) if parsed.scheme not in {'postgresql', 'postgres'}: raise ValueError( 'invalid DSN: scheme is expected to be either of ' '"postgresql" or "postgres", got {!r}'.format(parsed.scheme)) if parsed.port and port is None: port = int(parsed.port) if parsed.hostname and host is None: host = parsed.hostname if parsed.path and database is None: database = parsed.path if database.startswith('/'): database = database[1:] if parsed.username and user is None: user = parsed.username if parsed.password and password is None: password = parsed.password if parsed.query: query = urllib.parse.parse_qs(parsed.query, strict_parsing=True) for key, val in query.items(): if isinstance(val, list): query[key] = val[-1] if 'host' in query: val = query.pop('host') if host is None: host = val if 'port' in query: val = int(query.pop('port')) if port is None: port = val 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 query: if server_settings is None: server_settings = query else: server_settings = {**query, **server_settings} # On env-var -> connection parameter conversion read here: # https://www.postgresql.org/docs/current/static/libpq-envars.html # Note that env values may be an empty string in cases when # the variable is "unset" by setting it to an empty value # if host is None: host = os.getenv('PGHOST') if not host: if _system == 'Windows': host = ['localhost'] else: host = ['/tmp', '/private/tmp', '/var/pgsql_socket', '/run/postgresql', 'localhost'] if not isinstance(host, list): host = [host] if port is None: port = os.getenv('PGPORT') if port: port = int(port) else: port = 5432 else: port = int(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.InterfaceError( 'could not determine user name to connect with') if database is None: raise exceptions.InterfaceError( 'could not determine database name to connect to') addrs = [] for h in host: if h.startswith('/'): # UNIX socket name if '.s.PGSQL.' not in h: h = os.path.join(h, '.s.PGSQL.{}'.format(port)) addrs.append(h) else: # TCP host/port addrs.append((h, port)) if not addrs: raise ValueError( 'could not determine the database address to connect to') if ssl: for addr in addrs: if isinstance(addr, str): # UNIX socket raise exceptions.InterfaceError( '`ssl` parameter can only be enabled for TCP addresses, ' 'got a UNIX socket path: {!r}'.format(addr)) 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 ValueError( 'server_settings is expected to be None or ' 'a Dict[str, str]') params = _ConnectionParameters( user=user, password=password, database=database, ssl=ssl, connect_timeout=connect_timeout, server_settings=server_settings) return addrs, params def _parse_connect_arguments(*, dsn, host, port, user, password, database, timeout, command_timeout, statement_cache_size, max_cached_statement_lifetime, max_cacheable_statement_size, ssl, server_settings): 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, ssl=ssl, database=database, connect_timeout=timeout, server_settings=server_settings) 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 async def _connect_addr(*, addr, loop, timeout, params, config, connection_class): assert loop is not None if timeout <= 0: raise asyncio.TimeoutError connected = _create_future(loop) proto_factory = lambda: protocol.Protocol( addr, connected, params, loop) if isinstance(addr, str): # UNIX socket assert params.ssl is None connector = loop.create_unix_connection(proto_factory, addr) elif params.ssl: connector = _create_ssl_connection( proto_factory, *addr, loop=loop, ssl_context=params.ssl) else: connector = loop.create_connection(proto_factory, *addr) before = time.monotonic() tr, pr = await asyncio.wait_for( connector, timeout=timeout, loop=loop) timeout -= time.monotonic() - before try: if timeout <= 0: raise asyncio.TimeoutError await asyncio.wait_for(connected, loop=loop, timeout=timeout) except Exception: tr.close() raise con = connection_class(pr, tr, loop, addr, config, params) pr.set_connection(con) return con async def _connect(*, loop, timeout, connection_class, **kwargs): if loop is None: loop = asyncio.get_event_loop() addrs, params, config = _parse_connect_arguments(timeout=timeout, **kwargs) last_error = None addr = None for addr in addrs: before = time.monotonic() try: con = await _connect_addr( addr=addr, loop=loop, timeout=timeout, params=params, config=config, connection_class=connection_class) except (OSError, asyncio.TimeoutError, ConnectionError) as ex: last_error = ex else: return con finally: timeout -= time.monotonic() - before raise last_error async def _get_ssl_ready_socket(host, port, *, loop): reader, writer = await asyncio.open_connection(host, port, loop=loop) tr = writer.transport try: sock = _get_socket(tr) _set_nodelay(sock) writer.write(struct.pack('!ll', 8, 80877103)) # SSLRequest message. await writer.drain() resp = await reader.readexactly(1) if resp == b'S': return sock.dup() else: raise ConnectionError( 'PostgreSQL server at "{}:{}" rejected SSL upgrade'.format( host, port)) finally: tr.close() async def _create_ssl_connection(protocol_factory, host, port, *, loop, ssl_context): sock = await _get_ssl_ready_socket(host, port, loop=loop) try: return await loop.create_connection( protocol_factory, sock=sock, ssl=ssl_context, server_hostname=host) except Exception: sock.close() raise async def _open_connection(*, loop, addr, params: _ConnectionParameters): if isinstance(addr, str): r, w = await asyncio.open_unix_connection(addr, loop=loop) else: if params.ssl: sock = await _get_ssl_ready_socket(*addr, loop=loop) try: r, w = await asyncio.open_connection( sock=sock, loop=loop, ssl=params.ssl, server_hostname=addr[0]) except Exception: sock.close() raise else: r, w = await asyncio.open_connection(*addr, loop=loop) _set_nodelay(_get_socket(w.transport)) return r, w 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() asyncpg-0.13.0/asyncpg/__init__.py0000664000372000037200000000102513172407302017653 0ustar travistravis00000000000000# 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 .connection import connect, Connection # NOQA from .exceptions import * # NOQA from .pool import create_pool # NOQA from .protocol import Record # NOQA from .types import * # NOQA __all__ = ('connect', 'create_pool', 'Record', 'Connection') + \ exceptions.__all__ # NOQA __version__ = '0.13.0' asyncpg-0.13.0/asyncpg/protocol/0000775000372000037200000000000013172407445017415 5ustar travistravis00000000000000asyncpg-0.13.0/asyncpg/protocol/debug.pxd0000664000372000037200000000006513172407302021211 0ustar travistravis00000000000000cdef extern from "debug.h": cdef int ASYNCPG_DEBUG asyncpg-0.13.0/asyncpg/protocol/codecs/0000775000372000037200000000000013172407445020655 5ustar travistravis00000000000000asyncpg-0.13.0/asyncpg/protocol/codecs/money.pyx0000664000372000037200000000101513172407302022533 0ustar travistravis00000000000000# 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_monetary_codecs(): moneyoids = [ MONEYOID, ] for oid in moneyoids: register_core_codec(oid, &text_encode, &text_decode, PG_FORMAT_TEXT) init_monetary_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/datetime.pyx0000664000372000037200000003540013172407302023205 0ustar travistravis00000000000000# 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 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(pg_epoch_datetime_utc.timestamp()) pg_epoch_date = datetime.date(2000, 1, 1) cdef int32_t pg_date_offset_ord = \ cpython.PyLong_AsLong(pg_epoch_date.toordinal()) # Binary representations of infinity for datetimes. cdef int64_t pg_time64_infinity = 0x7fffffffffffffff cdef int64_t pg_time64_negative_infinity = 0x8000000000000000 cdef int32_t pg_date_infinity = 0x7fffffff cdef int32_t pg_date_negative_infinity = 0x80000000 infinity_datetime = datetime.datetime( datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) cdef int32_t infinity_datetime_ord = cpython.PyLong_AsLong( infinity_datetime.toordinal()) cdef int64_t infinity_datetime_ts = 252455615999999999 negative_infinity_datetime = datetime.datetime( datetime.MINYEAR, 1, 1, 0, 0, 0, 0) cdef int32_t negative_infinity_datetime_ord = cpython.PyLong_AsLong( negative_infinity_datetime.toordinal()) cdef int64_t negative_infinity_datetime_ts = -63082281600000000 infinity_date = datetime.date(datetime.MAXYEAR, 12, 31) cdef int32_t infinity_date_ord = cpython.PyLong_AsLong( infinity_date.toordinal()) negative_infinity_date = datetime.date(datetime.MINYEAR, 1, 1) cdef int32_t negative_infinity_date_ord = cpython.PyLong_AsLong( negative_infinity_date.toordinal()) cdef inline _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(FastReadBuffer buf, int64_t *seconds, uint32_t *microseconds): # XXX: add support for double timestamps # int64 timestamps, cdef int64_t ts = hton.unpack_int64(buf.read(8)) if ts == pg_time64_infinity: return 1 elif ts == pg_time64_negative_infinity: return -1 seconds[0] = (ts / 1000000) microseconds[0] = (ts % 1000000) return 0 cdef date_encode(ConnectionSettings 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(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer buf): cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(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(ConnectionSettings settings, FastReadBuffer buf): cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(4)) return (pg_ordinal,) cdef timestamp_encode(ConnectionSettings settings, WriteBuffer buf, obj): 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(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer buf): cdef: int64_t seconds = 0 uint32_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(ConnectionSettings settings, FastReadBuffer buf): cdef: int64_t ts = hton.unpack_int64(buf.read(8)) return (ts,) cdef timestamptz_encode(ConnectionSettings settings, WriteBuffer buf, obj): 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 delta = obj.astimezone(utc) - 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(ConnectionSettings settings, FastReadBuffer buf): cdef: int64_t seconds = 0 uint32_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(ConnectionSettings 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(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer buf): cdef: int64_t seconds = 0 uint32_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(ConnectionSettings settings, FastReadBuffer buf): cdef: int64_t ts = hton.unpack_int64(buf.read(8)) return (ts,) cdef timetz_encode(ConnectionSettings 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) buf.write_int32(offset_sec) cdef timetz_encode_tuple(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer buf): time = time_decode(settings, buf) cdef int32_t offset = (hton.unpack_int32(buf.read(4)) / 60) return time.replace(tzinfo=datetime.timezone(timedelta(minutes=offset))) cdef timetz_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): cdef: int64_t microseconds = hton.unpack_int64(buf.read(8)) int32_t offset_sec = hton.unpack_int32(buf.read(4)) return (microseconds, offset_sec) cdef interval_encode(ConnectionSettings 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(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer buf): cdef: int32_t days int32_t months int32_t years int64_t seconds = 0 uint32_t microseconds = 0 _decode_time(buf, &seconds, µseconds) days = hton.unpack_int32(buf.read(4)) months = hton.unpack_int32(buf.read(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(ConnectionSettings settings, FastReadBuffer buf): cdef: int32_t days int32_t months int64_t microseconds microseconds = hton.unpack_int64(buf.read(8)) days = hton.unpack_int32(buf.read(4)) months = hton.unpack_int32(buf.read(4)) return (months, days, microseconds) cdef init_datetime_codecs(): register_core_codec(DATEOID, &date_encode, &date_decode, PG_FORMAT_BINARY) register_core_codec(DATEOID, &date_encode_tuple, &date_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) register_core_codec(TIMEOID, &time_encode, &time_decode, PG_FORMAT_BINARY) register_core_codec(TIMEOID, &time_encode_tuple, &time_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) register_core_codec(TIMETZOID, &timetz_encode, &timetz_decode, PG_FORMAT_BINARY) register_core_codec(TIMETZOID, &timetz_encode_tuple, &timetz_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) register_core_codec(TIMESTAMPOID, ×tamp_encode, ×tamp_decode, PG_FORMAT_BINARY) register_core_codec(TIMESTAMPOID, ×tamp_encode_tuple, ×tamp_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) register_core_codec(TIMESTAMPTZOID, ×tamptz_encode, ×tamptz_decode, PG_FORMAT_BINARY) register_core_codec(TIMESTAMPTZOID, ×tamp_encode_tuple, ×tamp_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) register_core_codec(INTERVALOID, &interval_encode, &interval_decode, PG_FORMAT_BINARY) register_core_codec(INTERVALOID, &interval_encode_tuple, &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, &text_encode, &text_decode, PG_FORMAT_TEXT) register_core_codec(RELTIMEOID, &text_encode, &text_decode, PG_FORMAT_TEXT) register_core_codec(TINTERVALOID, &text_encode, &text_decode, PG_FORMAT_TEXT) init_datetime_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/json.pyx0000664000372000037200000000232313172407302022360 0ustar travistravis00000000000000# 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(ConnectionSettings 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) # JSONB format version buf.write_cstr(str, size) cdef jsonb_decode(ConnectionSettings settings, FastReadBuffer buf): cdef uint8_t format = buf.read(1)[0] if format != 1: raise ValueError('unexpected JSONB format: {}'.format(format)) return text_decode(settings, buf) cdef init_json_codecs(): register_core_codec(JSONOID, &text_encode, &text_decode, PG_FORMAT_BINARY) register_core_codec(JSONBOID, &jsonb_encode, &jsonb_decode, PG_FORMAT_BINARY) init_json_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/uuid.pyx0000664000372000037200000000140313172407302022353 0ustar travistravis00000000000000# 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 uuid _UUID = uuid.UUID cdef uuid_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): if cpython.PyUnicode_Check(obj): obj = _UUID(obj) bytea_encode(settings, wbuf, obj.bytes) cdef uuid_decode(ConnectionSettings settings, FastReadBuffer buf): return _UUID(bytes=bytea_decode(settings, buf)) cdef init_uuid_codecs(): register_core_codec(UUIDOID, &uuid_encode, &uuid_decode, PG_FORMAT_BINARY) init_uuid_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/hstore.pyx0000664000372000037200000000432213172407302022714 0ustar travistravis00000000000000# 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(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer 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(buf.read(4)) if elem_count == 0: return result for i in range(elem_count): elem_len = hton.unpack_int32(buf.read(4)) if elem_len < 0: raise ValueError('null value not allowed in hstore key') k = decode_pg_string(settings, buf.read(elem_len), elem_len) elem_len = hton.unpack_int32(buf.read(4)) if elem_len < 0: v = None else: v = decode_pg_string(settings, buf.read(elem_len), elem_len) result[k] = v return result cdef init_hstore_codecs(): register_extra_codec('pg_contrib.hstore', &hstore_encode, &hstore_decode, PG_FORMAT_BINARY) init_hstore_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/txid.pyx0000664000372000037200000000362513172407302022365 0ustar travistravis00000000000000# 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 txid_snapshot_encode(ConnectionSettings settings, WriteBuffer buf, obj): cdef: ssize_t nxip int64_t xmin int64_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(obj[2][i]) buf.write_int32(20 + xip_buf.len()) buf.write_int32(nxip) buf.write_int64(obj[0]) buf.write_int64(obj[1]) buf.write_buffer(xip_buf) cdef txid_snapshot_decode(ConnectionSettings settings, FastReadBuffer buf): cdef: int32_t nxip int64_t xmin int64_t xmax tuple xip_tup int32_t i object xip nxip = hton.unpack_int32(buf.read(4)) xmin = hton.unpack_int64(buf.read(8)) xmax = hton.unpack_int64(buf.read(8)) xip_tup = cpython.PyTuple_New(nxip) for i in range(nxip): xip = cpython.PyLong_FromLongLong(hton.unpack_int64(buf.read(8))) cpython.Py_INCREF(xip) cpython.PyTuple_SET_ITEM(xip_tup, i, xip) return (xmin, xmax, xip_tup) cdef init_txid_codecs(): register_core_codec(TXID_SNAPSHOTOID, &txid_snapshot_encode, &txid_snapshot_decode, PG_FORMAT_BINARY) init_txid_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/int.pyx0000664000372000037200000000643613172407302022212 0ustar travistravis00000000000000# 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(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer buf): return buf.read(1)[0] is b'\x01' cdef int2_encode(ConnectionSettings settings, WriteBuffer buf, obj): cdef int overflow = 0 cdef long val try: val = cpython.PyLong_AsLong(obj) except OverflowError: overflow = 1 if overflow or val < -32768 or val > 32767: raise OverflowError( 'int too big to be encoded as INT2: {!r}'.format(obj)) buf.write_int32(2) buf.write_int16(val) cdef int2_decode(ConnectionSettings settings, FastReadBuffer buf): return cpython.PyLong_FromLong(hton.unpack_int16(buf.read(2))) cdef int4_encode(ConnectionSettings settings, WriteBuffer buf, obj): cdef int overflow = 0 cdef long val = 0 try: 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 < -2147483648 or val > 2147483647)): raise OverflowError( 'int too big to be encoded as INT4: {!r}'.format(obj)) buf.write_int32(4) buf.write_int32(val) cdef int4_decode(ConnectionSettings settings, FastReadBuffer buf): return cpython.PyLong_FromLong(hton.unpack_int32(buf.read(4))) cdef int8_encode(ConnectionSettings settings, WriteBuffer buf, obj): cdef int overflow = 0 cdef long long val try: 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 < -9223372036854775808 or val > 9223372036854775807)): raise OverflowError( 'int too big to be encoded as INT8: {!r}'.format(obj)) buf.write_int32(8) buf.write_int64(val) cdef int8_decode(ConnectionSettings settings, FastReadBuffer buf): return cpython.PyLong_FromLongLong(hton.unpack_int64(buf.read(8))) cdef init_int_codecs(): register_core_codec(BOOLOID, &bool_encode, &bool_decode, PG_FORMAT_BINARY) register_core_codec(INT2OID, &int2_encode, &int2_decode, PG_FORMAT_BINARY) register_core_codec(INT4OID, &int4_encode, &int4_decode, PG_FORMAT_BINARY) register_core_codec(INT8OID, &int8_encode, &int8_decode, PG_FORMAT_BINARY) init_int_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/base.pyx0000664000372000037200000006407713172407302022337 0ustar travistravis00000000000000# 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* binary_codec_map[(MAXSUPPORTEDOID + 1) * 2] cdef void* text_codec_map[(MAXSUPPORTEDOID + 1) * 2] cdef dict TYPE_CODECS_CACHE = {} cdef dict EXTRA_CODECS = {} @cython.final cdef class Codec: def __cinit__(self, uint32_t oid): self.oid = oid self.type = CODEC_UNDEFINED cdef init(self, str name, str schema, str kind, CodecType type, ServerDataFormat format, ClientExchangeFormat xformat, encode_func c_encoder, decode_func c_decoder, 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.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 if element_names is not None: self.element_names = record.ApgRecordDesc_New( element_names, tuple(element_names)) else: self.element_names = 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 RuntimeError( 'cannot encode 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_COMPOSITE: if format != PG_FORMAT_BINARY: raise RuntimeError( 'cannot encode 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 RuntimeError('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.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_composite(self, ConnectionSettings settings, WriteBuffer buf, object obj): cdef: WriteBuffer elem_data int i list elem_codecs = self.element_codecs ssize_t count 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: bytea_encode(settings, buf, data) elif self.format == PG_FORMAT_TEXT: text_encode(settings, buf, data) else: raise RuntimeError( 'unexpected data format: {}'.format(self.format)) elif self.xformat == PG_XFORMAT_TUPLE: self.c_encoder(settings, buf, data) else: raise RuntimeError( '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, FastReadBuffer buf): return self.c_decoder(settings, buf) cdef decode_array(self, ConnectionSettings settings, FastReadBuffer buf): return array_decode(settings, buf, codec_decode_func_ex, (self.element_codec)) cdef decode_array_text(self, ConnectionSettings settings, FastReadBuffer buf): return textarray_decode(settings, buf, codec_decode_func_ex, (self.element_codec), self.element_delimiter) cdef decode_range(self, ConnectionSettings settings, FastReadBuffer buf): return range_decode(settings, buf, codec_decode_func_ex, (self.element_codec)) cdef decode_composite(self, ConnectionSettings settings, FastReadBuffer buf): cdef: object result uint32_t elem_count uint32_t i int32_t elem_len uint32_t elem_typ uint32_t received_elem_typ Codec elem_codec FastReadBuffer elem_buf = FastReadBuffer.new() elem_count = hton.unpack_int32(buf.read(4)) result = record.ApgRecord_New(self.element_names, elem_count) for i in range(elem_count): elem_typ = self.element_type_oids[i] received_elem_typ = hton.unpack_int32(buf.read(4)) if received_elem_typ != elem_typ: raise RuntimeError( 'unexpected data type of composite type attribute {}: ' '{!r}, expected {!r}' .format( i, TYPEMAP.get(received_elem_typ, received_elem_typ), TYPEMAP.get(elem_typ, elem_typ) ) ) elem_len = hton.unpack_int32(buf.read(4)) if elem_len == -1: elem = None else: elem_codec = self.element_codecs[i] elem = elem_codec.decode(settings, elem_buf.slice_from(buf, elem_len)) cpython.Py_INCREF(elem) record.ApgRecord_SET_ITEM(result, i, elem) return result cdef decode_in_python(self, ConnectionSettings settings, FastReadBuffer buf): if self.xformat == PG_XFORMAT_OBJECT: if self.format == PG_FORMAT_BINARY: data = bytea_decode(settings, buf) elif self.format == PG_FORMAT_TEXT: data = text_decode(settings, buf) else: raise RuntimeError( 'unexpected data format: {}'.format(self.format)) elif self.xformat == PG_XFORMAT_TUPLE: data = self.c_decoder(settings, buf) else: raise RuntimeError( 'unexpected exchange format: {}'.format(self.xformat)) return self.py_decoder(data) cdef inline decode(self, ConnectionSettings settings, FastReadBuffer 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: 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: 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, 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, 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, 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, ServerDataFormat format, ClientExchangeFormat xformat): cdef Codec codec codec = Codec(oid) codec.init(name, schema, kind, CODEC_PY, format, xformat, c_encoder, c_decoder, 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, FastReadBuffer buf, const void *arg): return (arg).decode(settings, buf) cdef class DataCodecConfig: def __init__(self, cache_key): try: self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] except KeyError: self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] = {} self._local_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 not ti['has_bin_io']: format = PG_FORMAT_TEXT else: format = PG_FORMAT_BINARY has_text_elements = False if self.get_codec(oid, format) 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) if ti['elem_has_bin_io']: elem_format = PG_FORMAT_BINARY else: elem_format = PG_FORMAT_TEXT elem_codec = self.get_codec(array_element_oid, elem_format) if elem_codec is None: elem_format = PG_FORMAT_TEXT elem_codec = self.declare_fallback_codec( array_element_oid, name, schema) elem_delim = ti['elemdelim'][0] self._type_codecs_cache[oid, elem_format] = \ Codec.new_array_codec( oid, name, schema, elem_codec, elem_delim) elif ti['kind'] == b'c': if not comp_type_attrs: raise RuntimeError( 'type record missing field types for ' 'composite {}'.format(oid)) # Composite type comp_elem_codecs = [] for typoid in comp_type_attrs: elem_codec = self.get_codec(typoid, PG_FORMAT_BINARY) if elem_codec is None: elem_codec = self.get_codec(typoid, PG_FORMAT_TEXT) has_text_elements = True if elem_codec is None: raise RuntimeError( 'no codec for composite attribute type {}'.format( typoid)) comp_elem_codecs.append(elem_codec) element_names = collections.OrderedDict() for i, attrname in enumerate(ti['attrnames']): element_names[attrname] = i if has_text_elements: format = PG_FORMAT_TEXT self._type_codecs_cache[oid, format] = \ Codec.new_composite_codec( oid, name, schema, format, comp_elem_codecs, comp_type_attrs, element_names) elif ti['kind'] == b'd': # Domain type if not base_type: raise RuntimeError( 'type record missing base type for domain {}'.format( oid)) elem_codec = self.get_codec(base_type, format) if elem_codec is None: format = PG_FORMAT_TEXT elem_codec = self.declare_fallback_codec( base_type, name, schema) self._type_codecs_cache[oid, format] = elem_codec elif ti['kind'] == b'r': # Range type if not range_subtype_oid: raise RuntimeError( 'type record missing base type for range {}'.format( oid)) if ti['elem_has_bin_io']: elem_format = PG_FORMAT_BINARY else: elem_format = PG_FORMAT_TEXT elem_codec = self.get_codec(range_subtype_oid, elem_format) if elem_codec is None: elem_format = PG_FORMAT_TEXT elem_codec = self.declare_fallback_codec( range_subtype_oid, name, schema) self._type_codecs_cache[oid, elem_format] = \ Codec.new_range_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, encoder, decoder, format, xformat): cdef: Codec core_codec encode_func c_encoder = NULL decode_func c_decoder = NULL if xformat == PG_XFORMAT_TUPLE: core_codec = get_any_core_codec(typeoid, format, xformat) if core_codec is None: raise ValueError( "{} type does not support 'tuple' exchange format".format( typename)) c_encoder = core_codec.c_encoder c_decoder = core_codec.c_decoder format = core_codec.format # Clear all previous overrides (this also clears type cache). self.remove_python_codec(typeoid, typename, typeschema) self._local_type_codecs[typeoid] = \ Codec.new_python_codec(typeoid, typename, typeschema, typekind, encoder, decoder, c_encoder, c_decoder, format, xformat) def remove_python_codec(self, typeoid, typename, typeschema): self._local_type_codecs.pop(typeoid, 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 if format == PG_FORMAT_ANY: formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) else: formats = (format,) for format in formats: if self.get_codec(typeoid, format) is not None: raise ValueError('cannot override codec for type {}'.format( typeoid)) if isinstance(alias_to, int): target_codec = self.get_codec(alias_to, 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._local_type_codecs[typeoid] = codec break else: raise ValueError('unknown alias target: {}'.format(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._type_codecs_cache.clear() def declare_fallback_codec(self, uint32_t oid, str name, str schema): cdef Codec codec codec = self.get_codec(oid, PG_FORMAT_TEXT) if codec is not None: return 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 NotImplementedError( 'unhandled standard data type {!r} (OID {})'.format( name, 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): cdef Codec codec codec = self.get_local_codec(oid) 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._type_codecs_cache[oid, format] except KeyError: return None cdef inline Codec get_local_codec(self, uint32_t oid): return self._local_type_codecs.get(oid) cdef inline Codec get_core_codec( uint32_t oid, ServerDataFormat format, ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): cdef: void *ptr = NULL if oid > MAXSUPPORTEDOID: return None if format == PG_FORMAT_BINARY: ptr = binary_codec_map[oid * xformat] elif format == PG_FORMAT_TEXT: ptr = text_codec_map[oid * xformat] if ptr is NULL: return None else: return ptr cdef inline Codec get_any_core_codec( uint32_t oid, ServerDataFormat format, ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): """A version of get_core_codec that accepts PG_FORMAT_ANY.""" cdef: Codec codec if format == PG_FORMAT_ANY: codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat) if codec is None: codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat) else: codec = get_core_codec(oid, format, xformat) return codec cdef inline int has_core_codec(uint32_t oid): return binary_codec_map[oid] != NULL or text_codec_map[oid] != NULL cdef register_core_codec(uint32_t oid, encode_func encode, decode_func decode, ServerDataFormat format, ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): if oid > MAXSUPPORTEDOID: raise RuntimeError( 'cannot register core codec for OID {}: it is greater ' 'than MAXSUPPORTEDOID ({})'.format(oid, MAXSUPPORTEDOID)) cdef: Codec codec str name str kind name = TYPEMAP[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, 0) cpython.Py_INCREF(codec) # immortalize if format == PG_FORMAT_BINARY: binary_codec_map[oid * xformat] = codec elif format == PG_FORMAT_TEXT: text_codec_map[oid * xformat] = codec else: raise RuntimeError('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, 0) EXTRA_CODECS[name, format] = codec cdef inline Codec get_extra_codec(str name, ServerDataFormat format): return EXTRA_CODECS.get((name, format)) asyncpg-0.13.0/asyncpg/protocol/codecs/base.pxd0000664000372000037200000001304113172407302022273 0ustar travistravis00000000000000# 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, FastReadBuffer buf) ctypedef object (*codec_encode_func)(Codec codec, ConnectionSettings settings, WriteBuffer buf, object obj) ctypedef object (*codec_decode_func)(Codec codec, ConnectionSettings settings, FastReadBuffer buf) cdef enum CodecType: CODEC_UNDEFINED = 0 CODEC_C = 1 CODEC_PY = 2 CODEC_ARRAY = 3 CODEC_COMPOSITE = 4 CODEC_RANGE = 5 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 object py_encoder object py_decoder # arrays Codec element_codec Py_UCS4 element_delimiter # composite types tuple element_type_oids object element_names 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, 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_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, FastReadBuffer buf) cdef decode_array(self, ConnectionSettings settings, FastReadBuffer buf) cdef decode_array_text(self, ConnectionSettings settings, FastReadBuffer buf) cdef decode_range(self, ConnectionSettings settings, FastReadBuffer buf) cdef decode_composite(self, ConnectionSettings settings, FastReadBuffer buf) cdef decode_in_python(self, ConnectionSettings settings, FastReadBuffer buf) cdef inline encode(self, ConnectionSettings settings, WriteBuffer buf, object obj) cdef inline decode(self, ConnectionSettings settings, FastReadBuffer 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_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, ServerDataFormat format, ClientExchangeFormat xformat) cdef class DataCodecConfig: cdef: dict _type_codecs_cache dict _local_type_codecs cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format) cdef inline Codec get_local_codec(self, uint32_t oid) asyncpg-0.13.0/asyncpg/protocol/codecs/network.pyx0000664000372000037200000000777313172407302023116 0ustar travistravis00000000000000# 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 _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(ConnectionSettings settings, FastReadBuffer buf): cdef: int32_t family = buf.read(1)[0] uint8_t bits = buf.read(1)[0] int32_t is_cidr = buf.read(1)[0] int32_t addrlen = buf.read(1)[0] bytes addr uint8_t max_prefix_len = _ip_max_prefix_len(family) 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(buf.read(addrlen), addrlen) if is_cidr or bits != max_prefix_len: return _ipnet(addr).supernet(new_prefix=cpython.PyLong_FromLong(bits)) else: return _ipaddr(addr) cdef cidr_encode(ConnectionSettings 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 inet_encode(ConnectionSettings 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. cidr_encode(settings, buf, obj) else: family = _ver_to_family(ipaddr.version) _net_encode(buf, family, _ip_max_prefix_len(family), 0, ipaddr.packed) cdef init_network_codecs(): register_core_codec(CIDROID, &cidr_encode, &net_decode, PG_FORMAT_BINARY) register_core_codec(INETOID, &inet_encode, &net_decode, PG_FORMAT_BINARY) register_core_codec(MACADDROID, &text_encode, &text_decode, PG_FORMAT_TEXT) register_core_codec(MACADDR8OID, &text_encode, &text_decode, PG_FORMAT_TEXT) init_network_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/geometry.pyx0000664000372000037200000001342313172407302023245 0ustar travistravis00000000000000# 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.types import Box, Line, LineSegment, Path, Point, Polygon, Circle 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(FastReadBuffer buf): cdef: int32_t npts = hton.unpack_int32(buf.read(4)) pts = cpython.PyTuple_New(npts) int32_t i object point double x double y for i in range(npts): x = hton.unpack_double(buf.read(8)) y = hton.unpack_double(buf.read(8)) point = Point(x, y) cpython.Py_INCREF(point) cpython.PyTuple_SET_ITEM(pts, i, point) return pts cdef box_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): wbuf.write_int32(32) _encode_points(wbuf, (obj[0], obj[1])) cdef box_decode(ConnectionSettings settings, FastReadBuffer buf): cdef: double high_x = hton.unpack_double(buf.read(8)) double high_y = hton.unpack_double(buf.read(8)) double low_x = hton.unpack_double(buf.read(8)) double low_y = hton.unpack_double(buf.read(8)) return Box(Point(high_x, high_y), Point(low_x, low_y)) cdef line_encode(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer buf): cdef: double A = hton.unpack_double(buf.read(8)) double B = hton.unpack_double(buf.read(8)) double C = hton.unpack_double(buf.read(8)) return Line(A, B, C) cdef lseg_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): wbuf.write_int32(32) _encode_points(wbuf, (obj[0], obj[1])) cdef lseg_decode(ConnectionSettings settings, FastReadBuffer buf): cdef: double p1_x = hton.unpack_double(buf.read(8)) double p1_y = hton.unpack_double(buf.read(8)) double p2_x = hton.unpack_double(buf.read(8)) double p2_y = hton.unpack_double(buf.read(8)) return LineSegment((p1_x, p1_y), (p2_x, p2_y)) cdef point_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): wbuf.write_int32(16) wbuf.write_double(obj[0]) wbuf.write_double(obj[1]) cdef point_decode(ConnectionSettings settings, FastReadBuffer buf): cdef: double x = hton.unpack_double(buf.read(8)) double y = hton.unpack_double(buf.read(8)) return Point(x, y) cdef path_encode(ConnectionSettings 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, 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(ConnectionSettings settings, FastReadBuffer buf): cdef: int8_t is_closed = buf.read(1)[0] return Path(*_decode_points(buf), is_closed=is_closed == 1) cdef poly_encode(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer buf): return Polygon(*_decode_points(buf)) cdef circle_encode(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer buf): cdef: double center_x = hton.unpack_double(buf.read(8)) double center_y = hton.unpack_double(buf.read(8)) double radius = hton.unpack_double(buf.read(8)) return Circle((center_x, center_y), radius) cdef init_geometry_codecs(): register_core_codec(BOXOID, &box_encode, &box_decode, PG_FORMAT_BINARY) register_core_codec(LINEOID, &line_encode, &line_decode, PG_FORMAT_BINARY) register_core_codec(LSEGOID, &lseg_encode, &lseg_decode, PG_FORMAT_BINARY) register_core_codec(POINTOID, &point_encode, &point_decode, PG_FORMAT_BINARY) register_core_codec(PATHOID, &path_encode, &path_decode, PG_FORMAT_BINARY) register_core_codec(POLYGONOID, &poly_encode, &poly_decode, PG_FORMAT_BINARY) register_core_codec(CIRCLEOID, &circle_encode, &circle_decode, PG_FORMAT_BINARY) init_geometry_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/textutils.pyx0000664000372000037200000000373313172407302023462 0ustar travistravis00000000000000# 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 asyncpg-0.13.0/asyncpg/protocol/codecs/array.pyx0000664000372000037200000007063213172407302022535 0ustar travistravis00000000000000# 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 Container as ContainerABC 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, FastReadBuffer buf, const void *arg) cdef inline bint _is_trivial_container(object obj): return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \ PyByteArray_Check(obj) or PyMemoryView_Check(obj) cdef inline _is_container(object obj): return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) cdef inline _is_sub_array(object obj): return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) \ 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(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_container(obj): raise TypeError( 'a non-trivial iterable 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_bytes(b'"NULL"') 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_container(obj): raise TypeError( 'a non-trivial iterable 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, FastReadBuffer buf, decode_func_ex decoder, const void *decoder_arg): cdef: int32_t ndims = hton.unpack_int32(buf.read(4)) int32_t flags = hton.unpack_int32(buf.read(4)) uint32_t elem_oid = hton.unpack_int32(buf.read(4)) list result int i int32_t elem_len int32_t elem_count = 1 FastReadBuffer elem_buf = FastReadBuffer.new() int32_t dims[ARRAY_MAXDIM] Codec elem_codec if ndims == 0: result = cpython.PyList_New(0) return result if ndims > ARRAY_MAXDIM: raise RuntimeError( 'number of array dimensions ({}) exceed the maximum expected ({})'. format(ndims, ARRAY_MAXDIM)) for i in range(ndims): dims[i] = hton.unpack_int32(buf.read(4)) # Ignore the lower bound information buf.read(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(buf.read(4)) if elem_len == -1: elem = None else: elem_buf.slice_from(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, FastReadBuffer buf, decode_func_ex decoder, const void *decoder_arg, int32_t ndims, int32_t *dims, FastReadBuffer 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] if ASYNCPG_DEBUG: if ndims <= 0: raise RuntimeError('unexpected ndims value: {}'.format(ndims)) for i in range(ndims): array_len *= dims[i] indexes[i] = 0 for i in range(array_len): # Decode the element. elem_len = hton.unpack_int32(buf.read(4)) if elem_len == -1: elem = None else: elem = decoder(settings, elem_buf.slice_from(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, FastReadBuffer 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 = text_decode(settings, buf) array_text = PyUnicode_AsUCS4Copy(s) try: return _textarray_decode( settings, array_text, decoder, decoder_arg, typdelim) except ValueError as e: raise ValueError( 'malformed array literal {!r}: {}'.format(s, e.args[0])) finally: 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 FastReadBuffer item_buf = FastReadBuffer.new() 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 = PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, item_start, item_end - item_start) # Prepare the element buffer and call the text decoder # for the element type. as_pg_string_and_size( settings, item_text, &pg_item_str, &pg_item_len) item_buf.buf = pg_item_str item_buf.len = 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 int4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, const void *arg): return int4_encode(settings, buf, obj) cdef int4_decode_ex(ConnectionSettings settings, FastReadBuffer buf, const void *arg): return int4_decode(settings, buf) cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items): array_encode(settings, buf, items, OIDOID, &int4_encode_ex, NULL) cdef arrayoid_decode(ConnectionSettings settings, FastReadBuffer buf): return array_decode(settings, buf, &int4_decode_ex, NULL) cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, const void *arg): return text_encode(settings, buf, obj) cdef text_decode_ex(ConnectionSettings settings, FastReadBuffer buf, const void *arg): return 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, FastReadBuffer buf): return array_decode(settings, buf, &text_decode_ex, NULL) cdef anyarray_decode(ConnectionSettings settings, FastReadBuffer buf): # Instances of anyarray (or any other polymorphic pseudotype) are # never supposed to be returned from actual queries. raise RuntimeError('unexpected instance of \'anyarray\' type') cdef init_array_codecs(): register_core_codec(ANYARRAYOID, NULL, &anyarray_decode, PG_FORMAT_BINARY) # 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() asyncpg-0.13.0/asyncpg/protocol/codecs/text.pyx0000664000372000037200000000404113172407302022372 0ustar travistravis00000000000000# 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( ConnectionSettings 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] = PyUnicode_AsUTF8AndSize(obj, size) else: encoded = settings.get_text_codec().encode(obj) cpython.PyBytes_AsStringAndSize(encoded, cstr, size) if size[0] > 0x7fffffff: raise ValueError('string too long') cdef text_encode(ConnectionSettings 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(ConnectionSettings 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) cdef text_decode(ConnectionSettings settings, FastReadBuffer buf): cdef ssize_t buf_len = buf.len return decode_pg_string(settings, buf.read_all(), buf_len) cdef init_text_codecs(): textoids = [ NAMEOID, BPCHAROID, VARCHAROID, TEXTOID, XMLOID ] for oid in textoids: register_core_codec(oid, &text_encode, &text_decode, PG_FORMAT_BINARY) register_core_codec(oid, &text_encode, &text_decode, PG_FORMAT_TEXT) init_text_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/bits.pyx0000664000372000037200000000355113172407302022354 0ustar travistravis00000000000000# 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.types import BitString cdef bits_encode(ConnectionSettings 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, 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(ConnectionSettings settings, FastReadBuffer buf): cdef: int32_t bitlen = hton.unpack_int32(buf.read(4)) ssize_t buf_len = buf.len bytes_ = cpython.PyBytes_FromStringAndSize(buf.read_all(), buf_len) return BitString.frombytes(bytes_, bitlen) cdef init_bits_codecs(): register_core_codec(BITOID, &bits_encode, &bits_decode, PG_FORMAT_BINARY) register_core_codec(VARBITOID, &bits_encode, &bits_decode, PG_FORMAT_BINARY) init_bits_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/bytea.pyx0000664000372000037200000000261413172407302022516 0ustar travistravis00000000000000# 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(ConnectionSettings 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(ConnectionSettings settings, FastReadBuffer buf): cdef ssize_t buf_len = buf.len return cpython.PyBytes_FromStringAndSize(buf.read_all(), buf_len) cdef init_bytea_codecs(): register_core_codec(BYTEAOID, &bytea_encode, &bytea_decode, PG_FORMAT_BINARY) register_core_codec(CHAROID, &bytea_encode, &bytea_decode, PG_FORMAT_BINARY) init_bytea_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/__init__.py0000664000372000037200000000000013172407302022744 0ustar travistravis00000000000000asyncpg-0.13.0/asyncpg/protocol/codecs/numeric.pyx0000664000372000037200000002205613172407302023056 0ustar travistravis00000000000000# 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 from asyncpg.protocol cimport python # 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 _Dec = decimal.Decimal cdef numeric_encode_text(ConnectionSettings settings, WriteBuffer buf, obj): text_encode(settings, buf, str(obj)) cdef numeric_decode_text(ConnectionSettings settings, FastReadBuffer buf): return _Dec(text_decode(settings, buf)) cdef numeric_encode_binary(ConnectionSettings 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 == 'F': raise ValueError('numeric type does not support infinite values') if dt.exponent == 'n' or dt.exponent == 'N': # NaN sign = NUMERIC_NAN 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(ConnectionSettings settings, FastReadBuffer buf): cdef: uint16_t num_pgdigits = hton.unpack_int16(buf.read(2)) int16_t weight = hton.unpack_int16(buf.read(2)) uint16_t sign = hton.unpack_int16(buf.read(2)) uint16_t dscale = hton.unpack_int16(buf.read(2)) int16_t pgdigit0 ssize_t i int16_t pgdigit object pydigits ssize_t num_pydigits ssize_t buf_size int64_t exponent int64_t abs_exponent ssize_t exponent_chars ssize_t front_padding = 0 ssize_t trailing_padding = 0 ssize_t num_fract_digits ssize_t dscale_left char smallbuf[_NUMERIC_DECODER_SMALLBUF_SIZE] char *charbuf char *bufptr bint buf_allocated = False if sign == NUMERIC_NAN: # Not-a-number return _Dec('NaN') if num_pgdigits == 0: # Zero return _Dec() pgdigit0 = hton.unpack_int16(buf.read(2)) if weight >= 0: if pgdigit0 < 10: front_padding = 3 elif pgdigit0 < 100: front_padding = 2 elif pgdigit0 < 1000: front_padding = 1 # Maximum possible number of decimal digits in base 10. num_pydigits = num_pgdigits * DEC_DIGITS + dscale # Exponent. exponent = (weight + 1) * DEC_DIGITS - front_padding abs_exponent = abs(exponent) # Number of characters required to render absolute exponent value. exponent_chars = log10(abs_exponent) + 1 buf_size = ( 1 + # sign 1 + # leading zero 1 + # decimal dot num_pydigits + # digits 2 + # exponent indicator (E-,E+) exponent_chars + # exponent 1 # null terminator char ) if buf_size > _NUMERIC_DECODER_SMALLBUF_SIZE: charbuf = 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(buf.read(2)) bufptr = _unpack_digit(bufptr, pgdigit) if dscale: if weight >= 0: num_fract_digits = num_pgdigits - weight - 1 else: num_fract_digits = num_pgdigits # Check how much dscale is left to render (trailing zeros). dscale_left = dscale - num_fract_digits * DEC_DIGITS if dscale_left > 0: for i in range(dscale_left): bufptr[i] = b'0' # If display scale is _less_ than the number of rendered digits, # dscale_left will be negative and this will strip the excess # trailing zeros. bufptr += dscale_left 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 = python.PyUnicode_FromString(charbuf) return _Dec(pydigits) finally: if buf_allocated: PyMem_Free(charbuf) 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 cdef init_numeric_codecs(): register_core_codec(NUMERICOID, &numeric_encode_text, &numeric_decode_text, PG_FORMAT_TEXT) register_core_codec(NUMERICOID, &numeric_encode_binary, &numeric_decode_binary, PG_FORMAT_BINARY) init_numeric_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/tsearch.pyx0000664000372000037200000000127613172407302023046 0ustar travistravis00000000000000# 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_tsearch_codecs(): ts_oids = [ TSQUERYOID, TSVECTOROID, ] for oid in ts_oids: register_core_codec(oid, &text_encode, &text_decode, PG_FORMAT_TEXT) register_core_codec(GTSVECTOROID, NULL, &text_decode, PG_FORMAT_TEXT) init_tsearch_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/float.pyx0000664000372000037200000000272313172407302022520 0ustar travistravis00000000000000# 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(ConnectionSettings 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('float value too large to be encoded as FLOAT4') buf.write_int32(4) buf.write_float(fval) cdef float4_decode(ConnectionSettings settings, FastReadBuffer buf): cdef float f = hton.unpack_float(buf.read(4)) return cpython.PyFloat_FromDouble(f) cdef float8_encode(ConnectionSettings settings, WriteBuffer buf, obj): cdef double dval = cpython.PyFloat_AsDouble(obj) buf.write_int32(8) buf.write_double(dval) cdef float8_decode(ConnectionSettings settings, FastReadBuffer buf): cdef double f = hton.unpack_double(buf.read(8)) return cpython.PyFloat_FromDouble(f) cdef init_float_codecs(): register_core_codec(FLOAT4OID, &float4_encode, &float4_decode, PG_FORMAT_BINARY) register_core_codec(FLOAT8OID, &float8_encode, &float8_decode, PG_FORMAT_BINARY) init_float_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/record.pyx0000664000372000037200000000353013172407302022666 0ustar travistravis00000000000000# 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 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, FastReadBuffer buf): cdef: tuple result uint32_t elem_count int32_t elem_len uint32_t elem_typ uint32_t i Codec elem_codec FastReadBuffer elem_buf = FastReadBuffer.new() elem_count = hton.unpack_int32(buf.read(4)) result = cpython.PyTuple_New(elem_count) for i in range(elem_count): elem_typ = hton.unpack_int32(buf.read(4)) elem_len = hton.unpack_int32(buf.read(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 RuntimeError( 'no decoder for composite type element in ' 'position {} of type OID {}'.format(i, elem_typ)) elem = elem_codec.decode(settings, elem_buf.slice_from(buf, elem_len)) cpython.Py_INCREF(elem) cpython.PyTuple_SET_ITEM(result, i, elem) return result cdef init_record_codecs(): register_core_codec(RECORDOID, NULL, &anonymous_record_decode, PG_FORMAT_BINARY) init_record_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/range.pyx0000664000372000037200000001053613172407302022510 0ustar travistravis00000000000000# 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 # 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, FastReadBuffer buf, decode_func_ex decoder, const void *decoder_arg): cdef: uint8_t flags = buf.read(1)[0] int32_t bound_len object lower = None object upper = None FastReadBuffer bound_buf = FastReadBuffer.new() if _range_has_lbound(flags): bound_len = hton.unpack_int32(buf.read(4)) if bound_len == -1: lower = None else: bound_buf.slice_from(buf, bound_len) lower = decoder(settings, bound_buf, decoder_arg) if _range_has_ubound(flags): bound_len = hton.unpack_int32(buf.read(4)) if bound_len == -1: upper = None else: bound_buf.slice_from(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 init_range_codecs(): register_core_codec(ANYRANGEOID, NULL, &text_decode, PG_FORMAT_TEXT) init_range_codecs() asyncpg-0.13.0/asyncpg/protocol/codecs/misc.pyx0000664000372000037200000001005713172407302022345 0ustar travistravis00000000000000# 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(ConnectionSettings settings, WriteBuffer buf, obj): # Void is zero bytes buf.write_int32(0) cdef void_decode(ConnectionSettings settings, FastReadBuffer buf): # Do nothing; void will be passed as NULL so this function # will never be called. pass cdef init_pseudo_codecs(): # Void type is returned by SELECT void_returning_function() register_core_codec(VOIDOID, &void_encode, &void_decode, PG_FORMAT_BINARY) # Unknown type, always decoded as text register_core_codec(UNKNOWNOID, &text_encode, &text_decode, PG_FORMAT_TEXT) # OID and friends oid_types = [ OIDOID, TIDOID, XIDOID, CIDOID ] for oid_type in oid_types: register_core_codec(oid_type, &int4_encode, &int4_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 ] for reg_type in reg_types: register_core_codec(reg_type, &text_encode, &text_decode, PG_FORMAT_TEXT) # cstring type is used by Postgres' I/O functions register_core_codec(CSTRINGOID, &text_encode, &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, PG_DDL_COMMANDOID, INDEX_AM_HANDLEROID, ] register_core_codec(ANYENUMOID, NULL, &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, &text_encode, &text_decode, PG_FORMAT_TEXT) # Postgres' serialized expression tree type register_core_codec(PG_NODE_TREEOID, NULL, &text_decode, PG_FORMAT_TEXT) # pg_lsn type -- a pointer to a location in the XLOG. register_core_codec(PG_LSNOID, &int8_encode, &int8_decode, PG_FORMAT_BINARY) register_core_codec(SMGROID, &text_encode, &text_decode, PG_FORMAT_TEXT) # pg_dependencies and pg_ndistinct are special types # used in pg_statistic_ext columns. register_core_codec(PG_DEPENDENCIESOID, &text_encode, &text_decode, PG_FORMAT_TEXT) register_core_codec(PG_NDISTINCTOID, &text_encode, &text_decode, PG_FORMAT_TEXT) init_pseudo_codecs() asyncpg-0.13.0/asyncpg/protocol/settings.pyx0000664000372000037200000000623413172407302022014 0ustar travistravis00000000000000# 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.final cdef class ConnectionSettings: def __cinit__(self, conn_key): self._encoding = 'utf-8' self._is_utf8 = True self._settings = {} self._codec = codecs.lookup('utf-8') self._data_codecs = DataCodecConfig(conn_key) 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 inline is_encoding_utf8(self): return self._is_utf8 cpdef inline 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, 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 ValueError( 'invalid `format` argument, expected {}, got {!r}'.format( "'text', 'binary' or 'tuple'", format )) self._data_codecs.add_python_codec(typeoid, typename, typeschema, typekind, encoder, decoder, _format, xformat) cpdef inline remove_python_codec(self, typeoid, typename, typeschema): self._data_codecs.remove_python_codec(typeoid, typename, typeschema) cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, alias_to): self._data_codecs.set_builtin_type_codec(typeoid, typename, typeschema, typekind, alias_to) cpdef inline Codec get_data_codec(self, uint32_t oid, ServerDataFormat format=PG_FORMAT_ANY): if format == PG_FORMAT_ANY: codec = self._data_codecs.get_codec(oid, PG_FORMAT_BINARY) if codec is None: codec = self._data_codecs.get_codec(oid, PG_FORMAT_TEXT) return codec else: return self._data_codecs.get_codec(oid, format) def __getattr__(self, name): if not name.startswith('_'): try: return self._settings[name] except KeyError: raise AttributeError(name) from None return object.__getattr__(self, name) def __repr__(self): return ''.format(self._settings) asyncpg-0.13.0/asyncpg/protocol/settings.pxd0000664000372000037200000000167213172407302021770 0ustar travistravis00000000000000# 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: cdef: str _encoding object _codec dict _settings bint _is_utf8 DataCodecConfig _data_codecs cdef add_setting(self, str name, str val) cdef inline is_encoding_utf8(self) cpdef inline get_text_codec(self) cpdef inline register_data_types(self, types) cpdef inline add_python_codec( self, typeoid, typename, typeschema, typekind, encoder, decoder, format) cpdef inline remove_python_codec( self, typeoid, typename, typeschema) cpdef inline set_builtin_type_codec( self, typeoid, typename, typeschema, typekind, alias_to) cpdef inline Codec get_data_codec(self, uint32_t oid, ServerDataFormat format=*) asyncpg-0.13.0/asyncpg/protocol/prepared_stmt.pyx0000664000372000037200000002421013172407302023017 0ustar travistravis00000000000000# 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): self.name = name self.query = query self.protocol = protocol 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.refs = 0 self.buffer = FastReadBuffer.new() 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 RuntimeError 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 RuntimeError 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 result = 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(): result.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(): result.add(rdesc[3]) if len(result): return result else: return True def attach(self): self.refs += 1 def detach(self): self.refs -= 1 def mark_closed(self): self.closed = True cdef _encode_bind_msg(self, args): cdef: int idx WriteBuffer writer Codec codec if len(args) > 32767: raise exceptions.InterfaceError( 'the number of query arguments cannot exceed 32767') self._ensure_args_encoder() self._ensure_rows_decoder() 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, 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 from 0 <= idx < 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 from 0 <= idx < self.args_num: arg = args[idx] if arg is None: writer.write_int32(-1) else: codec = (self.args_codecs[idx]) codec.encode(self.settings, writer, arg) if self.have_text_cols: writer.write_int16(self.cols_num) for idx from 0 <= idx < 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 int oid Codec codec list codecs if self.cols_desc is not None: return if self.cols_num == 0: self.cols_desc = record.ApgRecordDesc_New({}, ()) return cols_mapping = collections.OrderedDict() cols_names = [] codecs = [] for i from 0 <= i < self.cols_num: row = self.row_desc[i] col_name = row[0].decode(self.settings._encoding) cols_mapping[col_name] = i cols_names.append(col_name) oid = row[3] codec = self.settings.get_data_codec(oid) if codec is None or not codec.has_decoder(): raise RuntimeError('no decoder for OID {}'.format(oid)) if not codec.is_binary(): self.have_text_cols = True codecs.append(codec) self.cols_desc = record.ApgRecordDesc_New( cols_mapping, tuple(cols_names)) self.rows_codecs = tuple(codecs) cdef _ensure_args_encoder(self): cdef: int 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) if codec is None or not codec.has_encoder(): raise RuntimeError('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 FastReadBuffer rbuf = self.buffer ssize_t bl rbuf.buf = cbuf rbuf.len = buf_len fnum = hton.unpack_int16(rbuf.read(2)) if fnum != self.cols_num: raise RuntimeError( 'number of columns in result ({}) is ' 'different from what was described ({})'.format( fnum, self.cols_num)) if rows_codecs is None or len(rows_codecs) < fnum: if fnum > 0: # It's OK to have no rows_codecs for empty records raise RuntimeError('invalid rows_codecs') dec_row = record.ApgRecord_New(self.cols_desc, fnum) for i in range(fnum): flen = hton.unpack_int32(rbuf.read(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 = rbuf.len if flen > bl: # Check for overflow rbuf._raise_ins_err(flen, bl) rbuf.len = flen codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) val = codec.decode(settings, rbuf) if rbuf.len != 0: raise BufferError( 'unexpected trailing {} bytes in buffer'.format( rbuf.len)) rbuf.len = bl - flen cpython.Py_INCREF(val) record.ApgRecord_SET_ITEM(dec_row, i, val) if rbuf.len != 0: raise BufferError('unexpected trailing {} bytes in buffer'.format( rbuf.len)) return dec_row cdef _decode_parameters_desc(object desc): cdef: ReadBuffer reader int16_t nparams int32_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 int32_t f_table_oid int16_t f_column_num int32_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_cstr() 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 asyncpg-0.13.0/asyncpg/protocol/protocol.c0000664000372000037200002131730613172407445021437 0ustar travistravis00000000000000/* Generated by Cython 0.27.1 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "asyncpg/protocol/debug.h" ], "extra_compile_args": [ "-O2", "-Wall", "-Wsign-compare", "-Wconversion" ], "include_dirs": [ "./asyncpg/protocol" ], "name": "asyncpg.protocol.protocol", "sources": [ "asyncpg/protocol/protocol.pyx", "asyncpg/protocol/record/recordobj.c" ] }, "module_name": "asyncpg.protocol.protocol" } END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_27_1" #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #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_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, 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) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, 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) #define __Pyx_DefaultClassType PyType_Type #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 #if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_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 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) 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, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #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_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #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 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #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(__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_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #ifdef __cplusplus #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) || (defined(__GNUC__) && defined(__attribute__)) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #endif #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 #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #ifndef __PYX_EXTERN_C #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 #include #include "debug.h" #include #include #include "pythread.h" #include "record/recordobj.h" #include "arpa/inet.h" #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 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))) ) #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 const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "asyncpg/protocol/protocol.pyx", "asyncpg/protocol/settings.pyx", "stringsource", "asyncpg/protocol/buffer.pyx", "asyncpg/protocol/codecs/base.pyx", "asyncpg/protocol/codecs/int.pyx", "asyncpg/protocol/codecs/array.pyx", "asyncpg/protocol/coreproto.pyx", "asyncpg/protocol/encodings.pyx", "asyncpg/protocol/codecs/bytea.pyx", "asyncpg/protocol/codecs/text.pyx", "asyncpg/protocol/codecs/bits.pyx", "asyncpg/protocol/codecs/datetime.pyx", "asyncpg/protocol/codecs/float.pyx", "asyncpg/protocol/codecs/geometry.pyx", "asyncpg/protocol/codecs/json.pyx", "asyncpg/protocol/codecs/money.pyx", "asyncpg/protocol/codecs/network.pyx", "asyncpg/protocol/codecs/numeric.pyx", "asyncpg/protocol/codecs/tsearch.pyx", "asyncpg/protocol/codecs/txid.pyx", "asyncpg/protocol/codecs/uuid.pyx", "asyncpg/protocol/codecs/misc.pyx", "asyncpg/protocol/codecs/range.pyx", "asyncpg/protocol/codecs/record.pyx", "asyncpg/protocol/codecs/hstore.pyx", "asyncpg/protocol/coreproto.pxd", "asyncpg/protocol/prepared_stmt.pyx", "asyncpg/protocol/prepared_stmt.pxd", "asyncpg/protocol/protocol.pxd", "type.pxd", "bool.pxd", "complex.pxd", "asyncpg/protocol/pgtypes.pxi", }; /*--- Type declarations ---*/ struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory; struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer; struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer; struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer; 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_CoreProtocol; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close; union __pyx_t_7asyncpg_8protocol_4hton__floatconv; union __pyx_t_7asyncpg_8protocol_4hton__doubleconv; /* "hton.pxd":53 * * * cdef union _floatconv: # <<<<<<<<<<<<<< * uint32_t i * float f */ union __pyx_t_7asyncpg_8protocol_4hton__floatconv { uint32_t i; float f; }; /* "hton.pxd":70 * * * cdef union _doubleconv: # <<<<<<<<<<<<<< * uint64_t i * double f */ union __pyx_t_7asyncpg_8protocol_4hton__doubleconv { uint64_t i; double f; }; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_any_core_codec; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec; /* "asyncpg/protocol/codecs/base.pxd":25 * * * cdef enum CodecType: # <<<<<<<<<<<<<< * CODEC_UNDEFINED = 0 * CODEC_C = 1 */ enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType { __pyx_e_7asyncpg_8protocol_8protocol_CODEC_UNDEFINED = 0, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C = 1, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_PY = 2, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY = 3, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE = 4, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE = 5 }; /* "asyncpg/protocol/codecs/base.pxd":34 * * * 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":40 * * * 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":8 * * * 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":14 * * * 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_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":36 * * * 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 }; /* "asyncpg/protocol/coreproto.pxd":56 * * * 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":61 * * * 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_8protocol_8protocol_WriteBuffer *, PyObject *); /* "asyncpg/protocol/codecs/base.pxd":12 * object obj) * * ctypedef object (*decode_func)(ConnectionSettings settings, # <<<<<<<<<<<<<< * FastReadBuffer buf) * */ typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /* "asyncpg/protocol/codecs/base.pxd":15 * FastReadBuffer 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_8protocol_8protocol_WriteBuffer *, PyObject *); /* "asyncpg/protocol/codecs/base.pxd":20 * object obj) * * ctypedef object (*codec_decode_func)(Codec codec, # <<<<<<<<<<<<<< * ConnectionSettings settings, * FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /* "asyncpg/protocol/settings.pxd":27 * cpdef inline set_builtin_type_codec( * self, typeoid, typename, typeschema, typekind, alias_to) * cpdef inline Codec get_data_codec(self, uint32_t oid, ServerDataFormat format=*) # <<<<<<<<<<<<<< */ struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec { int __pyx_n; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat format; }; /* "asyncpg/protocol/coreproto.pxd":69 * * * 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/codecs/array.pyx":648 * * * 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":18 * * * 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":632 * * * 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":651 * * * 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":672 * * * 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":17 * * * 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_8protocol_8protocol_WriteBuffer *, PyObject *, void const *); /* "asyncpg/protocol/codecs/array.pyx":23 * * * ctypedef object (*decode_func_ex)(ConnectionSettings settings, # <<<<<<<<<<<<<< * FastReadBuffer buf, * const void *arg) */ typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, void const *); /* "asyncpg/protocol/buffer.pxd":8 * * * cdef class Memory: # <<<<<<<<<<<<<< * cdef: * const char *buf */ struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Memory *__pyx_vtab; char const *buf; PyObject *owner; Py_ssize_t length; }; /* "asyncpg/protocol/buffer.pxd":20 * * * cdef class WriteBuffer: # <<<<<<<<<<<<<< * cdef: * # Preallocated small buffer */ struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_vtab; int _smallbuf_inuse; char _smallbuf[0x400]; char *_buf; Py_ssize_t _size; Py_ssize_t _length; int _view_count; int _message_mode; }; /* "asyncpg/protocol/buffer.pxd":65 * * * cdef class ReadBuffer: # <<<<<<<<<<<<<< * cdef: * # A deque of buffers (bytes objects) */ struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_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; int _current_message_len; Py_ssize_t _current_message_len_unread; int _current_message_ready; }; /* "asyncpg/protocol/buffer.pxd":122 * * * cdef class FastReadBuffer: # <<<<<<<<<<<<<< * cdef: * const char* buf */ struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_vtab; char const *buf; Py_ssize_t len; }; /* "asyncpg/protocol/codecs/base.pxd":45 * * * 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; 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 *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":168 * * * cdef class DataCodecConfig: # <<<<<<<<<<<<<< * cdef: * dict _type_codecs_cache */ struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_vtab; PyObject *_type_codecs_cache; PyObject *_local_type_codecs; }; /* "asyncpg/protocol/settings.pxd":8 * * * cdef class ConnectionSettings: # <<<<<<<<<<<<<< * cdef: * str _encoding */ struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_vtab; PyObject *_encoding; PyObject *_codec; PyObject *_settings; int _is_utf8; struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *_data_codecs; }; /* "asyncpg/protocol/coreproto.pxd":72 * * * 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_8protocol_8protocol_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 *con_params; 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 refs; struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *buffer; PyObject *row_desc; PyObject *parameters_desc; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *protocol; 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":25 * * * cdef class BaseProtocol(CoreProtocol): # <<<<<<<<<<<<<< * * cdef: */ struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol { struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol __pyx_base; PyObject *loop; PyObject *address; 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 *timeout_callback; PyObject *completed_callback; PyObject *connection; int is_reading; PyObject *last_query; int writing_paused; int closing; uint64_t queries_count; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *statement; }; /* "asyncpg/protocol/protocol.pyx":149 * self.transport.pause_reading() * * async def prepare(self, stmt_name, query, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare { PyObject_HEAD PyObject *__pyx_v_ex; PyObject *__pyx_v_query; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; 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":170 * return await waiter * * async def bind_execute(self, PreparedStatementState state, args, # <<<<<<<<<<<<<< * str portal_name, int limit, return_extra, * timeout): */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute { PyObject_HEAD PyObject *__pyx_v_args; PyObject *__pyx_v_args_buf; 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":202 * return await waiter * * async def bind_execute_many(self, PreparedStatementState state, args, # <<<<<<<<<<<<<< * str portal_name, timeout): * */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many { PyObject_HEAD PyObject *__pyx_v_arg_bufs; PyObject *__pyx_v_args; PyObject *__pyx_v_data_gen; PyObject *__pyx_v_ex; PyObject *__pyx_v_genexpr; 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":217 * # this generator expression to keep the memory pressure under * # control. * data_gen = (state._encode_bind_msg(b) for b in args) # <<<<<<<<<<<<<< * arg_bufs = iter(data_gen) * */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr { PyObject_HEAD struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *__pyx_outer_scope; PyObject *__pyx_v_b; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "asyncpg/protocol/protocol.pyx":237 * return await waiter * * async def bind(self, PreparedStatementState state, args, # <<<<<<<<<<<<<< * str portal_name, timeout): * */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_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":265 * 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_5_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":294 * 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_6_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":318 * 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_7_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":369 * 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_8_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_8protocol_8protocol_WriteBuffer *__pyx_v_wbuf; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6; PyObject *__pyx_t_7; PyObject *__pyx_t_8; PyObject *__pyx_t_9; PyObject *__pyx_t_10; PyObject *__pyx_t_11; }; /* "asyncpg/protocol/protocol.pyx":485 * 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_9_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":524 * self.transport.abort() * * async def close(self): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close { PyObject_HEAD struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; }; /* "asyncpg/protocol/buffer.pyx":18 * @cython.final * @cython.freelist(_MEMORY_FREELIST_SIZE) * cdef class Memory: # <<<<<<<<<<<<<< * * cdef as_bytes(self): */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Memory { PyObject *(*as_bytes)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *); struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *(*new)(char const *, PyObject *, Py_ssize_t); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Memory *__pyx_vtabptr_7asyncpg_8protocol_8protocol_Memory; static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_6Memory_as_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *); static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_f_7asyncpg_8protocol_8protocol_6Memory_new(char const *, PyObject *, Py_ssize_t); /* "asyncpg/protocol/buffer.pyx":36 * @cython.final * @cython.freelist(_BUFFER_FREELIST_SIZE) * cdef class WriteBuffer: # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_WriteBuffer { PyObject *(*_check_readonly)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *); PyObject *(*len)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *); PyObject *(*_ensure_alloced)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, Py_ssize_t); PyObject *(*_reallocate)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, Py_ssize_t); PyObject *(*start_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, char); PyObject *(*end_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *); PyObject *(*write_buffer)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *); PyObject *(*write_byte)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, char); PyObject *(*write_bytes)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); PyObject *(*write_bytestring)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); PyObject *(*write_str)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *, PyObject *); PyObject *(*write_cstr)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, char const *, Py_ssize_t); PyObject *(*write_int16)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int16_t); PyObject *(*write_int32)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int32_t); PyObject *(*write_int64)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int64_t); PyObject *(*write_float)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, float); PyObject *(*write_double)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, double); struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *(*new_message)(char); struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *(*new)(void); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_vtabptr_7asyncpg_8protocol_8protocol_WriteBuffer; static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_len(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__ensure_alloced(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, Py_ssize_t); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__reallocate(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, Py_ssize_t); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_start_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, char); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, char); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytestring(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, char const *, Py_ssize_t); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int16_t); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int32_t); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int64_t); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_float(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, float); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, double); static struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message(char); static struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new(void); /* "asyncpg/protocol/buffer.pyx":231 * @cython.final * @cython.freelist(_BUFFER_FREELIST_SIZE) * cdef class ReadBuffer: # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ReadBuffer { PyObject *(*feed_data)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, PyObject *); PyObject *(*_ensure_first_buf)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); PyObject *(*_switch_to_next_buf)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); PyObject *(*read_byte)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); char const *(*_try_read_bytes)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t); PyObject *(*_read)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, char *, Py_ssize_t); PyObject *(*read)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t); char const *(*read_bytes)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t); PyObject *(*read_int32)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); PyObject *(*read_int16)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); PyObject *(*read_cstr)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); int32_t (*has_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); int32_t (*has_message_type)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, char); char const *(*try_consume_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t *); struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *(*consume_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); PyObject *(*consume_messages)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, char); PyObject *(*discard_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); PyObject *(*_discard_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); char (*get_message_type)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); int32_t (*get_message_length)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *(*new_message_parser)(PyObject *); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_vtabptr_7asyncpg_8protocol_8protocol_ReadBuffer; static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_feed_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, PyObject *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__switch_to_next_buf(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_byte(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__read(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, char *, Py_ssize_t); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t); static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int16(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static int32_t __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message_type(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, char); static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_try_consume_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t *); static struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_messages(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, char); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_discard_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__discard_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static CYTHON_INLINE char __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *); static struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_new_message_parser(PyObject *); /* "asyncpg/protocol/buffer.pyx":632 * @cython.final * @cython.freelist(_BUFFER_FREELIST_SIZE) * cdef class FastReadBuffer: # <<<<<<<<<<<<<< * * cdef inline const char* read(self, ssize_t n) except NULL: */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_FastReadBuffer { char const *(*read)(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, Py_ssize_t); char const *(*read_all)(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *(*slice_from)(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, Py_ssize_t); PyObject *(*_raise_ins_err)(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, Py_ssize_t, Py_ssize_t); struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *(*new)(void); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_vtabptr_7asyncpg_8protocol_8protocol_FastReadBuffer; static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, Py_ssize_t); static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read_all(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_slice_from(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, Py_ssize_t); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer__raise_ins_err(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, Py_ssize_t, Py_ssize_t); static struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_new(void); /* "asyncpg/protocol/codecs/base.pyx":15 * * @cython.final * cdef class Codec: # <<<<<<<<<<<<<< * * def __cinit__(self, uint32_t oid): */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Codec { PyObject *(*init)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, 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_8protocol_8protocol_WriteBuffer *, PyObject *); PyObject *(*encode_array)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); PyObject *(*encode_array_text)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); PyObject *(*encode_range)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); PyObject *(*encode_composite)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); PyObject *(*encode_in_python)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); PyObject *(*decode_scalar)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); PyObject *(*decode_array)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); PyObject *(*decode_array_text)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); PyObject *(*decode_range)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); PyObject *(*decode_composite)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); PyObject *(*decode_in_python)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); PyObject *(*encode)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); PyObject *(*decode)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); 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_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, 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, 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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); 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_8protocol_8protocol_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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); 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_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, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat); /* "asyncpg/protocol/codecs/base.pyx":359 * * * cdef class DataCodecConfig: # <<<<<<<<<<<<<< * def __init__(self, cache_key): * try: */ 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_obj_7asyncpg_8protocol_8protocol_Codec *(*get_local_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t); }; 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); static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_local_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t); /* "asyncpg/protocol/settings.pyx":9 * * @cython.final * cdef class ConnectionSettings: # <<<<<<<<<<<<<< * * def __cinit__(self, conn_key): */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ConnectionSettings { PyObject *(*add_setting)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *); PyObject *(*is_encoding_utf8)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *); PyObject *(*get_text_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, int __pyx_skip_dispatch); 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 *, int __pyx_skip_dispatch); PyObject *(*remove_python_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); PyObject *(*set_builtin_type_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, 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_is_encoding_utf8(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, int __pyx_skip_dispatch); 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 *, 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_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, 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/coreproto.pyx":11 * * * cdef class CoreProtocol: # <<<<<<<<<<<<<< * * def __init__(self, con_params): */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol { 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 *(*_write)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_write_sync_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); 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_8protocol_8protocol_WriteBuffer *(*_build_bind_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *); PyObject *(*_connect)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_prepare)(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_8protocol_8protocol_WriteBuffer *, int32_t); PyObject *(*_bind_execute)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int32_t); PyObject *(*_bind_execute_many)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *); PyObject *(*_bind)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_sync_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); /* "asyncpg/protocol/prepared_stmt.pyx":12 * * @cython.final * cdef class PreparedStatementState: # <<<<<<<<<<<<<< * * def __cinit__(self, str name, str query, BaseProtocol protocol): */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_PreparedStatementState { PyObject *(*_encode_bind_msg)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *); 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 *); 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":91 * * * cdef class BaseProtocol(CoreProtocol): # <<<<<<<<<<<<<< * def __init__(self, addr, connected_fut, con_params, 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_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 *); /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #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) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #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_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) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* 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); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #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_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) PyErr_SetObject(PyExc_KeyError, args); Py_XDECREF(args); } return NULL; } Py_INCREF(value); return value; } #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #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 /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* 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 /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* 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); /* 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); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* py_dict_clear.proto */ #define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0) /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* 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 /* None.proto */ static CYTHON_INLINE int64_t __Pyx_mod_int64_t(int64_t, int64_t); /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); /* None.proto */ static CYTHON_INLINE long __Pyx_mod_long(long, long); /* None.proto */ static CYTHON_INLINE int64_t __Pyx_div_int64_t(int64_t, int64_t); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* 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); /* 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) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* IterNext.proto */ #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* decode_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_bytes( PyObject* string, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { return __Pyx_decode_c_bytes( PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string), start, stop, encoding, errors, decode_func); } /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* 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)); } /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg); /* CoroutineBase.proto */ typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *); typedef struct { PyObject_HEAD __pyx_coroutine_body_t body; PyObject *closure; PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; int resume_label; char is_running; } __pyx_CoroutineObject; static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static int __Pyx_Coroutine_clear(PyObject *self); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #define __Pyx_Coroutine_SwapException(self) {\ __Pyx_ExceptionSwap(&(self)->exc_type, &(self)->exc_value, &(self)->exc_traceback);\ __Pyx_Coroutine_ResetFrameBackpointer(self);\ } #define __Pyx_Coroutine_ResetAndClearException(self) {\ __Pyx_ExceptionReset((self)->exc_type, (self)->exc_value, (self)->exc_traceback);\ (self)->exc_type = (self)->exc_value = (self)->exc_traceback = NULL;\ } #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_CoroutineObject *self); /* PatchModuleWithCoroutine.proto */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); /* PatchGeneratorABC.proto */ static int __Pyx_patch_abc(void); /* Coroutine.proto */ #define __Pyx_Coroutine_USED static PyTypeObject *__pyx_CoroutineType = 0; static PyTypeObject *__pyx_CoroutineAwaitType = 0; #define __Pyx_Coroutine_CheckExact(obj) (Py_TYPE(obj) == __pyx_CoroutineType) #define __Pyx_CoroutineAwait_CheckExact(obj) (Py_TYPE(obj) == __pyx_CoroutineAwaitType) #define __Pyx_Coroutine_New(body, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_CoroutineType, body, closure, name, qualname, module_name) static int __pyx_Coroutine_init(void); static PyObject *__Pyx__Coroutine_await(PyObject *coroutine); typedef struct { PyObject_HEAD PyObject *coroutine; } __pyx_CoroutineAwaitObject; static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self); static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args); /* GetAwaitIter.proto */ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o); static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o); /* CoroutineYieldFrom.proto */ static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source); /* ReturnWithStopIteration.proto */ #define __Pyx_ReturnWithStopIteration(value)\ if (value == Py_None) PyErr_SetNone(PyExc_StopIteration); else __Pyx__ReturnWithStopIteration(value) static void __Pyx__ReturnWithStopIteration(PyObject* value); /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return __Pyx_PyObject_GetAttrStr(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #else #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* PatchInspect.proto */ static PyObject* __Pyx_patch_inspect(PyObject* module); /* PatchAsyncIO.proto */ static PyObject* __Pyx_patch_asyncio(PyObject* module); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_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 { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); /* CLineInTraceback.proto */ static int __Pyx_CLineForTraceback(int c_line); /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* UnicodeAsUCS4.proto */ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); /* CIntFromPy.proto */ static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int8_t __Pyx_PyInt_As_int8_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); /* ObjectAsUCS4.proto */ #define __Pyx_PyObject_AsPy_UCS4(x)\ (likely(PyUnicode_Check(x)) ? __Pyx_PyUnicode_AsPy_UCS4(x) : __Pyx__PyObject_AsPy_UCS4(x)) static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject*); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(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_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif /* Generator.proto */ #define __Pyx_Generator_USED static PyTypeObject *__pyx_GeneratorType = 0; #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) #define __Pyx_Generator_New(body, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(void); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* VoidPtrExport.proto */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); /* PyIdentifierFromString.proto */ #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif /* ModuleImport.proto */ static PyObject *__Pyx_ImportModule(const char *name); /* TypeImport.proto */ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); 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 CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_is_encoding_utf8(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto*/ static CYTHON_INLINE 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_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_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, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, uint32_t __pyx_v_oid, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_6Memory_as_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_self); /* proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_f_7asyncpg_8protocol_8protocol_6Memory_new(char const *__pyx_v_buf, PyObject *__pyx_v_owner, Py_ssize_t __pyx_v_length); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_len(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__ensure_alloced(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, Py_ssize_t __pyx_v_extra_length); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__reallocate(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, Py_ssize_t __pyx_v_new_size); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_start_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, char __pyx_v_type); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, char __pyx_v_b); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_data); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytestring(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_string); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_string, PyObject *__pyx_v_encoding); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, char const *__pyx_v_data, Py_ssize_t __pyx_v_len); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, int16_t __pyx_v_i); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, int32_t __pyx_v_i); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, int64_t __pyx_v_i); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_float(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, float __pyx_v_f); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, double __pyx_v_d); /* proto*/ static struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message(char __pyx_v_type); /* proto*/ static struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new(void); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_feed_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, PyObject *__pyx_v_data); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__switch_to_next_buf(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_nbytes); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__read(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, char *__pyx_v_buf, Py_ssize_t __pyx_v_nbytes); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_nbytes); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_byte(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_n); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int16(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static int32_t __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message_type(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_try_consume_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, Py_ssize_t *__pyx_v_len); /* proto*/ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_messages(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_discard_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__discard_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE char __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto*/ static struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_new_message_parser(PyObject *__pyx_v_data); /* proto*/ static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_n); /* proto*/ static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read_all(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_slice_from(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_source, Py_ssize_t __pyx_v_len); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer__raise_ins_err(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_n, CYTHON_UNUSED Py_ssize_t __pyx_v_len); /* proto*/ static struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_new(void); /* 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, 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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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_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, 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); /* proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_local_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_buf); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_sync_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* 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__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_8protocol_8protocol_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_8protocol_8protocol_WriteBuffer *__pyx_v_bind_data); /* 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__prepare(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_8protocol_8protocol_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_8protocol_8protocol_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit); /* proto*/ static PyObject *__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); /* 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_8protocol_8protocol_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__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__encode_bind_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_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 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*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'asyncpg.protocol.debug' */ /* Module declarations from 'cython' */ /* Module declarations from 'cpython.version' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'cpython.exc' */ /* Module declarations from 'cpython.module' */ /* Module declarations from 'cpython.mem' */ /* Module declarations from 'cpython.tuple' */ /* Module declarations from 'cpython.list' */ /* Module declarations from 'cpython.sequence' */ /* Module declarations from 'cpython.mapping' */ /* Module declarations from 'cpython.iterator' */ /* Module declarations from 'cpython.number' */ /* Module declarations from 'cpython.int' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.bool' */ static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; /* Module declarations from 'cpython.long' */ /* Module declarations from 'cpython.float' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.complex' */ static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; /* Module declarations from 'cpython.string' */ /* Module declarations from 'cpython.unicode' */ /* Module declarations from 'cpython.dict' */ /* Module declarations from 'cpython.instance' */ /* Module declarations from 'cpython.function' */ /* Module declarations from 'cpython.method' */ /* Module declarations from 'cpython.weakref' */ /* Module declarations from 'cpython.getargs' */ /* Module declarations from 'cpython.pythread' */ /* Module declarations from 'cpython.pystate' */ /* Module declarations from 'cpython.cobject' */ /* Module declarations from 'cpython.oldbuffer' */ /* Module declarations from 'cpython.set' */ /* Module declarations from 'cpython.buffer' */ /* Module declarations from 'cpython.bytes' */ /* Module declarations from 'cpython.pycapsule' */ /* Module declarations from 'cpython' */ /* Module declarations from 'asyncpg.protocol' */ /* Module declarations from 'asyncpg.protocol.record' */ /* Module declarations from 'asyncpg.protocol.python' */ /* Module declarations from 'asyncpg.protocol.hton' */ static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_4hton_pack_int16(char *, int16_t); /*proto*/ static CYTHON_INLINE int16_t __pyx_f_7asyncpg_8protocol_4hton_unpack_int16(char const *); /*proto*/ static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_4hton_pack_int32(char *, int32_t); /*proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(char const *); /*proto*/ static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_4hton_pack_int64(char *, int64_t); /*proto*/ static CYTHON_INLINE int64_t __pyx_f_7asyncpg_8protocol_4hton_unpack_int64(char const *); /*proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_4hton_pack_float(char *, float); /*proto*/ static CYTHON_INLINE float __pyx_f_7asyncpg_8protocol_4hton_unpack_float(char const *); /*proto*/ static CYTHON_INLINE int64_t __pyx_f_7asyncpg_8protocol_4hton_pack_double(char *, double); /*proto*/ static CYTHON_INLINE double __pyx_f_7asyncpg_8protocol_4hton_unpack_double(char const *); /*proto*/ /* Module declarations from 'libc' */ /* Module declarations from 'libc.math' */ /* Module declarations from 'asyncpg.protocol.protocol' */ static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_Memory = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_WriteBuffer = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_ReadBuffer = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_FastReadBuffer = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_Codec = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement = 0; static PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close = 0; static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES = 0; static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP = 0; static void *__pyx_v_7asyncpg_8protocol_8protocol_binary_codec_map[((0x1000 + 1) * 2)]; static void *__pyx_v_7asyncpg_8protocol_8protocol_text_codec_map[((0x1000 + 1) * 2)]; static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_TYPE_CODECS_CACHE = 0; static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS = 0; static int32_t __pyx_v_7asyncpg_8protocol_8protocol_pg_epoch_datetime_ts; static int32_t __pyx_v_7asyncpg_8protocol_8protocol_pg_epoch_datetime_utc_ts; static int32_t __pyx_v_7asyncpg_8protocol_8protocol_pg_date_offset_ord; static int64_t __pyx_v_7asyncpg_8protocol_8protocol_pg_time64_infinity; static int64_t __pyx_v_7asyncpg_8protocol_8protocol_pg_time64_negative_infinity; static int32_t __pyx_v_7asyncpg_8protocol_8protocol_pg_date_infinity; static int32_t __pyx_v_7asyncpg_8protocol_8protocol_pg_date_negative_infinity; static int32_t __pyx_v_7asyncpg_8protocol_8protocol_infinity_datetime_ord; static int64_t __pyx_v_7asyncpg_8protocol_8protocol_infinity_datetime_ts; static int32_t __pyx_v_7asyncpg_8protocol_8protocol_negative_infinity_datetime_ord; static int64_t __pyx_v_7asyncpg_8protocol_8protocol_negative_infinity_datetime_ts; static int32_t __pyx_v_7asyncpg_8protocol_8protocol_infinity_date_ord; static int32_t __pyx_v_7asyncpg_8protocol_8protocol_negative_infinity_date_ord; static Py_UCS4 *__pyx_v_7asyncpg_8protocol_8protocol_APG_NULL; static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE = 0; 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_8protocol_8protocol_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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, void const *); /*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 struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_any_core_codec(uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_any_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_bytea_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bytea_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bytea_codecs(void); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_as_pg_string_and_size(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, char **, Py_ssize_t *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_decode_pg_string(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, char const *, Py_ssize_t); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_text_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bits_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bits_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bits_codecs(void); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__encode_time(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int64_t, int32_t); /*proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_8protocol__decode_time(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, int64_t *, uint32_t *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_date_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_date_encode_tuple(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_date_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_date_decode_tuple(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamp_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamp_encode_tuple(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamp_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamp_decode_tuple(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamptz_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamptz_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_time_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_time_encode_tuple(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_time_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_time_decode_tuple(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timetz_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timetz_encode_tuple(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timetz_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timetz_decode_tuple(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_interval_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_interval_encode_tuple(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_interval_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_interval_decode_tuple(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_datetime_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_float4_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_float4_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_float8_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_float8_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_float_codecs(void); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__encode_points(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__decode_points(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_box_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_box_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_line_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_line_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_lseg_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_lseg_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_point_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_point_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_path_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_path_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_poly_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_poly_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_circle_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_circle_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_geometry_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bool_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bool_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int2_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int2_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int4_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int4_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int8_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int8_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_int_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_jsonb_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_jsonb_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_json_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_monetary_codecs(void); /*proto*/ static CYTHON_INLINE uint8_t __pyx_f_7asyncpg_8protocol_8protocol__ip_max_prefix_len(int32_t); /*proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_8protocol__ip_addr_len(int32_t); /*proto*/ static CYTHON_INLINE int8_t __pyx_f_7asyncpg_8protocol_8protocol__ver_to_family(int32_t); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__net_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int8_t, uint32_t, int8_t, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_net_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_cidr_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_inet_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_network_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_numeric_encode_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_numeric_decode_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_numeric_encode_binary(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_numeric_decode_binary(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static CYTHON_INLINE char *__pyx_f_7asyncpg_8protocol_8protocol__unpack_digit_stripping_lzeros(char *, int64_t); /*proto*/ static CYTHON_INLINE char *__pyx_f_7asyncpg_8protocol_8protocol__unpack_digit(char *, int64_t); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_numeric_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_tsearch_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_txid_snapshot_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_txid_snapshot_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_txid_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uuid_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uuid_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_uuid_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_void_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_void_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_pseudo_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_container(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_sub_array(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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, __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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *, int32_t, int32_t *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_textarray_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, __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_int4_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int4_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arraytext_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arraytext_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anyarray_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*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_8protocol_8protocol_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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_range_codecs(void); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_record_encode_frame(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int32_t); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_record_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_hstore_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_hstore_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_hstore_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_Memory__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_FastReadBuffer__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, 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*/ #define __Pyx_MODULE_NAME "asyncpg.protocol.protocol" int __pyx_module_is_main_asyncpg__protocol__protocol = 0; /* Implementation of 'asyncpg.protocol.protocol' */ static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_print; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_OverflowError; static PyObject *__pyx_builtin_reversed; static PyObject *__pyx_builtin_memoryview; static PyObject *__pyx_builtin_StopIteration; static PyObject *__pyx_builtin_TimeoutError; static const char __pyx_k_F[] = "F"; static const char __pyx_k_N[] = "N"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_e[] = "e"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_NA[] = "NA"; static const char __pyx_k__3[] = "_"; static const char __pyx_k_et[] = "et"; static const char __pyx_k_ns[] = "ns"; static const char __pyx_k_tb[] = "tb"; static const char __pyx_k_Box[] = "Box"; static const char __pyx_k_Dec[] = "_Dec"; static const char __pyx_k_NaN[] = "NaN"; static const char __pyx_k__22[] = ""; static const char __pyx_k__23[] = "\000"; static const char __pyx_k__36[] = "{}[]"; static const char __pyx_k__64[] = "\"\""; static const char __pyx_k__87[] = "'{}'"; static const char __pyx_k_abc[] = "abc"; static const char __pyx_k_add[] = "__add__"; static const char __pyx_k_alt[] = "alt"; static const char __pyx_k_any[] = "any"; static const char __pyx_k_bit[] = "bit"; static const char __pyx_k_box[] = "box"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_cid[] = "cid"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_len[] = "__len__"; static const char __pyx_k_md5[] = "md5"; static const char __pyx_k_new[] = "new"; static const char __pyx_k_oid[] = "oid"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_rec[] = "rec"; static const char __pyx_k_set[] = "set"; static const char __pyx_k_tid[] = "tid"; static const char __pyx_k_utc[] = "utc"; static const char __pyx_k_was[] = "was"; static const char __pyx_k_win[] = "win"; static const char __pyx_k_xid[] = "xid"; static const char __pyx_k_xml[] = "xml"; static const char __pyx_k_Line[] = "Line"; static const char __pyx_k_NULL[] = "NULL"; static const char __pyx_k_Path[] = "Path"; static const char __pyx_k_Type[] = "Type"; static const char __pyx_k_UUID[] = "_UUID"; static const char __pyx_k_addr[] = "addr"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "_base"; static const char __pyx_k_bind[] = "bind"; static const char __pyx_k_bool[] = "bool"; static const char __pyx_k_char[] = "char"; static const char __pyx_k_cidr[] = "cidr"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_date[] = "date"; static const char __pyx_k_days[] = "days"; static const char __pyx_k_desc[] = "desc"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_done[] = "done"; static const char __pyx_k_elem[] = "elem"; static const char __pyx_k_exit[] = "__exit__"; static const char __pyx_k_find[] = "find"; static const char __pyx_k_hint[] = "hint"; static const char __pyx_k_hour[] = "hour"; static const char __pyx_k_inet[] = "inet"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_int2[] = "int2"; static const char __pyx_k_int4[] = "int4"; static const char __pyx_k_int8[] = "int8"; static const char __pyx_k_json[] = "json"; static const char __pyx_k_kind[] = "kind"; static const char __pyx_k_line[] = "line"; static const char __pyx_k_loop[] = "loop"; static const char __pyx_k_lseg[] = "lseg"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_send[] = "send"; static const char __pyx_k_sign[] = "sign"; static const char __pyx_k_sink[] = "sink"; static const char __pyx_k_sjis[] = "sjis"; static const char __pyx_k_smgr[] = "smgr"; static const char __pyx_k_tcvn[] = "tcvn"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_text[] = "text"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_user[] = "user"; static const char __pyx_k_uuid[] = "uuid"; static const char __pyx_k_void[] = "void"; static const char __pyx_k_wait[] = "wait"; static const char __pyx_k_were[] = "were"; static const char __pyx_k_Event[] = "Event"; static const char __pyx_k_Point[] = "Point"; static const char __pyx_k_Range[] = "Range"; static const char __pyx_k_Timer[] = "Timer"; static const char __pyx_k_abort[] = "abort"; static const char __pyx_k_aiter[] = "__aiter__"; static const char __pyx_k_anext[] = "__anext__"; static const char __pyx_k_array[] = "array"; static const char __pyx_k_ascii[] = "ascii"; static const char __pyx_k_await[] = "__await__"; static const char __pyx_k_bytea[] = "bytea"; static const char __pyx_k_bytes[] = "bytes"; static const char __pyx_k_cause[] = "__cause__"; static const char __pyx_k_clear[] = "clear"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_cp866[] = "cp866"; static const char __pyx_k_cp874[] = "cp874"; static const char __pyx_k_cp932[] = "cp932"; static const char __pyx_k_cp936[] = "cp936"; static const char __pyx_k_cp949[] = "cp949"; static const char __pyx_k_cp950[] = "cp950"; static const char __pyx_k_deque[] = "deque"; static const char __pyx_k_elems[] = "elems"; static const char __pyx_k_empty[] = "empty"; static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_euccn[] = "euccn"; static const char __pyx_k_eucjp[] = "eucjp"; static const char __pyx_k_euckr[] = "euckr"; static const char __pyx_k_ipnet[] = "_ipnet"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_jsonb[] = "jsonb"; static const char __pyx_k_koi8r[] = "koi8r"; static const char __pyx_k_koi8u[] = "koi8u"; static const char __pyx_k_limit[] = "limit"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_money[] = "money"; static const char __pyx_k_new_2[] = "__new__"; static const char __pyx_k_oid_2[] = "oid[]"; static const char __pyx_k_point[] = "point"; static const char __pyx_k_print[] = "print"; static const char __pyx_k_query[] = "query"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_throw[] = "throw"; static const char __pyx_k_tuple[] = "tuple"; static const char __pyx_k_types[] = "types"; static const char __pyx_k_upper[] = "upper"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_vscii[] = "vscii"; static const char __pyx_k_write[] = "write"; static const char __pyx_k_Circle[] = "Circle"; static const char __pyx_k_Future[] = "Future"; static const char __pyx_k_NULL_2[] = "\"NULL\""; static const char __pyx_k_PGCOPY[] = "PGCOPY\n\377\r\n\000"; static const char __pyx_k_Record[] = "Record"; static const char __pyx_k_UUID_2[] = "UUID"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_binary[] = "binary"; static const char __pyx_k_bpchar[] = "bpchar"; static const char __pyx_k_budget[] = "budget"; static const char __pyx_k_cancel[] = "cancel"; static const char __pyx_k_circle[] = "circle"; static const char __pyx_k_codecs[] = "codecs"; static const char __pyx_k_compat[] = "compat"; static const char __pyx_k_config[] = "_config"; static const char __pyx_k_cp1250[] = "cp1250"; static const char __pyx_k_cp1251[] = "cp1251"; static const char __pyx_k_cp1252[] = "cp1252"; static const char __pyx_k_cp1253[] = "cp1253"; static const char __pyx_k_cp1254[] = "cp1254"; static const char __pyx_k_cp1255[] = "cp1255"; static const char __pyx_k_cp1256[] = "cp1256"; static const char __pyx_k_cp1257[] = "cp1257"; static const char __pyx_k_cp1258[] = "cp1258"; static const char __pyx_k_cp1521[] = "cp1521"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_digits[] = "digits"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_euc_cn[] = "euc_cn"; static const char __pyx_k_euc_jp[] = "euc_jp"; static const char __pyx_k_euc_kr[] = "euc_kr"; static const char __pyx_k_family[] = "family"; static const char __pyx_k_float4[] = "float4"; static const char __pyx_k_float8[] = "float8"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_ipaddr[] = "_ipaddr"; static const char __pyx_k_koi8_r[] = "koi8_r"; static const char __pyx_k_koi8_u[] = "koi8_u"; static const char __pyx_k_lookup[] = "lookup"; static const char __pyx_k_loop_2[] = "_loop"; static const char __pyx_k_minute[] = "minute"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_opaque[] = "opaque"; static const char __pyx_k_packed[] = "packed"; static const char __pyx_k_pg_lsn[] = "pg_lsn"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reader[] = "reader"; static const char __pyx_k_record[] = "record"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_scalar[] = "scalar"; static const char __pyx_k_schema[] = "schema"; static const char __pyx_k_second[] = "second"; static const char __pyx_k_socket[] = "socket"; static const char __pyx_k_text_2[] = "text[]"; static const char __pyx_k_timetz[] = "timetz"; static const char __pyx_k_tzinfo[] = "tzinfo"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_varbit[] = "varbit"; static const char __pyx_k_win866[] = "win866"; static const char __pyx_k_win874[] = "win874"; static const char __pyx_k_win932[] = "win932"; static const char __pyx_k_win936[] = "win936"; static const char __pyx_k_win949[] = "win949"; static const char __pyx_k_win950[] = "win950"; static const char __pyx_k_AF_UNIX[] = "AF_UNIX"; static const char __pyx_k_Decimal[] = "Decimal"; static const char __pyx_k_MAXYEAR[] = "MAXYEAR"; static const char __pyx_k_MINYEAR[] = "MINYEAR"; static const char __pyx_k_Polygon[] = "Polygon"; static const char __pyx_k_TYPEMAP[] = "TYPEMAP"; static const char __pyx_k_abstime[] = "abstime"; static const char __pyx_k_aclitem[] = "aclitem"; static const char __pyx_k_anyenum[] = "anyenum"; static const char __pyx_k_apg_exc[] = "apg_exc"; static const char __pyx_k_asyncio[] = "asyncio"; static const char __pyx_k_asyncpg[] = "asyncpg"; static const char __pyx_k_copy_in[] = "copy_in"; static const char __pyx_k_cstring[] = "cstring"; static const char __pyx_k_decimal[] = "decimal"; static const char __pyx_k_decoder[] = "decoder"; static const char __pyx_k_encoder[] = "encoder"; static const char __pyx_k_execute[] = "execute"; static const char __pyx_k_genexpr[] = "genexpr"; static const char __pyx_k_getattr[] = "__getattr__"; static const char __pyx_k_hashlib[] = "hashlib"; static const char __pyx_k_inspect[] = "inspect"; static const char __pyx_k_isempty[] = "isempty"; static const char __pyx_k_macaddr[] = "macaddr"; static const char __pyx_k_mapping[] = "mapping"; static const char __pyx_k_minutes[] = "minutes"; static const char __pyx_k_numeric[] = "numeric"; static const char __pyx_k_polygon[] = "polygon"; static const char __pyx_k_popleft[] = "popleft"; static const char __pyx_k_prepare[] = "prepare"; static const char __pyx_k_records[] = "records"; static const char __pyx_k_regoper[] = "regoper"; static const char __pyx_k_regproc[] = "regproc"; static const char __pyx_k_regrole[] = "regrole"; static const char __pyx_k_regtype[] = "regtype"; static const char __pyx_k_release[] = "release"; static const char __pyx_k_reltime[] = "reltime"; static const char __pyx_k_replace[] = "replace"; static const char __pyx_k_seconds[] = "seconds"; static const char __pyx_k_started[] = "_started"; static const char __pyx_k_timeout[] = "timeout"; static const char __pyx_k_trigger[] = "trigger"; static const char __pyx_k_tsquery[] = "tsquery"; static const char __pyx_k_typeoid[] = "typeoid"; static const char __pyx_k_unicode[] = "unicode"; static const char __pyx_k_unknown[] = "unknown"; static const char __pyx_k_utf_8_2[] = "utf_8"; static const char __pyx_k_varchar[] = "varchar"; static const char __pyx_k_version[] = "version"; static const char __pyx_k_win1250[] = "win1250"; static const char __pyx_k_win1251[] = "win1251"; static const char __pyx_k_win1252[] = "win1252"; static const char __pyx_k_win1253[] = "win1253"; static const char __pyx_k_win1254[] = "win1254"; static const char __pyx_k_win1255[] = "win1255"; static const char __pyx_k_win1256[] = "win1256"; static const char __pyx_k_win1257[] = "win1257"; static const char __pyx_k_win1258[] = "win1258"; static const char __pyx_k_xformat[] = "xformat"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_Protocol[] = "Protocol"; static const char __pyx_k_alias_to[] = "alias_to"; static const char __pyx_k_anyarray[] = "anyarray"; static const char __pyx_k_anyrange[] = "anyrange"; static const char __pyx_k_as_tuple[] = "as_tuple"; static const char __pyx_k_auth_msg[] = "auth_msg"; static const char __pyx_k_basetype[] = "basetype"; static const char __pyx_k_budget_2[] = "_budget"; static const char __pyx_k_builtins[] = "builtins"; static const char __pyx_k_conn_key[] = "conn_key"; static const char __pyx_k_copy_out[] = "copy_out"; static const char __pyx_k_database[] = "database"; static const char __pyx_k_datetime[] = "datetime"; static const char __pyx_k_elemtype[] = "elemtype"; static const char __pyx_k_exponent[] = "exponent"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_internal[] = "internal"; static const char __pyx_k_interval[] = "interval"; static const char __pyx_k_macaddr8[] = "macaddr8"; static const char __pyx_k_on_error[] = "_on_error"; static const char __pyx_k_password[] = "password"; static const char __pyx_k_protocol[] = "protocol"; static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_regclass[] = "regclass"; static const char __pyx_k_reversed[] = "reversed"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_supernet[] = "supernet"; static const char __pyx_k_tcvn5712[] = "tcvn5712"; static const char __pyx_k_timezone[] = "timezone"; static const char __pyx_k_tsvector[] = "tsvector"; static const char __pyx_k_typekind[] = "typekind"; static const char __pyx_k_typename[] = "typename"; static const char __pyx_k_wait_for[] = "wait_for"; static const char __pyx_k_Attribute[] = "Attribute"; static const char __pyx_k_BitString[] = "BitString"; static const char __pyx_k_Container[] = "Container"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_add_types[] = "add_types"; static const char __pyx_k_apg_types[] = "apg_types"; static const char __pyx_k_attrnames[] = "attrnames"; static const char __pyx_k_cache_key[] = "cache_key"; static const char __pyx_k_cancelled[] = "cancelled"; static const char __pyx_k_composite[] = "composite"; static const char __pyx_k_copy_stmt[] = "copy_stmt"; static const char __pyx_k_elemdelim[] = "elemdelim"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_frombytes[] = "frombytes"; static const char __pyx_k_gtsvector[] = "gtsvector"; static const char __pyx_k_hexdigest[] = "hexdigest"; static const char __pyx_k_ipaddress[] = "ipaddress"; static const char __pyx_k_is_closed[] = "is_closed"; static const char __pyx_k_lower_inc[] = "lower_inc"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_monotonic[] = "monotonic"; static const char __pyx_k_prefixlen[] = "prefixlen"; static const char __pyx_k_prepare_2[] = "__prepare__"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_refcursor[] = "refcursor"; static const char __pyx_k_regconfig[] = "regconfig"; static const char __pyx_k_shift_jis[] = "shift_jis"; static const char __pyx_k_sql_ascii[] = "sql_ascii"; static const char __pyx_k_stmt_name[] = "stmt_name"; static const char __pyx_k_timedelta[] = "timedelta"; static const char __pyx_k_timestamp[] = "timestamp"; static const char __pyx_k_tinterval[] = "tinterval"; static const char __pyx_k_toordinal[] = "toordinal"; static const char __pyx_k_upper_inc[] = "upper_inc"; static const char __pyx_k_utcoffset[] = "utcoffset"; static const char __pyx_k_NO_TIMEOUT[] = "NO_TIMEOUT"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_anyelement[] = "anyelement"; static const char __pyx_k_astimezone[] = "astimezone"; static const char __pyx_k_call_later[] = "call_later"; static const char __pyx_k_con_params[] = "con_params"; static const char __pyx_k_exceptions[] = "exceptions"; static const char __pyx_k_has_bin_io[] = "has_bin_io"; static const char __pyx_k_ip_address[] = "ip_address"; static const char __pyx_k_ip_network[] = "ip_network"; static const char __pyx_k_memoryview[] = "memoryview"; static const char __pyx_k_new_prefix[] = "new_prefix"; static const char __pyx_k_on_timeout[] = "_on_timeout"; static const char __pyx_k_pg_catalog[] = "pg_catalog"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_set_result[] = "set_result"; static const char __pyx_k_setsockopt[] = "setsockopt"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_typeschema[] = "typeschema"; static const char __pyx_k_windows866[] = "windows866"; static const char __pyx_k_windows874[] = "windows874"; static const char __pyx_k_windows932[] = "windows932"; static const char __pyx_k_windows936[] = "windows936"; static const char __pyx_k_windows949[] = "windows949"; static const char __pyx_k_windows950[] = "windows950"; static const char __pyx_k_ARRAY_TYPES[] = "ARRAY_TYPES"; static const char __pyx_k_BufferError[] = "BufferError"; static const char __pyx_k_IPPROTO_TCP[] = "IPPROTO_TCP"; static const char __pyx_k_LineSegment[] = "LineSegment"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_OrderedDict[] = "OrderedDict"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_TCP_NODELAY[] = "TCP_NODELAY"; static const char __pyx_k_anynonarray[] = "anynonarray"; static const char __pyx_k_attrtypoids[] = "attrtypoids"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_fdw_handler[] = "fdw_handler"; static const char __pyx_k_fromordinal[] = "fromordinal"; static const char __pyx_k_get_timeout[] = "_get_timeout"; static const char __pyx_k_hashlib_md5[] = "hashlib_md5"; static const char __pyx_k_microsecond[] = "microsecond"; static const char __pyx_k_portal_name[] = "portal_name"; static const char __pyx_k_record_stmt[] = "record_stmt"; static const char __pyx_k_regoperator[] = "regoperator"; static const char __pyx_k_timestamptz[] = "timestamptz"; static const char __pyx_k_tsm_handler[] = "tsm_handler"; static const char __pyx_k_windows1250[] = "windows1250"; static const char __pyx_k_windows1251[] = "windows1251"; static const char __pyx_k_windows1252[] = "windows1252"; static const char __pyx_k_windows1253[] = "windows1253"; static const char __pyx_k_windows1254[] = "windows1254"; static const char __pyx_k_windows1255[] = "windows1255"; static const char __pyx_k_windows1256[] = "windows1256"; static const char __pyx_k_windows1257[] = "windows1257"; static const char __pyx_k_windows1258[] = "windows1258"; static const char __pyx_k_ContainerABC[] = "ContainerABC"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_TimeoutError[] = "TimeoutError"; static const char __pyx_k_Timer___exit[] = "Timer.__exit__"; static const char __pyx_k_Timer___init[] = "Timer.__init__"; static const char __pyx_k_apg_exc_base[] = "apg_exc_base"; static const char __pyx_k_bind_execute[] = "bind_execute"; static const char __pyx_k_euc_jis_2004[] = "euc_jis_2004"; static const char __pyx_k_microseconds[] = "microseconds"; static const char __pyx_k_pg_ndistinct[] = "pg_ndistinct"; static const char __pyx_k_pg_node_tree[] = "pg_node_tree"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_regnamespace[] = "regnamespace"; static const char __pyx_k_regprocedure[] = "regprocedure"; static const char __pyx_k_return_extra[] = "return_extra"; static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_OverflowError[] = "OverflowError"; static const char __pyx_k_PostgresError[] = "PostgresError"; static const char __pyx_k_StopIteration[] = "StopIteration"; static const char __pyx_k_Timer___enter[] = "Timer.__enter__"; static const char __pyx_k_asyncio_tasks[] = "asyncio.tasks"; static const char __pyx_k_asyncpg_types[] = "asyncpg.types"; static const char __pyx_k_connected_fut[] = "connected_fut"; static const char __pyx_k_create_future[] = "create_future"; static const char __pyx_k_create_record[] = "_create_record"; static const char __pyx_k_event_trigger[] = "event_trigger"; static const char __pyx_k_infinity_date[] = "infinity_date"; static const char __pyx_k_not_connected[] = "not connected"; static const char __pyx_k_pause_reading[] = "pause_reading"; static const char __pyx_k_pg_epoch_date[] = "pg_epoch_date"; static const char __pyx_k_range_subtype[] = "range_subtype"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_regdictionary[] = "regdictionary"; static const char __pyx_k_set_exception[] = "set_exception"; static const char __pyx_k_txid_snapshot[] = "txid_snapshot"; static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_InterfaceError[] = "InterfaceError"; static const char __pyx_k_get_extra_info[] = "get_extra_info"; static const char __pyx_k_pg_ddl_command[] = "pg_ddl_command"; static const char __pyx_k_request_cancel[] = "_request_cancel"; static const char __pyx_k_resume_reading[] = "resume_reading"; static const char __pyx_k_shift_jis_2004[] = "shift_jis_2004"; static const char __pyx_k_buffer_overread[] = "buffer overread"; static const char __pyx_k_client_encoding[] = "client_encoding"; static const char __pyx_k_close_statement[] = "close_statement"; static const char __pyx_k_collections_abc[] = "collections.abc"; static const char __pyx_k_command_timeout[] = "command_timeout"; static const char __pyx_k_elem_has_bin_io[] = "elem_has_bin_io"; static const char __pyx_k_network_address[] = "network_address"; static const char __pyx_k_pg_dependencies[] = "pg_dependencies"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_server_settings[] = "server_settings"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_string_too_long[] = "string too long"; static const char __pyx_k_writing_allowed[] = "writing_allowed"; static const char __pyx_k_AUTH_METHOD_NAME[] = "AUTH_METHOD_NAME"; static const char __pyx_k_add_python_codec[] = "add_python_codec"; static const char __pyx_k_clear_type_cache[] = "clear_type_cache"; static const char __pyx_k_expected_str_got[] = "expected str, got {}"; static const char __pyx_k_index_am_handler[] = "index_am_handler"; static const char __pyx_k_language_handler[] = "language_handler"; static const char __pyx_k_BaseProtocol_bind[] = "BaseProtocol.bind"; static const char __pyx_k_add_done_callback[] = "add_done_callback"; static const char __pyx_k_already_connected[] = "already connected"; static const char __pyx_k_bind_execute_many[] = "bind_execute_many"; static const char __pyx_k_date_from_ordinal[] = "date_from_ordinal"; static const char __pyx_k_infinity_datetime[] = "infinity_datetime"; static const char __pyx_k_pg_contrib_hstore[] = "pg_contrib.hstore"; static const char __pyx_k_pg_epoch_datetime[] = "pg_epoch_datetime"; static const char __pyx_k_BaseProtocol_close[] = "BaseProtocol.close"; static const char __pyx_k_BaseProtocol_query[] = "BaseProtocol.query"; static const char __pyx_k_StopAsyncIteration[] = "StopAsyncIteration"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_asyncpg_exceptions[] = "asyncpg.exceptions"; static const char __pyx_k_bit_value_too_long[] = "bit value too long"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_empty_first_buffer[] = "empty first buffer"; static const char __pyx_k_no_decoder_for_OID[] = "no decoder for OID {}"; static const char __pyx_k_no_encoder_for_OID[] = "no encoder for OID {}"; static const char __pyx_k_InternalClientError[] = "InternalClientError"; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_invalid_data_format[] = "invalid data format: {}"; static const char __pyx_k_invalid_rows_codecs[] = "invalid rows_codecs"; static const char __pyx_k_on_waiter_completed[] = "_on_waiter_completed"; static const char __pyx_k_path_value_too_long[] = "path value too long"; static const char __pyx_k_process_log_message[] = "_process_log_message"; static const char __pyx_k_pyx_unpickle_Memory[] = "__pyx_unpickle_Memory"; static const char __pyx_k_remove_python_codec[] = "remove_python_codec"; static const char __pyx_k_BaseProtocol_copy_in[] = "BaseProtocol.copy_in"; static const char __pyx_k_BaseProtocol_execute[] = "BaseProtocol.execute"; static const char __pyx_k_BaseProtocol_prepare[] = "BaseProtocol.prepare"; static const char __pyx_k_ConnectionSettings_r[] = ""; static const char __pyx_k_get_remaining_budget[] = "get_remaining_budget"; static const char __pyx_k_process_notification[] = "_process_notification"; static const char __pyx_k_text_binary_or_tuple[] = "'text', 'binary' or 'tuple'"; static const char __pyx_k_unknown_alias_target[] = "unknown alias target: {}"; static const char __pyx_k_BaseProtocol_copy_out[] = "BaseProtocol.copy_out"; static const char __pyx_k_invalid_array_element[] = "invalid array element: {}"; static const char __pyx_k_no_message_to_consume[] = "no message to consume"; static const char __pyx_k_no_message_to_discard[] = "no message to discard"; static const char __pyx_k_non_homogeneous_array[] = "non-homogeneous array"; static const char __pyx_k_pg_epoch_datetime_utc[] = "pg_epoch_datetime_utc"; static const char __pyx_k_unexpected_codec_type[] = "unexpected codec type: {}"; static const char __pyx_k_cancel_current_command[] = "_cancel_current_command"; static const char __pyx_k_create_future_fallback[] = "_create_future_fallback"; static const char __pyx_k_declare_fallback_codec[] = "declare_fallback_codec"; static const char __pyx_k_negative_infinity_date[] = "negative_infinity_date"; static const char __pyx_k_polygon_value_too_long[] = "polygon value too long"; static const char __pyx_k_set_builtin_type_codec[] = "set_builtin_type_codec"; static const char __pyx_k_unexpected_data_format[] = "unexpected data format: {}"; static const char __pyx_k_unexpected_ndims_value[] = "unexpected ndims value: {}"; static const char __pyx_k_Codec_oid_elem_oid_core[] = ""; static const char __pyx_k_unexpected_JSONB_format[] = "unexpected JSONB format: {}"; static const char __pyx_k_on_result_waiter_is_None[] = "_on_result: waiter is None"; static const char __pyx_k_on_result_waiter_is_done[] = "_on_result: waiter is done"; static const char __pyx_k_set_builtin_type_codec_2[] = "_set_builtin_type_codec"; static const char __pyx_k_unexpected_end_of_string[] = "unexpected end of string"; static const char __pyx_k_BaseProtocol_bind_execute[] = "BaseProtocol.bind_execute"; static const char __pyx_k_asyncpg_protocol_protocol[] = "asyncpg.protocol.protocol"; static const char __pyx_k_hstore_value_is_too_large[] = "hstore value is too large"; static const char __pyx_k_malformed_array_literal_r[] = "malformed array literal {!r}: {}"; static const char __pyx_k_pyx_unpickle_BaseProtocol[] = "__pyx_unpickle_BaseProtocol"; static const char __pyx_k_pyx_unpickle_CoreProtocol[] = "__pyx_unpickle_CoreProtocol"; static const char __pyx_k_read_cstr_buffer_overread[] = "read_cstr: buffer overread"; static const char __pyx_k_Timer_get_remaining_budget[] = "Timer.get_remaining_budget"; static const char __pyx_k_TimoutError_was_not_raised[] = "TimoutError was not raised"; static const char __pyx_k_negative_infinity_datetime[] = "negative_infinity_datetime"; static const char __pyx_k_unexpected_exchange_format[] = "unexpected exchange format: {}"; static const char __pyx_k_ConnectionDoesNotExistError[] = "ConnectionDoesNotExistError"; static const char __pyx_k_pyx_unpickle_FastReadBuffer[] = "__pyx_unpickle_FastReadBuffer"; static const char __pyx_k_BaseProtocol_close_statement[] = "BaseProtocol.close_statement"; static const char __pyx_k_decode_row_statement_is_None[] = "_decode_row: statement is None"; static const char __pyx_k_pyx_unpickle_DataCodecConfig[] = "__pyx_unpickle_DataCodecConfig"; static const char __pyx_k_asyncpg_protocol_protocol_pyx[] = "asyncpg/protocol/protocol.pyx"; static const char __pyx_k_missing_array_dimension_value[] = "missing array dimension value"; static const char __pyx_k_not_enough_data_to_read_bytes[] = "not enough data to read {} bytes"; static const char __pyx_k_BaseProtocol_bind_execute_many[] = "BaseProtocol.bind_execute_many"; static const char __pyx_k_a_boolean_is_required_got_type[] = "a boolean is required (got type {})"; static const char __pyx_k_cannot_override_codec_for_type[] = "cannot override codec for type {}"; static const char __pyx_k_invalid_array_element_at_index[] = "invalid array element at index {}: {}"; static const char __pyx_k_missing_after_array_dimensions[] = "missing ']' after array dimensions"; static const char __pyx_k_Note_that_parameters_are_suppor[] = " Note that parameters are supported only in SELECT, INSERT, UPDATE, DELETE, and VALUES statements, and will *not* work in statements like CREATE VIEW or DECLARE CURSOR."; static const char __pyx_k_a_non_trivial_iterable_expected[] = "a non-trivial iterable expected (got type {!r})"; static const char __pyx_k_cannot_close_prepared_statement[] = "cannot close prepared statement; refs == {} != 0"; static const char __pyx_k_cannot_switch_to_state_protocol[] = "cannot switch to state {}; protocol is in the \"failed\" state"; static const char __pyx_k_discarding_message_r_unread_dat[] = "!!! discarding message {!r} unread data: {!r}"; static const char __pyx_k_end_message_buffer_is_too_small[] = "end_message: buffer is too small"; static const char __pyx_k_feed_data_bytes_object_expected[] = "feed_data: bytes object expected"; static const char __pyx_k_got_result_for_unknown_protocol[] = "got result for unknown protocol state {}"; static const char __pyx_k_invalid_address_family_in_value[] = "invalid address family in \"{}\" value"; static const char __pyx_k_invalid_address_length_in_value[] = "invalid address length in \"{}\" value"; static const char __pyx_k_list_or_tuple_expected_got_type[] = "list or tuple expected (got type {})"; static const char __pyx_k_on_result__prepare_statement_is[] = "_on_result__prepare: statement is None"; static const char __pyx_k_parse_data_msgs_first_message_i[] = "_parse_data_msgs: first message is not \"D\""; static const char __pyx_k_parse_data_msgs_result_is_not_a[] = "_parse_data_msgs: result is not a list, but {!r}"; static const char __pyx_k_protocol_is_already_in_the_idle[] = "protocol is already in the \"idle\" state"; static const char __pyx_k_protocol_is_in_an_unknown_state[] = "protocol is in an unknown state {}"; static const char __pyx_k_the_buffer_is_in_read_only_mode[] = "the buffer is in read-only mode"; static const char __pyx_k_the_server_expects_x_argument_s[] = "the server expects {x} argument{s} for this query, {y} {w} passed"; static const char __pyx_k_txid_snapshot_value_is_too_long[] = "txid_snapshot value is too long"; static const char __pyx_k_type_does_not_support_tuple_exc[] = "{} type does not support 'tuple' exchange format"; static const char __pyx_k_type_record_missing_field_types[] = "type record missing field types for composite {}"; static const char __pyx_k_unexpected_instance_of_anyarray[] = "unexpected instance of 'anyarray' type"; static const char __pyx_k_Check_the_query_against_the_pass[] = "Check the query against the passed list of arguments."; static const char __pyx_k_Deallocating_buffer_with_attache[] = "Deallocating buffer with attached memoryviews"; static const char __pyx_k_Incompatible_checksums_s_vs_0x19[] = "Incompatible checksums (%s vs 0x197884c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, backend_pid, backend_secret, buffer, con_params, con_status, encoding, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, state, transport, xact_status))"; static const char __pyx_k_Incompatible_checksums_s_vs_0x30[] = "Incompatible checksums (%s vs 0x30f806c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, completed_callback, con_params, con_status, connection, create_future, encoding, is_reading, last_query, loop, queries_count, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, settings, state, statement, timeout_callback, timeout_handle, transport, waiter, writing_paused, xact_status))"; static const char __pyx_k_Incompatible_checksums_s_vs_0x7e[] = "Incompatible checksums (%s vs 0x7ea5e72 = (buf, len))"; static const char __pyx_k_Incompatible_checksums_s_vs_0xb7[] = "Incompatible checksums (%s vs 0xb75bfc9 = (_local_type_codecs, _type_codecs_cache))"; static const char __pyx_k_Incompatible_checksums_s_vs_0xe0[] = "Incompatible checksums (%s vs 0xe0abff4 = (buf, length, owner))"; static const char __pyx_k_bind_execute_many_locals_genexpr[] = "bind_execute_many..genexpr"; static const char __pyx_k_cannot_encode_Decimal_value_into[] = "cannot encode Decimal value into numeric: exponent is too small"; static const char __pyx_k_cannot_encode_type_text_encoding[] = "cannot encode type \"{}\".\"{}\": text encoding of range types is not supported"; static const char __pyx_k_cannot_perform_operation_another[] = "cannot perform operation: another operation is cancelling"; static const char __pyx_k_cannot_perform_operation_connect[] = "cannot perform operation: connection is closed"; static const char __pyx_k_cannot_register_core_codec_for_O[] = "cannot register core codec for OID {}: it is greater than MAXSUPPORTEDOID ({})"; static const char __pyx_k_cannot_start_message_for_a_non_e[] = "cannot start_message for a non-empty buffer"; static const char __pyx_k_cannot_switch_to_idle_state_prot[] = "cannot switch to \"idle\" state; protocol is in the \"failed\" state"; static const char __pyx_k_cannot_switch_to_state_another_o[] = "cannot switch to state {}; another operation ({}) is in progress"; static const char __pyx_k_connection_was_closed_in_the_mid[] = "connection was closed in the middle of operation"; static const char __pyx_k_date_tuple_encoder_expecting_1_e[] = "date tuple encoder: expecting 1 element in tuple, got {}"; static const char __pyx_k_debug_first_buffer_of_ReadBuffer[] = "debug: first buffer of ReadBuffer is empty"; static const char __pyx_k_debug_second_buffer_of_ReadBuffe[] = "debug: second buffer of ReadBuffer is empty"; static const char __pyx_k_end_message_can_only_be_called_w[] = "end_message can only be called with start_message"; static const char __pyx_k_end_message_message_is_too_large[] = "end_message: message is too large"; static const char __pyx_k_expected_0_1_or_2_elements_in_ra[] = "expected 0, 1 or 2 elements in range (got {})"; static const char __pyx_k_failed_to_read_one_byte_on_a_non[] = "failed to read one byte on a non-empty buffer"; static const char __pyx_k_float_value_too_large_to_be_enco[] = "float value too large to be encoded as FLOAT4"; static const char __pyx_k_inconsistent_sub_array_dimension[] = "inconsistent sub-array dimensions at position {}"; static const char __pyx_k_insufficient_data_in_buffer_requ[] = "insufficient data in buffer: requested {}, remaining {}"; static const char __pyx_k_int_too_big_to_be_encoded_as_INT[] = "int too big to be encoded as INT2: {!r}"; static const char __pyx_k_interval_tuple_encoder_expecting[] = "interval tuple encoder: expecting 3 elements in tuple, got {}"; static const char __pyx_k_invalid_format_argument_expected[] = "invalid `format` argument, expected {}, got {!r}"; static const char __pyx_k_invalid_network_prefix_length_in[] = "invalid network prefix length in \"{}\" value"; static const char __pyx_k_invalid_number_of_elements_in_tx[] = "invalid number of elements in txid_snapshot tuple, expecting 4"; static const char __pyx_k_invalid_timeout_value_expected_n[] = "invalid timeout value: expected non-negative float (got {!r})"; static const char __pyx_k_list_tuple_or_Range_object_expec[] = "list, tuple or Range object expected (got type {})"; static const char __pyx_k_missing_after_array_dimensions_2[] = "missing '=' after array dimensions"; static const char __pyx_k_no_binary_format_encoder_for_typ[] = "no binary format encoder for type {} (OID {})"; static const char __pyx_k_no_codec_for_composite_attribute[] = "no codec for composite attribute type {}"; static const char __pyx_k_no_decoder_for_composite_type_el[] = "no decoder for composite type element in position {} of type OID {}"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_not_enough_data_to_read_one_byte[] = "not enough data to read one byte"; static const char __pyx_k_null_value_not_allowed_in_hstore[] = "null value not allowed in hstore key"; static const char __pyx_k_number_of_array_dimensions_excee[] = "number of array dimensions ({}) exceed the maximum expected ({})"; static const char __pyx_k_number_of_columns_in_result_is_d[] = "number of columns in result ({}) is different from what was described ({})"; static const char __pyx_k_numeric_type_does_not_support_in[] = "numeric type does not support infinite values"; static const char __pyx_k_read_cstr_only_works_when_the_me[] = "read_cstr only works when the message guaranteed to be in the buffer"; static const char __pyx_k_reader_is_not_an_asynchronous_it[] = "reader is not an asynchronous iterable"; static const char __pyx_k_specified_array_dimensions_do_no[] = "specified array dimensions do not match array content"; static const char __pyx_k_the_number_of_query_arguments_ca[] = "the number of query arguments cannot exceed 32767"; static const char __pyx_k_time_tuple_encoder_expecting_1_e[] = "time tuple encoder: expecting 1 element in tuple, got {}"; static const char __pyx_k_time_tuple_encoder_expecting_2_e[] = "time tuple encoder: expecting 2 elements2 in tuple, got {}"; static const char __pyx_k_timestamp_tuple_encoder_expectin[] = "timestamp tuple encoder: expecting 1 element in tuple, got {}"; static const char __pyx_k_too_many_elements_in_array_value[] = "too many elements in array value"; static const char __pyx_k_too_many_elements_in_composite_t[] = "too many elements in composite type record"; static const char __pyx_k_type_record_missing_base_type_fo[] = "type record missing base type for domain {}"; static const char __pyx_k_unexpected_character_r_at_positi[] = "unexpected character {!r} at position {}"; static const char __pyx_k_unexpected_data_type_of_composit[] = "unexpected data type of composite type attribute {}: {!r}, expected {!r}"; static const char __pyx_k_unexpected_trailing_bytes_in_buf[] = "unexpected trailing {} bytes in buffer"; static const char __pyx_k_unhandled_standard_data_type_r_O[] = "unhandled standard data type {!r} (OID {})"; static const char __pyx_k_unknown_error_in_protocol_implem[] = "unknown error in protocol implementation"; static const char __pyx_k_unsupported_authentication_metho[] = "unsupported authentication method requested by the server: {!r}"; static const char __pyx_k_waiter_is_not_done_while_handlin[] = "waiter is not done while handling critical protocol error"; static const char __pyx_k_cannot_encode_Decimal_value_into_2[] = "cannot encode Decimal value into numeric: exponent is too large"; static const char __pyx_k_cannot_encode_Decimal_value_into_3[] = "cannot encode Decimal value into numeric: number of digits is too large"; static const char __pyx_k_cannot_encode_type_text_encoding_2[] = "cannot encode type \"{}\".\"{}\": text encoding of composite types is not supported"; static const char __pyx_k_cannot_perform_operation_another_2[] = "cannot perform operation: another operation is in progress"; static const char __pyx_k_int_too_big_to_be_encoded_as_INT_2[] = "int too big to be encoded as INT4: {!r}"; static const char __pyx_k_int_too_big_to_be_encoded_as_INT_3[] = "int too big to be encoded as INT8: {!r}"; static const char __pyx_k_type_record_missing_base_type_fo_2[] = "type record missing base type for range {}"; static const char __pyx_k_unsupported_authentication_metho_2[] = "unsupported authentication method requested by the server: {}"; static PyObject *__pyx_n_s_AF_UNIX; static PyObject *__pyx_n_u_AF_UNIX; static PyObject *__pyx_n_s_ARRAY_TYPES; static PyObject *__pyx_n_s_AUTH_METHOD_NAME; static PyObject *__pyx_n_s_Attribute; static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_n_s_BaseProtocol_bind; static PyObject *__pyx_n_s_BaseProtocol_bind_execute; static PyObject *__pyx_n_s_BaseProtocol_bind_execute_many; static PyObject *__pyx_n_s_BaseProtocol_close; static PyObject *__pyx_n_s_BaseProtocol_close_statement; static PyObject *__pyx_n_s_BaseProtocol_copy_in; static PyObject *__pyx_n_s_BaseProtocol_copy_out; static PyObject *__pyx_n_s_BaseProtocol_execute; static PyObject *__pyx_n_s_BaseProtocol_prepare; static PyObject *__pyx_n_s_BaseProtocol_query; static PyObject *__pyx_n_s_BitString; static PyObject *__pyx_n_s_Box; static PyObject *__pyx_n_s_BufferError; static PyObject *__pyx_kp_u_Check_the_query_against_the_pass; static PyObject *__pyx_n_s_Circle; static PyObject *__pyx_kp_u_Codec_oid_elem_oid_core; static PyObject *__pyx_n_s_ConnectionDoesNotExistError; static PyObject *__pyx_kp_u_ConnectionSettings_r; static PyObject *__pyx_n_s_Container; static PyObject *__pyx_n_s_ContainerABC; static PyObject *__pyx_kp_u_Deallocating_buffer_with_attache; static PyObject *__pyx_n_s_Dec; static PyObject *__pyx_n_s_Decimal; static PyObject *__pyx_n_s_Event; static PyObject *__pyx_n_u_F; static PyObject *__pyx_n_s_Future; static PyObject *__pyx_n_s_IPPROTO_TCP; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x19; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x30; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x7e; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb7; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xe0; static PyObject *__pyx_n_s_InterfaceError; static PyObject *__pyx_n_s_InternalClientError; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_n_s_Line; static PyObject *__pyx_n_s_LineSegment; static PyObject *__pyx_n_s_MAXYEAR; static PyObject *__pyx_n_s_MINYEAR; static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_n_u_N; static PyObject *__pyx_n_u_NA; static PyObject *__pyx_n_s_NO_TIMEOUT; static PyObject *__pyx_n_b_NULL; static PyObject *__pyx_kp_b_NULL_2; static PyObject *__pyx_n_u_NaN; static PyObject *__pyx_n_s_NotImplementedError; static PyObject *__pyx_kp_u_Note_that_parameters_are_suppor; static PyObject *__pyx_n_s_OrderedDict; static PyObject *__pyx_n_s_OverflowError; static PyObject *__pyx_kp_b_PGCOPY; static PyObject *__pyx_n_s_Path; static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_Point; static PyObject *__pyx_n_s_Polygon; static PyObject *__pyx_n_s_PostgresError; static PyObject *__pyx_n_s_Protocol; static PyObject *__pyx_n_s_Range; static PyObject *__pyx_n_s_Record; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_StopAsyncIteration; static PyObject *__pyx_n_s_StopIteration; static PyObject *__pyx_n_s_TCP_NODELAY; static PyObject *__pyx_n_s_TYPEMAP; static PyObject *__pyx_n_s_TimeoutError; static PyObject *__pyx_n_u_TimeoutError; static PyObject *__pyx_n_s_Timer; static PyObject *__pyx_n_s_Timer___enter; static PyObject *__pyx_n_s_Timer___exit; static PyObject *__pyx_n_s_Timer___init; static PyObject *__pyx_n_s_Timer_get_remaining_budget; static PyObject *__pyx_kp_u_TimoutError_was_not_raised; static PyObject *__pyx_n_s_Type; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_UUID; static PyObject *__pyx_n_s_UUID_2; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_b__22; static PyObject *__pyx_kp_u__22; static PyObject *__pyx_kp_b__23; static PyObject *__pyx_n_u__3; static PyObject *__pyx_kp_u__36; static PyObject *__pyx_kp_b__64; static PyObject *__pyx_kp_u__87; static PyObject *__pyx_kp_u_a_boolean_is_required_got_type; static PyObject *__pyx_kp_u_a_non_trivial_iterable_expected; static PyObject *__pyx_n_u_abc; static PyObject *__pyx_n_s_abort; static PyObject *__pyx_n_u_abstime; static PyObject *__pyx_n_u_aclitem; static PyObject *__pyx_n_s_add; static PyObject *__pyx_n_s_add_done_callback; static PyObject *__pyx_n_s_add_python_codec; static PyObject *__pyx_n_s_add_types; static PyObject *__pyx_n_s_addr; static PyObject *__pyx_n_s_aiter; static PyObject *__pyx_n_s_alias_to; static PyObject *__pyx_kp_u_already_connected; static PyObject *__pyx_n_u_alt; static PyObject *__pyx_n_s_anext; static PyObject *__pyx_n_u_any; static PyObject *__pyx_n_u_anyarray; static PyObject *__pyx_n_u_anyelement; static PyObject *__pyx_n_u_anyenum; static PyObject *__pyx_n_u_anynonarray; static PyObject *__pyx_n_u_anyrange; static PyObject *__pyx_n_s_apg_exc; static PyObject *__pyx_n_s_apg_exc_base; static PyObject *__pyx_n_s_apg_types; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_u_array; static PyObject *__pyx_n_s_as_tuple; static PyObject *__pyx_n_u_ascii; static PyObject *__pyx_n_s_astimezone; static PyObject *__pyx_n_s_asyncio; static PyObject *__pyx_n_s_asyncio_coroutines; static PyObject *__pyx_n_s_asyncio_tasks; static PyObject *__pyx_n_s_asyncpg; static PyObject *__pyx_n_s_asyncpg_exceptions; static PyObject *__pyx_n_s_asyncpg_protocol_protocol; static PyObject *__pyx_kp_s_asyncpg_protocol_protocol_pyx; static PyObject *__pyx_n_s_asyncpg_types; static PyObject *__pyx_n_u_attrnames; static PyObject *__pyx_n_u_attrtypoids; static PyObject *__pyx_n_s_auth_msg; static PyObject *__pyx_n_s_await; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_u_basetype; static PyObject *__pyx_n_u_binary; static PyObject *__pyx_n_s_bind; static PyObject *__pyx_n_s_bind_execute; static PyObject *__pyx_n_s_bind_execute_many; static PyObject *__pyx_n_s_bind_execute_many_locals_genexpr; static PyObject *__pyx_n_u_bit; static PyObject *__pyx_kp_u_bit_value_too_long; static PyObject *__pyx_n_u_bool; static PyObject *__pyx_n_u_box; static PyObject *__pyx_n_u_bpchar; static PyObject *__pyx_n_s_budget; static PyObject *__pyx_n_s_budget_2; static PyObject *__pyx_kp_u_buffer_overread; static PyObject *__pyx_n_s_builtins; static PyObject *__pyx_n_u_bytea; static PyObject *__pyx_n_s_bytes; static PyObject *__pyx_n_b_c; static PyObject *__pyx_n_s_cache_key; static PyObject *__pyx_n_s_call_later; static PyObject *__pyx_n_s_cancel; static PyObject *__pyx_n_s_cancel_current_command; static PyObject *__pyx_n_s_cancelled; static PyObject *__pyx_kp_u_cannot_close_prepared_statement; static PyObject *__pyx_kp_u_cannot_encode_Decimal_value_into; static PyObject *__pyx_kp_u_cannot_encode_Decimal_value_into_2; static PyObject *__pyx_kp_u_cannot_encode_Decimal_value_into_3; static PyObject *__pyx_kp_u_cannot_encode_type_text_encoding; static PyObject *__pyx_kp_u_cannot_encode_type_text_encoding_2; static PyObject *__pyx_kp_u_cannot_override_codec_for_type; static PyObject *__pyx_kp_u_cannot_perform_operation_another; static PyObject *__pyx_kp_u_cannot_perform_operation_another_2; static PyObject *__pyx_kp_u_cannot_perform_operation_connect; static PyObject *__pyx_kp_u_cannot_register_core_codec_for_O; static PyObject *__pyx_kp_u_cannot_start_message_for_a_non_e; static PyObject *__pyx_kp_u_cannot_switch_to_idle_state_prot; static PyObject *__pyx_kp_u_cannot_switch_to_state_another_o; static PyObject *__pyx_kp_u_cannot_switch_to_state_protocol; static PyObject *__pyx_n_s_cause; static PyObject *__pyx_n_u_char; static PyObject *__pyx_n_s_chr; static PyObject *__pyx_n_u_cid; static PyObject *__pyx_n_u_cidr; static PyObject *__pyx_n_u_circle; static PyObject *__pyx_n_s_clear; static PyObject *__pyx_n_s_clear_type_cache; static PyObject *__pyx_n_b_client_encoding; static PyObject *__pyx_n_u_client_encoding; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_close_statement; static PyObject *__pyx_n_s_codecs; static PyObject *__pyx_n_s_collections; static PyObject *__pyx_n_s_collections_abc; static PyObject *__pyx_n_s_command_timeout; static PyObject *__pyx_n_s_compat; static PyObject *__pyx_n_u_composite; static PyObject *__pyx_n_s_con_params; static PyObject *__pyx_n_s_config; static PyObject *__pyx_n_s_conn_key; static PyObject *__pyx_n_s_connected_fut; static PyObject *__pyx_kp_u_connection_was_closed_in_the_mid; static PyObject *__pyx_n_s_copy_in; static PyObject *__pyx_n_s_copy_out; static PyObject *__pyx_n_s_copy_stmt; static PyObject *__pyx_n_u_cp1250; static PyObject *__pyx_n_u_cp1251; static PyObject *__pyx_n_u_cp1252; static PyObject *__pyx_n_u_cp1253; static PyObject *__pyx_n_u_cp1254; static PyObject *__pyx_n_u_cp1255; static PyObject *__pyx_n_u_cp1256; static PyObject *__pyx_n_u_cp1257; static PyObject *__pyx_n_u_cp1258; static PyObject *__pyx_n_u_cp1521; static PyObject *__pyx_n_u_cp866; static PyObject *__pyx_n_u_cp874; static PyObject *__pyx_n_u_cp932; static PyObject *__pyx_n_u_cp936; static PyObject *__pyx_n_u_cp949; static PyObject *__pyx_n_u_cp950; static PyObject *__pyx_n_s_create_future; static PyObject *__pyx_n_s_create_future_fallback; static PyObject *__pyx_n_s_create_record; static PyObject *__pyx_n_u_cstring; static PyObject *__pyx_n_b_d; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_database; static PyObject *__pyx_n_u_database; static PyObject *__pyx_n_s_date; static PyObject *__pyx_n_u_date; static PyObject *__pyx_n_s_date_from_ordinal; static PyObject *__pyx_kp_u_date_tuple_encoder_expecting_1_e; static PyObject *__pyx_n_s_datetime; static PyObject *__pyx_n_s_days; static PyObject *__pyx_kp_u_debug_first_buffer_of_ReadBuffer; static PyObject *__pyx_kp_u_debug_second_buffer_of_ReadBuffe; static PyObject *__pyx_n_s_decimal; static PyObject *__pyx_n_s_declare_fallback_codec; static PyObject *__pyx_n_s_decode; static PyObject *__pyx_kp_u_decode_row_statement_is_None; static PyObject *__pyx_n_s_decoder; static PyObject *__pyx_n_s_deque; static PyObject *__pyx_n_s_desc; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_digits; static PyObject *__pyx_kp_u_discarding_message_r_unread_dat; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_done; static PyObject *__pyx_n_b_e; static PyObject *__pyx_n_s_e; static PyObject *__pyx_n_s_elem; static PyObject *__pyx_n_u_elem_has_bin_io; static PyObject *__pyx_n_u_elemdelim; static PyObject *__pyx_n_s_elems; static PyObject *__pyx_n_u_elemtype; static PyObject *__pyx_n_s_empty; static PyObject *__pyx_kp_u_empty_first_buffer; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_encoder; static PyObject *__pyx_kp_u_end_message_buffer_is_too_small; static PyObject *__pyx_kp_u_end_message_can_only_be_called_w; static PyObject *__pyx_kp_u_end_message_message_is_too_large; static PyObject *__pyx_n_s_enter; static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_et; static PyObject *__pyx_n_u_euc_cn; static PyObject *__pyx_n_u_euc_jis_2004; static PyObject *__pyx_n_u_euc_jp; static PyObject *__pyx_n_u_euc_kr; static PyObject *__pyx_n_u_euccn; static PyObject *__pyx_n_u_eucjp; static PyObject *__pyx_n_u_euckr; static PyObject *__pyx_n_u_event_trigger; static PyObject *__pyx_n_s_exceptions; static PyObject *__pyx_n_s_execute; static PyObject *__pyx_n_s_exit; static PyObject *__pyx_kp_u_expected_0_1_or_2_elements_in_ra; static PyObject *__pyx_kp_u_expected_str_got; static PyObject *__pyx_n_s_exponent; static PyObject *__pyx_kp_u_failed_to_read_one_byte_on_a_non; static PyObject *__pyx_n_s_family; static PyObject *__pyx_n_u_fdw_handler; static PyObject *__pyx_kp_u_feed_data_bytes_object_expected; static PyObject *__pyx_n_s_find; static PyObject *__pyx_n_u_float4; static PyObject *__pyx_n_u_float8; static PyObject *__pyx_kp_u_float_value_too_large_to_be_enco; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_frombytes; static PyObject *__pyx_n_s_fromordinal; static PyObject *__pyx_n_s_genexpr; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_extra_info; static PyObject *__pyx_n_s_get_remaining_budget; static PyObject *__pyx_n_s_get_timeout; static PyObject *__pyx_n_s_getattr; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_kp_u_got_result_for_unknown_protocol; static PyObject *__pyx_n_u_gtsvector; static PyObject *__pyx_n_u_has_bin_io; static PyObject *__pyx_n_s_hashlib; static PyObject *__pyx_n_s_hashlib_md5; static PyObject *__pyx_n_s_hexdigest; static PyObject *__pyx_n_s_hint; static PyObject *__pyx_n_s_hour; static PyObject *__pyx_kp_u_hstore_value_is_too_large; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_kp_u_inconsistent_sub_array_dimension; static PyObject *__pyx_n_u_index_am_handler; static PyObject *__pyx_n_u_inet; static PyObject *__pyx_n_s_infinity_date; static PyObject *__pyx_n_s_infinity_datetime; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_inspect; static PyObject *__pyx_kp_u_insufficient_data_in_buffer_requ; static PyObject *__pyx_n_u_int2; static PyObject *__pyx_n_u_int4; static PyObject *__pyx_n_u_int8; static PyObject *__pyx_kp_u_int_too_big_to_be_encoded_as_INT; static PyObject *__pyx_kp_u_int_too_big_to_be_encoded_as_INT_2; static PyObject *__pyx_kp_u_int_too_big_to_be_encoded_as_INT_3; static PyObject *__pyx_n_u_internal; static PyObject *__pyx_n_u_interval; static PyObject *__pyx_kp_u_interval_tuple_encoder_expecting; static PyObject *__pyx_kp_u_invalid_address_family_in_value; static PyObject *__pyx_kp_u_invalid_address_length_in_value; static PyObject *__pyx_kp_u_invalid_array_element; static PyObject *__pyx_kp_u_invalid_array_element_at_index; static PyObject *__pyx_kp_u_invalid_data_format; static PyObject *__pyx_kp_u_invalid_format_argument_expected; static PyObject *__pyx_kp_u_invalid_network_prefix_length_in; static PyObject *__pyx_kp_u_invalid_number_of_elements_in_tx; static PyObject *__pyx_kp_u_invalid_rows_codecs; static PyObject *__pyx_kp_u_invalid_timeout_value_expected_n; static PyObject *__pyx_n_s_ip_address; static PyObject *__pyx_n_s_ip_network; static PyObject *__pyx_n_s_ipaddr; static PyObject *__pyx_n_s_ipaddress; static PyObject *__pyx_n_s_ipnet; static PyObject *__pyx_n_s_is_closed; static PyObject *__pyx_n_s_isempty; static PyObject *__pyx_n_s_items; static PyObject *__pyx_n_u_items; static PyObject *__pyx_n_u_json; static PyObject *__pyx_n_u_jsonb; static PyObject *__pyx_n_u_kind; static PyObject *__pyx_n_u_koi8_r; static PyObject *__pyx_n_u_koi8_u; static PyObject *__pyx_n_u_koi8r; static PyObject *__pyx_n_u_koi8u; static PyObject *__pyx_n_u_language_handler; static PyObject *__pyx_n_s_len; static PyObject *__pyx_n_s_limit; static PyObject *__pyx_n_u_line; static PyObject *__pyx_kp_u_list_or_tuple_expected_got_type; static PyObject *__pyx_kp_u_list_tuple_or_Range_object_expec; static PyObject *__pyx_n_s_lookup; static PyObject *__pyx_n_s_loop; static PyObject *__pyx_n_s_loop_2; static PyObject *__pyx_n_s_lower; static PyObject *__pyx_n_s_lower_inc; static PyObject *__pyx_n_u_lseg; static PyObject *__pyx_n_u_macaddr; static PyObject *__pyx_n_u_macaddr8; static PyObject *__pyx_n_s_main; static PyObject *__pyx_kp_u_malformed_array_literal_r; static PyObject *__pyx_n_s_mapping; static PyObject *__pyx_n_b_md5; static PyObject *__pyx_n_s_md5; static PyObject *__pyx_n_s_memoryview; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_microsecond; static PyObject *__pyx_n_s_microseconds; static PyObject *__pyx_n_s_minute; static PyObject *__pyx_n_s_minutes; static PyObject *__pyx_kp_u_missing_after_array_dimensions; static PyObject *__pyx_kp_u_missing_after_array_dimensions_2; static PyObject *__pyx_kp_u_missing_array_dimension_value; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_u_money; static PyObject *__pyx_n_s_monotonic; static PyObject *__pyx_n_u_n; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_u_name; static PyObject *__pyx_n_s_name_2; static PyObject *__pyx_n_s_negative_infinity_date; static PyObject *__pyx_n_s_negative_infinity_datetime; static PyObject *__pyx_n_s_network_address; static PyObject *__pyx_n_s_new; static PyObject *__pyx_n_s_new_2; static PyObject *__pyx_n_s_new_prefix; static PyObject *__pyx_kp_u_no_binary_format_encoder_for_typ; static PyObject *__pyx_kp_u_no_codec_for_composite_attribute; static PyObject *__pyx_kp_u_no_decoder_for_OID; static PyObject *__pyx_kp_u_no_decoder_for_composite_type_el; static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_kp_u_no_encoder_for_OID; static PyObject *__pyx_kp_u_no_message_to_consume; static PyObject *__pyx_kp_u_no_message_to_discard; static PyObject *__pyx_kp_u_non_homogeneous_array; static PyObject *__pyx_kp_u_not_connected; static PyObject *__pyx_kp_u_not_enough_data_to_read_bytes; static PyObject *__pyx_kp_u_not_enough_data_to_read_one_byte; static PyObject *__pyx_n_u_ns; static PyObject *__pyx_kp_u_null_value_not_allowed_in_hstore; static PyObject *__pyx_kp_u_number_of_array_dimensions_excee; static PyObject *__pyx_kp_u_number_of_columns_in_result_is_d; static PyObject *__pyx_n_u_numeric; static PyObject *__pyx_kp_u_numeric_type_does_not_support_in; static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_oid; static PyObject *__pyx_n_u_oid; static PyObject *__pyx_kp_u_oid_2; static PyObject *__pyx_n_s_on_error; static PyObject *__pyx_kp_u_on_result__prepare_statement_is; static PyObject *__pyx_kp_u_on_result_waiter_is_None; static PyObject *__pyx_kp_u_on_result_waiter_is_done; static PyObject *__pyx_n_s_on_timeout; static PyObject *__pyx_n_s_on_waiter_completed; static PyObject *__pyx_n_u_opaque; static PyObject *__pyx_n_s_packed; static PyObject *__pyx_kp_u_parse_data_msgs_first_message_i; static PyObject *__pyx_kp_u_parse_data_msgs_result_is_not_a; static PyObject *__pyx_n_s_password; static PyObject *__pyx_n_u_path; static PyObject *__pyx_kp_u_path_value_too_long; static PyObject *__pyx_n_s_pause_reading; static PyObject *__pyx_n_u_pg_catalog; static PyObject *__pyx_kp_u_pg_contrib_hstore; static PyObject *__pyx_n_u_pg_ddl_command; static PyObject *__pyx_n_u_pg_dependencies; static PyObject *__pyx_n_s_pg_epoch_date; static PyObject *__pyx_n_s_pg_epoch_datetime; static PyObject *__pyx_n_s_pg_epoch_datetime_utc; static PyObject *__pyx_n_u_pg_lsn; static PyObject *__pyx_n_u_pg_ndistinct; static PyObject *__pyx_n_u_pg_node_tree; static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_u_point; static PyObject *__pyx_n_u_polygon; static PyObject *__pyx_kp_u_polygon_value_too_long; static PyObject *__pyx_n_s_pop; static PyObject *__pyx_n_s_popleft; static PyObject *__pyx_n_s_portal_name; static PyObject *__pyx_n_s_prefixlen; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_prepare_2; static PyObject *__pyx_n_s_print; static PyObject *__pyx_n_s_process_log_message; static PyObject *__pyx_n_s_process_notification; static PyObject *__pyx_n_s_protocol; static PyObject *__pyx_kp_u_protocol_is_already_in_the_idle; static PyObject *__pyx_kp_u_protocol_is_in_an_unknown_state; static PyObject *__pyx_n_s_pyx_PickleError; static PyObject *__pyx_n_s_pyx_capi; static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_result; static PyObject *__pyx_n_s_pyx_state; static PyObject *__pyx_n_s_pyx_type; static PyObject *__pyx_n_s_pyx_unpickle_BaseProtocol; static PyObject *__pyx_n_s_pyx_unpickle_CoreProtocol; static PyObject *__pyx_n_s_pyx_unpickle_DataCodecConfig; static PyObject *__pyx_n_s_pyx_unpickle_FastReadBuffer; static PyObject *__pyx_n_s_pyx_unpickle_Memory; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_query; static PyObject *__pyx_n_b_r; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_u_range; static PyObject *__pyx_n_u_range_subtype; static PyObject *__pyx_kp_u_read_cstr_buffer_overread; static PyObject *__pyx_kp_u_read_cstr_only_works_when_the_me; static PyObject *__pyx_n_s_reader; static PyObject *__pyx_kp_u_reader_is_not_an_asynchronous_it; static PyObject *__pyx_n_s_rec; static PyObject *__pyx_n_u_record; static PyObject *__pyx_n_s_record_stmt; static PyObject *__pyx_n_s_records; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_u_refcursor; static PyObject *__pyx_n_u_regclass; static PyObject *__pyx_n_u_regconfig; static PyObject *__pyx_n_u_regdictionary; static PyObject *__pyx_n_u_regnamespace; static PyObject *__pyx_n_u_regoper; static PyObject *__pyx_n_u_regoperator; static PyObject *__pyx_n_u_regproc; static PyObject *__pyx_n_u_regprocedure; static PyObject *__pyx_n_u_regrole; static PyObject *__pyx_n_u_regtype; static PyObject *__pyx_n_s_release; static PyObject *__pyx_n_u_reltime; static PyObject *__pyx_n_s_remove_python_codec; static PyObject *__pyx_n_s_replace; static PyObject *__pyx_n_s_request_cancel; static PyObject *__pyx_n_s_resume_reading; static PyObject *__pyx_n_s_return_extra; static PyObject *__pyx_n_s_reversed; static PyObject *__pyx_n_s_s; static PyObject *__pyx_n_u_s; static PyObject *__pyx_n_u_scalar; static PyObject *__pyx_n_s_schema; static PyObject *__pyx_n_s_second; static PyObject *__pyx_n_s_seconds; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_send; static PyObject *__pyx_n_s_server_settings; static PyObject *__pyx_n_s_set; static PyObject *__pyx_n_s_set_builtin_type_codec; static PyObject *__pyx_n_s_set_builtin_type_codec_2; static PyObject *__pyx_n_s_set_exception; static PyObject *__pyx_n_s_set_result; static PyObject *__pyx_n_s_setsockopt; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_u_shift_jis; static PyObject *__pyx_n_u_shift_jis_2004; static PyObject *__pyx_n_s_sign; static PyObject *__pyx_n_s_sink; static PyObject *__pyx_n_u_sjis; static PyObject *__pyx_n_u_smgr; static PyObject *__pyx_n_s_socket; static PyObject *__pyx_n_u_socket; static PyObject *__pyx_kp_u_specified_array_dimensions_do_no; static PyObject *__pyx_n_u_sql_ascii; static PyObject *__pyx_n_s_started; static PyObject *__pyx_n_s_startswith; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_stmt_name; static PyObject *__pyx_kp_u_string_too_long; static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_supernet; static PyObject *__pyx_n_s_tb; static PyObject *__pyx_n_u_tcvn; static PyObject *__pyx_n_u_tcvn5712; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_u_text; static PyObject *__pyx_kp_u_text_2; static PyObject *__pyx_kp_u_text_binary_or_tuple; static PyObject *__pyx_kp_u_the_buffer_is_in_read_only_mode; static PyObject *__pyx_kp_u_the_number_of_query_arguments_ca; static PyObject *__pyx_kp_u_the_server_expects_x_argument_s; static PyObject *__pyx_n_s_throw; static PyObject *__pyx_n_u_tid; static PyObject *__pyx_n_s_time; static PyObject *__pyx_n_u_time; static PyObject *__pyx_kp_u_time_tuple_encoder_expecting_1_e; static PyObject *__pyx_kp_u_time_tuple_encoder_expecting_2_e; static PyObject *__pyx_n_s_timedelta; static PyObject *__pyx_n_s_timeout; static PyObject *__pyx_n_s_timestamp; static PyObject *__pyx_n_u_timestamp; static PyObject *__pyx_kp_u_timestamp_tuple_encoder_expectin; static PyObject *__pyx_n_u_timestamptz; static PyObject *__pyx_n_u_timetz; static PyObject *__pyx_n_s_timezone; static PyObject *__pyx_n_u_tinterval; static PyObject *__pyx_kp_u_too_many_elements_in_array_value; static PyObject *__pyx_kp_u_too_many_elements_in_composite_t; static PyObject *__pyx_n_s_toordinal; static PyObject *__pyx_n_u_trigger; static PyObject *__pyx_n_u_tsm_handler; static PyObject *__pyx_n_u_tsquery; static PyObject *__pyx_n_u_tsvector; static PyObject *__pyx_n_u_tuple; static PyObject *__pyx_n_u_txid_snapshot; static PyObject *__pyx_kp_u_txid_snapshot_value_is_too_long; static PyObject *__pyx_kp_u_type_does_not_support_tuple_exc; static PyObject *__pyx_kp_u_type_record_missing_base_type_fo; static PyObject *__pyx_kp_u_type_record_missing_base_type_fo_2; static PyObject *__pyx_kp_u_type_record_missing_field_types; static PyObject *__pyx_n_s_typekind; static PyObject *__pyx_n_s_typename; static PyObject *__pyx_n_s_typeoid; static PyObject *__pyx_n_s_types; static PyObject *__pyx_n_s_typeschema; static PyObject *__pyx_n_s_tzinfo; static PyObject *__pyx_kp_u_unexpected_JSONB_format; static PyObject *__pyx_kp_u_unexpected_character_r_at_positi; static PyObject *__pyx_kp_u_unexpected_codec_type; static PyObject *__pyx_kp_u_unexpected_data_format; static PyObject *__pyx_kp_u_unexpected_data_type_of_composit; static PyObject *__pyx_kp_u_unexpected_end_of_string; static PyObject *__pyx_kp_u_unexpected_exchange_format; static PyObject *__pyx_kp_u_unexpected_instance_of_anyarray; static PyObject *__pyx_kp_u_unexpected_ndims_value; static PyObject *__pyx_kp_u_unexpected_trailing_bytes_in_buf; static PyObject *__pyx_kp_u_unhandled_standard_data_type_r_O; static PyObject *__pyx_n_u_unicode; static PyObject *__pyx_n_u_unknown; static PyObject *__pyx_kp_u_unknown_alias_target; static PyObject *__pyx_kp_u_unknown_error_in_protocol_implem; static PyObject *__pyx_kp_u_unsupported_authentication_metho; static PyObject *__pyx_kp_u_unsupported_authentication_metho_2; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_upper; static PyObject *__pyx_n_s_upper_inc; static PyObject *__pyx_n_s_user; static PyObject *__pyx_n_u_user; static PyObject *__pyx_n_s_utc; static PyObject *__pyx_n_s_utcoffset; static PyObject *__pyx_kp_u_utf_8; static PyObject *__pyx_n_u_utf_8_2; static PyObject *__pyx_n_s_uuid; static PyObject *__pyx_n_u_uuid; static PyObject *__pyx_n_u_varbit; static PyObject *__pyx_n_u_varchar; static PyObject *__pyx_n_s_version; static PyObject *__pyx_n_u_void; static PyObject *__pyx_n_u_vscii; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_wait; static PyObject *__pyx_n_s_wait_for; static PyObject *__pyx_kp_u_waiter_is_not_done_while_handlin; static PyObject *__pyx_n_u_was; static PyObject *__pyx_n_u_were; static PyObject *__pyx_n_u_win; static PyObject *__pyx_n_u_win1250; static PyObject *__pyx_n_u_win1251; static PyObject *__pyx_n_u_win1252; static PyObject *__pyx_n_u_win1253; static PyObject *__pyx_n_u_win1254; static PyObject *__pyx_n_u_win1255; static PyObject *__pyx_n_u_win1256; static PyObject *__pyx_n_u_win1257; static PyObject *__pyx_n_u_win1258; static PyObject *__pyx_n_u_win866; static PyObject *__pyx_n_u_win874; static PyObject *__pyx_n_u_win932; static PyObject *__pyx_n_u_win936; static PyObject *__pyx_n_u_win949; static PyObject *__pyx_n_u_win950; static PyObject *__pyx_n_u_windows1250; static PyObject *__pyx_n_u_windows1251; static PyObject *__pyx_n_u_windows1252; static PyObject *__pyx_n_u_windows1253; static PyObject *__pyx_n_u_windows1254; static PyObject *__pyx_n_u_windows1255; static PyObject *__pyx_n_u_windows1256; static PyObject *__pyx_n_u_windows1257; static PyObject *__pyx_n_u_windows1258; static PyObject *__pyx_n_u_windows866; static PyObject *__pyx_n_u_windows874; static PyObject *__pyx_n_u_windows932; static PyObject *__pyx_n_u_windows936; static PyObject *__pyx_n_u_windows949; static PyObject *__pyx_n_u_windows950; static PyObject *__pyx_n_s_write; static PyObject *__pyx_n_s_writing_allowed; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_xformat; static PyObject *__pyx_n_u_xid; static PyObject *__pyx_n_u_xml; static PyObject *__pyx_n_s_y; static int __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_conn_key); /* 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_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_10set_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); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_12get_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); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_14__getattr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_16__repr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_6Memory___reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_6Memory_2__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self); /* proto */ static void __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_2__dealloc__(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self); /* proto */ static int __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_4__getbuffer__(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /* proto */ static void __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_6__releasebuffer__(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7asyncpg_8protocol_8protocol_10ReadBuffer___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_10ReadBuffer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_10ReadBuffer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_14FastReadBuffer___reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_14FastReadBuffer_2__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self, 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, PyObject *__pyx_v_cache_key); /* 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_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_12CoreProtocol___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_con_params); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_2data_received(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_4connection_made(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_transport); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_6connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_exc); /* 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_8__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_10__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); /* 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_8attach(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_10detach(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12mark_closed(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_4refs___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_16__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, 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_8is_in_transaction(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); /* 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, int __pyx_v_limit, PyObject *__pyx_v_return_extra, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_genexpr(PyObject *__pyx_self); /* 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); /* 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_25query(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_28copy_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_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_31copy_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_34close_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_37is_closed(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_39is_connected(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_41abort(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_43close(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_46_request_cancel(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_48_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_50_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_52_create_future_fallback(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_54_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_56pause_writing(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_58resume_writing(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* 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_60__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_62__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__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_Memory(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_FastReadBuffer(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_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_8__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_10__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_Memory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_WriteBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_ReadBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_FastReadBuffer(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_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__prepare(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many(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_bind(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_4; static PyObject *__pyx_int_6; static PyObject *__pyx_int_10; static PyObject *__pyx_int_12; static PyObject *__pyx_int_16; static PyObject *__pyx_int_17; static PyObject *__pyx_int_18; static PyObject *__pyx_int_19; static PyObject *__pyx_int_20; static PyObject *__pyx_int_21; static PyObject *__pyx_int_23; static PyObject *__pyx_int_24; static PyObject *__pyx_int_25; static PyObject *__pyx_int_26; static PyObject *__pyx_int_27; static PyObject *__pyx_int_28; static PyObject *__pyx_int_29; static PyObject *__pyx_int_31; static PyObject *__pyx_int_32; static PyObject *__pyx_int_59; static PyObject *__pyx_int_100; static PyObject *__pyx_int_114; static PyObject *__pyx_int_142; static PyObject *__pyx_int_194; static PyObject *__pyx_int_210; static PyObject *__pyx_int_325; static PyObject *__pyx_int_600; static PyObject *__pyx_int_601; static PyObject *__pyx_int_602; static PyObject *__pyx_int_603; static PyObject *__pyx_int_604; static PyObject *__pyx_int_628; static PyObject *__pyx_int_650; static PyObject *__pyx_int_700; static PyObject *__pyx_int_701; static PyObject *__pyx_int_702; static PyObject *__pyx_int_703; static PyObject *__pyx_int_704; static PyObject *__pyx_int_705; static PyObject *__pyx_int_718; static PyObject *__pyx_int_774; static PyObject *__pyx_int_790; static PyObject *__pyx_int_829; static PyObject *__pyx_int_869; static PyObject *__pyx_int_1000; static PyObject *__pyx_int_1009; static PyObject *__pyx_int_1028; static PyObject *__pyx_int_1033; static PyObject *__pyx_int_1042; static PyObject *__pyx_int_1043; static PyObject *__pyx_int_1082; static PyObject *__pyx_int_1083; static PyObject *__pyx_int_1114; static PyObject *__pyx_int_1184; static PyObject *__pyx_int_1186; static PyObject *__pyx_int_1266; static PyObject *__pyx_int_1560; static PyObject *__pyx_int_1562; static PyObject *__pyx_int_1700; static PyObject *__pyx_int_1790; static PyObject *__pyx_int_2000; static PyObject *__pyx_int_2202; static PyObject *__pyx_int_2203; static PyObject *__pyx_int_2204; static PyObject *__pyx_int_2205; static PyObject *__pyx_int_2206; static PyObject *__pyx_int_2249; static PyObject *__pyx_int_2275; static PyObject *__pyx_int_2276; static PyObject *__pyx_int_2277; static PyObject *__pyx_int_2278; static PyObject *__pyx_int_2279; static PyObject *__pyx_int_2280; static PyObject *__pyx_int_2281; static PyObject *__pyx_int_2282; static PyObject *__pyx_int_2283; static PyObject *__pyx_int_2776; static PyObject *__pyx_int_2950; static PyObject *__pyx_int_2970; static PyObject *__pyx_int_3115; static PyObject *__pyx_int_3220; static PyObject *__pyx_int_3310; static PyObject *__pyx_int_3361; static PyObject *__pyx_int_3402; static PyObject *__pyx_int_3500; static PyObject *__pyx_int_3614; static PyObject *__pyx_int_3615; static PyObject *__pyx_int_3642; static PyObject *__pyx_int_3734; static PyObject *__pyx_int_3769; static PyObject *__pyx_int_3802; static PyObject *__pyx_int_3831; static PyObject *__pyx_int_3838; static PyObject *__pyx_int_4089; static PyObject *__pyx_int_4096; static PyObject *__pyx_int_524288; static PyObject *__pyx_int_999999; static PyObject *__pyx_int_26708044; static PyObject *__pyx_int_51347564; static PyObject *__pyx_int_132800114; static PyObject *__pyx_int_192266185; static PyObject *__pyx_int_235585524; static PyObject *__pyx_int_9223372036854775807; static PyObject *__pyx_int_neg_9223372036854775808; static enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_k__2; static PyObject *__pyx_k__37; static PyObject *__pyx_k__38; static enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__39; static enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__40; static enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__41; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_slice__35; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__53; static PyObject *__pyx_tuple__54; static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__57; static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__59; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__61; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__63; static PyObject *__pyx_tuple__65; static PyObject *__pyx_tuple__66; static PyObject *__pyx_tuple__67; static PyObject *__pyx_tuple__68; static PyObject *__pyx_tuple__69; static PyObject *__pyx_tuple__70; static PyObject *__pyx_tuple__71; static PyObject *__pyx_tuple__72; static PyObject *__pyx_tuple__73; static PyObject *__pyx_tuple__74; static PyObject *__pyx_tuple__75; static PyObject *__pyx_tuple__76; static PyObject *__pyx_tuple__77; static PyObject *__pyx_tuple__78; static PyObject *__pyx_tuple__79; static PyObject *__pyx_tuple__80; static PyObject *__pyx_tuple__81; static PyObject *__pyx_tuple__82; static PyObject *__pyx_tuple__83; static PyObject *__pyx_tuple__84; static PyObject *__pyx_tuple__85; static PyObject *__pyx_tuple__86; static PyObject *__pyx_tuple__88; static PyObject *__pyx_tuple__89; static PyObject *__pyx_tuple__90; static PyObject *__pyx_tuple__91; static PyObject *__pyx_tuple__92; static PyObject *__pyx_tuple__93; static PyObject *__pyx_tuple__94; static PyObject *__pyx_tuple__95; static PyObject *__pyx_tuple__96; static PyObject *__pyx_tuple__97; static PyObject *__pyx_tuple__98; static PyObject *__pyx_tuple__99; static PyObject *__pyx_tuple__100; static PyObject *__pyx_tuple__101; static PyObject *__pyx_tuple__102; static PyObject *__pyx_tuple__103; static PyObject *__pyx_tuple__104; static PyObject *__pyx_tuple__105; static PyObject *__pyx_tuple__106; static PyObject *__pyx_tuple__107; static PyObject *__pyx_tuple__108; static PyObject *__pyx_tuple__109; static PyObject *__pyx_tuple__110; static PyObject *__pyx_tuple__111; static PyObject *__pyx_tuple__112; static PyObject *__pyx_tuple__113; static PyObject *__pyx_tuple__114; static PyObject *__pyx_tuple__115; static PyObject *__pyx_tuple__116; static PyObject *__pyx_tuple__117; static PyObject *__pyx_tuple__118; static PyObject *__pyx_tuple__120; static PyObject *__pyx_tuple__122; static PyObject *__pyx_tuple__124; static PyObject *__pyx_tuple__126; static PyObject *__pyx_tuple__128; static PyObject *__pyx_tuple__130; static PyObject *__pyx_tuple__132; static PyObject *__pyx_tuple__134; static PyObject *__pyx_tuple__136; static PyObject *__pyx_codeobj__119; static PyObject *__pyx_codeobj__121; static PyObject *__pyx_codeobj__123; static PyObject *__pyx_codeobj__125; static PyObject *__pyx_codeobj__127; static PyObject *__pyx_codeobj__129; static PyObject *__pyx_codeobj__131; static PyObject *__pyx_codeobj__133; static PyObject *__pyx_codeobj__135; static PyObject *__pyx_codeobj__137; /* "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; __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); if (unlikely(__pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(8, 63, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pg_encoding, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 63, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pg_encoding, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 63, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/encodings.pyx":62 * * * cdef get_python_encoding(pg_encoding): # <<<<<<<<<<<<<< * return ENCODINGS_MAP.get(pg_encoding.lower(), pg_encoding.lower()) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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":11 * cdef class ConnectionSettings: * * def __cinit__(self, conn_key): # <<<<<<<<<<<<<< * 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) { PyObject *__pyx_v_conn_key = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_conn_key,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conn_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 11, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_conn_key = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 11, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_conn_key); /* 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, PyObject *__pyx_v_conn_key) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "asyncpg/protocol/settings.pyx":12 * * def __cinit__(self, conn_key): * self._encoding = 'utf-8' # <<<<<<<<<<<<<< * self._is_utf8 = True * self._settings = {} */ __Pyx_INCREF(__pyx_kp_u_utf_8); __Pyx_GIVEREF(__pyx_kp_u_utf_8); __Pyx_GOTREF(__pyx_v_self->_encoding); __Pyx_DECREF(__pyx_v_self->_encoding); __pyx_v_self->_encoding = __pyx_kp_u_utf_8; /* "asyncpg/protocol/settings.pyx":13 * def __cinit__(self, conn_key): * 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":14 * self._encoding = 'utf-8' * self._is_utf8 = True * self._settings = {} # <<<<<<<<<<<<<< * self._codec = codecs.lookup('utf-8') * self._data_codecs = DataCodecConfig(conn_key) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __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":15 * self._is_utf8 = True * self._settings = {} * self._codec = codecs.lookup('utf-8') # <<<<<<<<<<<<<< * self._data_codecs = DataCodecConfig(conn_key) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_codecs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_codec); __Pyx_DECREF(__pyx_v_self->_codec); __pyx_v_self->_codec = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":16 * self._settings = {} * self._codec = codecs.lookup('utf-8') * self._data_codecs = DataCodecConfig(conn_key) # <<<<<<<<<<<<<< * * cdef add_setting(self, str name, str val): */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_conn_key); __Pyx_GIVEREF(__pyx_v_conn_key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_conn_key); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__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_2); __pyx_t_2 = 0; /* "asyncpg/protocol/settings.pyx":11 * cdef class ConnectionSettings: * * def __cinit__(self, conn_key): # <<<<<<<<<<<<<< * 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_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":18 * self._data_codecs = DataCodecConfig(conn_key) * * 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; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("add_setting", 0); /* "asyncpg/protocol/settings.pyx":19 * * cdef add_setting(self, str name, str val): * self._settings[name] = val # <<<<<<<<<<<<<< * if name == 'client_encoding': * py_enc = get_python_encoding(val) */ if (unlikely(__pyx_v_self->_settings == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 19, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_self->_settings, __pyx_v_name, __pyx_v_val) < 0)) __PYX_ERR(1, 19, __pyx_L1_error) /* "asyncpg/protocol/settings.pyx":20 * cdef add_setting(self, str name, str val): * self._settings[name] = val * if name == 'client_encoding': # <<<<<<<<<<<<<< * py_enc = get_python_encoding(val) * self._codec = codecs.lookup(py_enc) */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_client_encoding, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 20, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/settings.pyx":21 * 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_3 = __pyx_f_7asyncpg_8protocol_8protocol_get_python_encoding(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_py_enc = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/settings.pyx":22 * 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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_codecs); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lookup); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_py_enc); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_py_enc}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_py_enc}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_py_enc); __Pyx_GIVEREF(__pyx_v_py_enc); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_py_enc); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_codec); __Pyx_DECREF(__pyx_v_self->_codec); __pyx_v_self->_codec = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/settings.pyx":23 * 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 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_codec, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_encoding); __Pyx_DECREF(__pyx_v_self->_encoding); __pyx_v_self->_encoding = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/settings.pyx":24 * self._codec = codecs.lookup(py_enc) * self._encoding = self._codec.name * self._is_utf8 = self._encoding == 'utf-8' # <<<<<<<<<<<<<< * * cdef inline is_encoding_utf8(self): */ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_encoding, __pyx_kp_u_utf_8, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 24, __pyx_L1_error) __pyx_v_self->_is_utf8 = __pyx_t_2; /* "asyncpg/protocol/settings.pyx":20 * 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":18 * self._data_codecs = DataCodecConfig(conn_key) * * 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_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __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":26 * self._is_utf8 = self._encoding == 'utf-8' * * cdef inline is_encoding_utf8(self): # <<<<<<<<<<<<<< * return self._is_utf8 * */ static CYTHON_INLINE 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; __Pyx_RefNannySetupContext("is_encoding_utf8", 0); /* "asyncpg/protocol/settings.pyx":27 * * cdef inline is_encoding_utf8(self): * return self._is_utf8 # <<<<<<<<<<<<<< * * cpdef inline get_text_codec(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_is_utf8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/settings.pyx":26 * self._is_utf8 = self._encoding == 'utf-8' * * cdef inline 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":29 * return self._is_utf8 * * cpdef inline get_text_codec(self): # <<<<<<<<<<<<<< * return self._codec * */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static CYTHON_INLINE 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":30 * * cpdef inline 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":29 * return self._is_utf8 * * cpdef inline 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, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_text_codec (wrapper)", 0); __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; __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(1, 29, __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":32 * 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, PyObject *__pyx_v_types); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_types, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("register_data_types", 0); /* "asyncpg/protocol/settings.pyx":33 * * cpdef inline register_data_types(self, types): * self._data_codecs.add_types(types) # <<<<<<<<<<<<<< * * cpdef inline add_python_codec(self, typeoid, typename, typeschema, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_data_codecs), __pyx_n_s_add_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_types}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_types}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_types); __Pyx_GIVEREF(__pyx_v_types); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_types); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":32 * return self._codec * * cpdef inline register_data_types(self, types): # <<<<<<<<<<<<<< * self._data_codecs.add_types(types) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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, PyObject *__pyx_v_types); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types(PyObject *__pyx_v_self, PyObject *__pyx_v_types) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("register_data_types (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_4register_data_types(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), ((PyObject *)__pyx_v_types)); /* function exit code */ __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; __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(1, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.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":35 * self._data_codecs.add_types(types) * * cpdef inline add_python_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, encoder, decoder, format): * cdef: */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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_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; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("add_python_codec", 0); /* "asyncpg/protocol/settings.pyx":41 * ClientExchangeFormat xformat * * if format == 'binary': # <<<<<<<<<<<<<< * _format = PG_FORMAT_BINARY * xformat = PG_XFORMAT_OBJECT */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_binary, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 41, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/settings.pyx":42 * * 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":43 * 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":41 * ClientExchangeFormat xformat * * if format == 'binary': # <<<<<<<<<<<<<< * _format = PG_FORMAT_BINARY * xformat = PG_XFORMAT_OBJECT */ goto __pyx_L3; } /* "asyncpg/protocol/settings.pyx":44 * _format = PG_FORMAT_BINARY * xformat = PG_XFORMAT_OBJECT * elif format == 'text': # <<<<<<<<<<<<<< * _format = PG_FORMAT_TEXT * xformat = PG_XFORMAT_OBJECT */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_text, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 44, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/settings.pyx":45 * 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":46 * 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":44 * _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":47 * _format = PG_FORMAT_TEXT * xformat = PG_XFORMAT_OBJECT * elif format == 'tuple': # <<<<<<<<<<<<<< * _format = PG_FORMAT_ANY * xformat = PG_XFORMAT_TUPLE */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_tuple, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/settings.pyx":48 * 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":49 * elif format == 'tuple': * _format = PG_FORMAT_ANY * xformat = PG_XFORMAT_TUPLE # <<<<<<<<<<<<<< * else: * raise ValueError( */ __pyx_v_xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE; /* "asyncpg/protocol/settings.pyx":47 * _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":51 * xformat = PG_XFORMAT_TUPLE * else: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid `format` argument, expected {}, got {!r}'.format( * "'text', 'binary' or 'tuple'", format */ /*else*/ { /* "asyncpg/protocol/settings.pyx":52 * else: * raise ValueError( * 'invalid `format` argument, expected {}, got {!r}'.format( # <<<<<<<<<<<<<< * "'text', 'binary' or 'tuple'", format * )) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_format_argument_expected, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/settings.pyx":53 * raise ValueError( * 'invalid `format` argument, expected {}, got {!r}'.format( * "'text', 'binary' or 'tuple'", format # <<<<<<<<<<<<<< * )) * */ __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_u_text_binary_or_tuple, __pyx_v_format}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_u_text_binary_or_tuple, __pyx_v_format}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_kp_u_text_binary_or_tuple); __Pyx_GIVEREF(__pyx_kp_u_text_binary_or_tuple); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_kp_u_text_binary_or_tuple); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_format); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/settings.pyx":51 * xformat = PG_XFORMAT_TUPLE * else: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid `format` argument, expected {}, got {!r}'.format( * "'text', 'binary' or 'tuple'", format */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 51, __pyx_L1_error) } __pyx_L3:; /* "asyncpg/protocol/settings.pyx":56 * )) * * self._data_codecs.add_python_codec(typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, encoder, decoder, * _format, xformat) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_data_codecs), __pyx_n_s_add_python_codec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/settings.pyx":58 * self._data_codecs.add_python_codec(typeoid, typename, typeschema, * typekind, encoder, decoder, * _format, xformat) # <<<<<<<<<<<<<< * * cpdef inline remove_python_codec(self, typeoid, typename, typeschema): */ __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v__format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[9] = {__pyx_t_7, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_encoder, __pyx_v_decoder, __pyx_t_6, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 8+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[9] = {__pyx_t_7, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_encoder, __pyx_v_decoder, __pyx_t_6, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 8+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_8 = PyTuple_New(8+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_v_typeoid); __Pyx_INCREF(__pyx_v_typename); __Pyx_GIVEREF(__pyx_v_typename); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_v_typename); __Pyx_INCREF(__pyx_v_typeschema); __Pyx_GIVEREF(__pyx_v_typeschema); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_v_typeschema); __Pyx_INCREF(__pyx_v_typekind); __Pyx_GIVEREF(__pyx_v_typekind); PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_5, __pyx_v_typekind); __Pyx_INCREF(__pyx_v_encoder); __Pyx_GIVEREF(__pyx_v_encoder); PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_5, __pyx_v_encoder); __Pyx_INCREF(__pyx_v_decoder); __Pyx_GIVEREF(__pyx_v_decoder); PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_5, __pyx_v_decoder); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 6+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 7+__pyx_t_5, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/settings.pyx":35 * self._data_codecs.add_types(types) * * cpdef inline add_python_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, encoder, decoder, 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_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_typeoid = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_typeschema = 0; PyObject *__pyx_v_typekind = 0; PyObject *__pyx_v_encoder = 0; PyObject *__pyx_v_decoder = 0; PyObject *__pyx_v_format = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_python_codec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,&__pyx_n_s_typekind,&__pyx_n_s_encoder,&__pyx_n_s_decoder,&__pyx_n_s_format,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeoid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 7, 7, 1); __PYX_ERR(1, 35, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeschema)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 7, 7, 2); __PYX_ERR(1, 35, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typekind)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 7, 7, 3); __PYX_ERR(1, 35, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoder)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 7, 7, 4); __PYX_ERR(1, 35, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_decoder)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 7, 7, 5); __PYX_ERR(1, 35, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 7, 7, 6); __PYX_ERR(1, 35, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_python_codec") < 0)) __PYX_ERR(1, 35, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 7) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; __pyx_v_typekind = values[3]; __pyx_v_encoder = values[4]; __pyx_v_decoder = values[5]; __pyx_v_format = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 35, __pyx_L3_error) __pyx_L3_error:; __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_typekind, __pyx_v_encoder, __pyx_v_decoder, __pyx_v_format); /* function exit code */ __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_typekind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __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_typekind, __pyx_v_encoder, __pyx_v_decoder, __pyx_v_format, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.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":60 * _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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("remove_python_codec", 0); /* "asyncpg/protocol/settings.pyx":61 * * cpdef inline remove_python_codec(self, typeoid, typename, typeschema): * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) # <<<<<<<<<<<<<< * * cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_data_codecs), __pyx_n_s_remove_python_codec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_typeoid); __Pyx_INCREF(__pyx_v_typename); __Pyx_GIVEREF(__pyx_v_typename); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_typename); __Pyx_INCREF(__pyx_v_typeschema); __Pyx_GIVEREF(__pyx_v_typeschema); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_typeschema); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":60 * _format, xformat) * * cpdef inline remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_typeoid = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_typeschema = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_python_codec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeoid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, 1); __PYX_ERR(1, 60, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeschema)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, 2); __PYX_ERR(1, 60, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_python_codec") < 0)) __PYX_ERR(1, 60, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 60, __pyx_L3_error) __pyx_L3_error:; __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 */ __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; __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(1, 60, __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":63 * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * * cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, alias_to): * self._data_codecs.set_builtin_type_codec(typeoid, typename, typeschema, */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11set_builtin_type_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*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, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("set_builtin_type_codec", 0); /* "asyncpg/protocol/settings.pyx":65 * cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, * typekind, alias_to): * self._data_codecs.set_builtin_type_codec(typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, alias_to) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_data_codecs), __pyx_n_s_set_builtin_type_codec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/settings.pyx":66 * typekind, alias_to): * self._data_codecs.set_builtin_type_codec(typeoid, typename, typeschema, * typekind, alias_to) # <<<<<<<<<<<<<< * * cpdef inline Codec get_data_codec(self, uint32_t oid, */ __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[6] = {__pyx_t_3, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_typeoid); __Pyx_INCREF(__pyx_v_typename); __Pyx_GIVEREF(__pyx_v_typename); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_typename); __Pyx_INCREF(__pyx_v_typeschema); __Pyx_GIVEREF(__pyx_v_typeschema); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_typeschema); __Pyx_INCREF(__pyx_v_typekind); __Pyx_GIVEREF(__pyx_v_typekind); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_typekind); __Pyx_INCREF(__pyx_v_alias_to); __Pyx_GIVEREF(__pyx_v_alias_to); PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_alias_to); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":63 * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * * cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, alias_to): * self._data_codecs.set_builtin_type_codec(typeoid, typename, typeschema, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __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_11set_builtin_type_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11set_builtin_type_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { 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_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_builtin_type_codec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,&__pyx_n_s_typekind,&__pyx_n_s_alias_to,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeoid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 5, 5, 1); __PYX_ERR(1, 63, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeschema)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 5, 5, 2); __PYX_ERR(1, 63, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typekind)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 5, 5, 3); __PYX_ERR(1, 63, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alias_to)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 5, 5, 4); __PYX_ERR(1, 63, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_builtin_type_codec") < 0)) __PYX_ERR(1, 63, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 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]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 63, __pyx_L3_error) __pyx_L3_error:; __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_10set_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); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_10set_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_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __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, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __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":68 * typekind, alias_to) * * cpdef inline Codec get_data_codec(self, uint32_t oid, # <<<<<<<<<<<<<< * ServerDataFormat format=PG_FORMAT_ANY): * if format == PG_FORMAT_ANY: */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13get_data_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, uint32_t __pyx_v_oid, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args) { enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format = __pyx_k__2; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = NULL; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; __Pyx_RefNannySetupContext("get_data_codec", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_format = __pyx_optional_args->format; } } /* "asyncpg/protocol/settings.pyx":70 * cpdef inline Codec get_data_codec(self, uint32_t oid, * ServerDataFormat format=PG_FORMAT_ANY): * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * codec = self._data_codecs.get_codec(oid, PG_FORMAT_BINARY) * if codec is None: */ __pyx_t_1 = ((__pyx_v_format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/settings.pyx":71 * ServerDataFormat format=PG_FORMAT_ANY): * if format == PG_FORMAT_ANY: * codec = self._data_codecs.get_codec(oid, PG_FORMAT_BINARY) # <<<<<<<<<<<<<< * if codec is None: * codec = self._data_codecs.get_codec(oid, PG_FORMAT_TEXT) */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self->_data_codecs, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __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/settings.pyx":72 * if format == PG_FORMAT_ANY: * codec = self._data_codecs.get_codec(oid, PG_FORMAT_BINARY) * if codec is None: # <<<<<<<<<<<<<< * codec = self._data_codecs.get_codec(oid, PG_FORMAT_TEXT) * return codec */ __pyx_t_1 = (((PyObject *)__pyx_v_codec) == Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/settings.pyx":73 * codec = self._data_codecs.get_codec(oid, PG_FORMAT_BINARY) * if codec is None: * codec = self._data_codecs.get_codec(oid, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * return codec * else: */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self->_data_codecs, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __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/settings.pyx":72 * if format == PG_FORMAT_ANY: * codec = self._data_codecs.get_codec(oid, PG_FORMAT_BINARY) * if codec is None: # <<<<<<<<<<<<<< * codec = self._data_codecs.get_codec(oid, PG_FORMAT_TEXT) * return codec */ } /* "asyncpg/protocol/settings.pyx":74 * if codec is None: * codec = self._data_codecs.get_codec(oid, PG_FORMAT_TEXT) * return codec # <<<<<<<<<<<<<< * else: * return self._data_codecs.get_codec(oid, format) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_codec)); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/settings.pyx":70 * cpdef inline Codec get_data_codec(self, uint32_t oid, * ServerDataFormat format=PG_FORMAT_ANY): * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * codec = self._data_codecs.get_codec(oid, PG_FORMAT_BINARY) * if codec is None: */ } /* "asyncpg/protocol/settings.pyx":76 * return codec * else: * return self._data_codecs.get_codec(oid, format) # <<<<<<<<<<<<<< * * def __getattr__(self, name): */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self->_data_codecs, __pyx_v_oid, __pyx_v_format)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; } /* "asyncpg/protocol/settings.pyx":68 * typekind, alias_to) * * cpdef inline Codec get_data_codec(self, uint32_t oid, # <<<<<<<<<<<<<< * ServerDataFormat format=PG_FORMAT_ANY): * if format == PG_FORMAT_ANY: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.get_data_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; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13get_data_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13get_data_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { uint32_t __pyx_v_oid; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_data_codec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oid,&__pyx_n_s_format,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_data_codec") < 0)) __PYX_ERR(1, 68, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_oid = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 68, __pyx_L3_error) if (values[1]) { __pyx_v_format = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 69, __pyx_L3_error) } else { __pyx_v_format = __pyx_k__2; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_data_codec", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 68, __pyx_L3_error) __pyx_L3_error:; __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_12get_data_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_oid, __pyx_v_format); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_12get_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) { 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; __Pyx_RefNannySetupContext("get_data_codec", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.format = __pyx_v_format; __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings->get_data_codec(__pyx_v_self, __pyx_v_oid, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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.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":78 * return self._data_codecs.get_codec(oid, format) * * def __getattr__(self, name): # <<<<<<<<<<<<<< * if not name.startswith('_'): * try: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_14__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_14__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; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("__getattr__", 0); /* "asyncpg/protocol/settings.pyx":79 * * def __getattr__(self, name): * if not name.startswith('_'): # <<<<<<<<<<<<<< * try: * return self._settings[name] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __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(1, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { /* "asyncpg/protocol/settings.pyx":80 * 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_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/settings.pyx":81 * if not name.startswith('_'): * try: * return self._settings[name] # <<<<<<<<<<<<<< * except KeyError: * raise AttributeError(name) from None */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_self->_settings == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 81, __pyx_L4_error) } __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->_settings, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L8_try_return; /* "asyncpg/protocol/settings.pyx":80 * 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":82 * try: * return self._settings[name] * except KeyError: # <<<<<<<<<<<<<< * raise AttributeError(name) from None * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(1, 82, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/settings.pyx":83 * return self._settings[name] * except KeyError: * raise AttributeError(name) from None # <<<<<<<<<<<<<< * * return object.__getattr__(self, name) */ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 83, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_name); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 83, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(1, 83, __pyx_L6_except_error) } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "asyncpg/protocol/settings.pyx":80 * def __getattr__(self, name): * if not name.startswith('_'): * try: # <<<<<<<<<<<<<< * return self._settings[name] * except KeyError: */ __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_L8_try_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; } /* "asyncpg/protocol/settings.pyx":79 * * def __getattr__(self, name): * if not name.startswith('_'): # <<<<<<<<<<<<<< * try: * return self._settings[name] */ } /* "asyncpg/protocol/settings.pyx":85 * raise AttributeError(name) from None * * return object.__getattr__(self, name) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_name}; __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_name}; __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_v_name); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; /* "asyncpg/protocol/settings.pyx":78 * return self._data_codecs.get_codec(oid, format) * * 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_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":87 * return object.__getattr__(self, name) * * def __repr__(self): # <<<<<<<<<<<<<< * return ''.format(self._settings) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_16__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_16__repr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); /* "asyncpg/protocol/settings.pyx":88 * * def __repr__(self): * return ''.format(self._settings) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_ConnectionSettings_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->_settings}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->_settings}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_self->_settings); __Pyx_GIVEREF(__pyx_v_self->_settings); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->_settings); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/settings.pyx":87 * return object.__getattr__(self, name) * * def __repr__(self): # <<<<<<<<<<<<<< * return ''.format(self._settings) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_18__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_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __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, 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_XDECREF(__pyx_t_1); __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_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_20__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_20__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 PyObject *__pyx_t_1 = NULL; __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __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, 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_XDECREF(__pyx_t_1); __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/buffer.pyx":20 * cdef class Memory: * * cdef as_bytes(self): # <<<<<<<<<<<<<< * return cpython.PyBytes_FromStringAndSize(self.buf, self.length) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_6Memory_as_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("as_bytes", 0); /* "asyncpg/protocol/buffer.pyx":21 * * cdef as_bytes(self): * return cpython.PyBytes_FromStringAndSize(self.buf, self.length) # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->buf, __pyx_v_self->length); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":20 * cdef class Memory: * * cdef as_bytes(self): # <<<<<<<<<<<<<< * return cpython.PyBytes_FromStringAndSize(self.buf, self.length) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Memory.as_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":24 * * @staticmethod * cdef inline Memory new(const char* buf, object owner, ssize_t length): # <<<<<<<<<<<<<< * cdef Memory mem * mem = Memory.__new__(Memory) */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_f_7asyncpg_8protocol_8protocol_6Memory_new(char const *__pyx_v_buf, PyObject *__pyx_v_owner, Py_ssize_t __pyx_v_length) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_mem = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("new", 0); /* "asyncpg/protocol/buffer.pyx":26 * cdef inline Memory new(const char* buf, object owner, ssize_t length): * cdef Memory mem * mem = Memory.__new__(Memory) # <<<<<<<<<<<<<< * mem.buf = buf * mem.owner = owner */ __pyx_t_1 = __pyx_tp_new_7asyncpg_8protocol_8protocol_Memory(((PyTypeObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Memory), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_Memory)))) __PYX_ERR(3, 26, __pyx_L1_error) __pyx_v_mem = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":27 * cdef Memory mem * mem = Memory.__new__(Memory) * mem.buf = buf # <<<<<<<<<<<<<< * mem.owner = owner * mem.length = length */ __pyx_v_mem->buf = __pyx_v_buf; /* "asyncpg/protocol/buffer.pyx":28 * mem = Memory.__new__(Memory) * mem.buf = buf * mem.owner = owner # <<<<<<<<<<<<<< * mem.length = length * return mem */ __Pyx_INCREF(__pyx_v_owner); __Pyx_GIVEREF(__pyx_v_owner); __Pyx_GOTREF(__pyx_v_mem->owner); __Pyx_DECREF(__pyx_v_mem->owner); __pyx_v_mem->owner = __pyx_v_owner; /* "asyncpg/protocol/buffer.pyx":29 * mem.buf = buf * mem.owner = owner * mem.length = length # <<<<<<<<<<<<<< * return mem * */ __pyx_v_mem->length = __pyx_v_length; /* "asyncpg/protocol/buffer.pyx":30 * mem.owner = owner * mem.length = length * return mem # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_mem)); __pyx_r = __pyx_v_mem; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":24 * * @staticmethod * cdef inline Memory new(const char* buf, object owner, ssize_t length): # <<<<<<<<<<<<<< * cdef Memory mem * mem = Memory.__new__(Memory) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Memory.new", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mem); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef bint use_setstate * state = (self.buf, self.length, self.owner) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_6Memory_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_6Memory_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_6Memory___reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_6Memory___reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_self) { int __pyx_v_use_setstate; PyObject *__pyx_v_state = NULL; PyObject *__pyx_v__dict = NULL; 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; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":3 * def __reduce_cython__(self): * cdef bint use_setstate * state = (self.buf, self.length, self.owner) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->length); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_INCREF(__pyx_v_self->owner); __Pyx_GIVEREF(__pyx_v_self->owner); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->owner); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_state = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":4 * cdef bint use_setstate * state = (self.buf, self.length, self.owner) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v__dict = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":5 * state = (self.buf, self.length, self.owner) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_4 = (__pyx_v__dict != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "(tree fragment)":6 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "(tree fragment)":7 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self.owner is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":5 * state = (self.buf, self.length, self.owner) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":9 * use_setstate = True * else: * use_setstate = self.owner is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_Memory, (type(self), 0xe0abff4, None), state */ /*else*/ { __pyx_t_5 = (__pyx_v_self->owner != Py_None); __pyx_v_use_setstate = __pyx_t_5; } __pyx_L3:; /* "(tree fragment)":10 * else: * use_setstate = self.owner is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Memory, (type(self), 0xe0abff4, None), state * else: */ __pyx_t_5 = (__pyx_v_use_setstate != 0); if (__pyx_t_5) { /* "(tree fragment)":11 * use_setstate = self.owner is not None * if use_setstate: * return __pyx_unpickle_Memory, (type(self), 0xe0abff4, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_Memory, (type(self), 0xe0abff4, state) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Memory); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_235585524); __Pyx_GIVEREF(__pyx_int_235585524); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_235585524); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "(tree fragment)":10 * else: * use_setstate = self.owner is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Memory, (type(self), 0xe0abff4, None), state * else: */ } /* "(tree fragment)":13 * return __pyx_unpickle_Memory, (type(self), 0xe0abff4, None), state * else: * return __pyx_unpickle_Memory, (type(self), 0xe0abff4, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Memory__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Memory); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_235585524); __Pyx_GIVEREF(__pyx_int_235585524); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_235585524); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef bint use_setstate * state = (self.buf, self.length, self.owner) */ /* 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.Memory.__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)":14 * else: * return __pyx_unpickle_Memory, (type(self), 0xe0abff4, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Memory__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_6Memory_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_6Memory_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_6Memory_2__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_6Memory_2__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":15 * return __pyx_unpickle_Memory, (type(self), 0xe0abff4, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Memory__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 15, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_Memory__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":14 * else: * return __pyx_unpickle_Memory, (type(self), 0xe0abff4, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Memory__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Memory.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":38 * cdef class WriteBuffer: * * def __cinit__(self): # <<<<<<<<<<<<<< * self._smallbuf_inuse = True * self._buf = self._smallbuf */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations char *__pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); /* "asyncpg/protocol/buffer.pyx":39 * * def __cinit__(self): * self._smallbuf_inuse = True # <<<<<<<<<<<<<< * self._buf = self._smallbuf * self._size = _BUFFER_INITIAL_SIZE */ __pyx_v_self->_smallbuf_inuse = 1; /* "asyncpg/protocol/buffer.pyx":40 * 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/protocol/buffer.pyx":41 * 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/protocol/buffer.pyx":42 * self._buf = self._smallbuf * self._size = _BUFFER_INITIAL_SIZE * self._length = 0 # <<<<<<<<<<<<<< * self._message_mode = 0 * */ __pyx_v_self->_length = 0; /* "asyncpg/protocol/buffer.pyx":43 * self._size = _BUFFER_INITIAL_SIZE * self._length = 0 * self._message_mode = 0 # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->_message_mode = 0; /* "asyncpg/protocol/buffer.pyx":38 * cdef class WriteBuffer: * * def __cinit__(self): # <<<<<<<<<<<<<< * self._smallbuf_inuse = True * self._buf = self._smallbuf */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":45 * self._message_mode = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self._buf is not NULL and not self._smallbuf_inuse: * PyMem_Free(self._buf) */ /* Python wrapper */ static void __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_2__dealloc__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_2__dealloc__(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "asyncpg/protocol/buffer.pyx":46 * * def __dealloc__(self): * if self._buf is not NULL and not self._smallbuf_inuse: # <<<<<<<<<<<<<< * PyMem_Free(self._buf) * self._buf = NULL */ __pyx_t_2 = ((__pyx_v_self->_buf != NULL) != 0); 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 != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":47 * def __dealloc__(self): * if self._buf is not NULL and not self._smallbuf_inuse: * PyMem_Free(self._buf) # <<<<<<<<<<<<<< * self._buf = NULL * self._size = 0 */ PyMem_Free(__pyx_v_self->_buf); /* "asyncpg/protocol/buffer.pyx":48 * if self._buf is not NULL and not self._smallbuf_inuse: * PyMem_Free(self._buf) * self._buf = NULL # <<<<<<<<<<<<<< * self._size = 0 * */ __pyx_v_self->_buf = NULL; /* "asyncpg/protocol/buffer.pyx":49 * PyMem_Free(self._buf) * self._buf = NULL * self._size = 0 # <<<<<<<<<<<<<< * * if self._view_count: */ __pyx_v_self->_size = 0; /* "asyncpg/protocol/buffer.pyx":46 * * def __dealloc__(self): * if self._buf is not NULL and not self._smallbuf_inuse: # <<<<<<<<<<<<<< * PyMem_Free(self._buf) * self._buf = NULL */ } /* "asyncpg/protocol/buffer.pyx":51 * self._size = 0 * * if self._view_count: # <<<<<<<<<<<<<< * raise RuntimeError( * 'Deallocating buffer with attached memoryviews') */ __pyx_t_1 = (__pyx_v_self->_view_count != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":52 * * if self._view_count: * raise RuntimeError( # <<<<<<<<<<<<<< * 'Deallocating buffer with attached memoryviews') * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 52, __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(3, 52, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":51 * self._size = 0 * * if self._view_count: # <<<<<<<<<<<<<< * raise RuntimeError( * 'Deallocating buffer with attached memoryviews') */ } /* "asyncpg/protocol/buffer.pyx":45 * self._message_mode = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self._buf is not NULL and not self._smallbuf_inuse: * PyMem_Free(self._buf) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("asyncpg.protocol.protocol.WriteBuffer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "asyncpg/protocol/buffer.pyx":55 * 'Deallocating buffer with attached memoryviews') * * def __getbuffer__(self, Py_buffer *buffer, int flags): # <<<<<<<<<<<<<< * self._view_count += 1 * */ /* Python wrapper */ static CYTHON_UNUSED int __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/ static CYTHON_UNUSED int __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_4__getbuffer__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_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_8protocol_8protocol_11WriteBuffer_4__getbuffer__(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__getbuffer__", 0); if (__pyx_v_buffer != NULL) { __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_buffer->obj); } /* "asyncpg/protocol/buffer.pyx":56 * * def __getbuffer__(self, Py_buffer *buffer, int flags): * self._view_count += 1 # <<<<<<<<<<<<<< * * PyBuffer_FillInfo( */ __pyx_v_self->_view_count = (__pyx_v_self->_view_count + 1); /* "asyncpg/protocol/buffer.pyx":58 * self._view_count += 1 * * 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(3, 58, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":55 * '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.protocol.protocol.WriteBuffer.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_buffer != NULL && __pyx_v_buffer->obj != NULL) { __Pyx_GOTREF(__pyx_v_buffer->obj); __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = NULL; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_buffer != NULL && __pyx_v_buffer->obj == Py_None) { __Pyx_GOTREF(Py_None); __Pyx_DECREF(Py_None); __pyx_v_buffer->obj = NULL; } __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":63 * flags) * * def __releasebuffer__(self, Py_buffer *buffer): # <<<<<<<<<<<<<< * self._view_count -= 1 * */ /* Python wrapper */ static CYTHON_UNUSED void __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/ static CYTHON_UNUSED void __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_6__releasebuffer__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_6__releasebuffer__(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__", 0); /* "asyncpg/protocol/buffer.pyx":64 * * 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/protocol/buffer.pyx":63 * flags) * * def __releasebuffer__(self, Py_buffer *buffer): # <<<<<<<<<<<<<< * self._view_count -= 1 * */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "asyncpg/protocol/buffer.pyx":66 * 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_8protocol_8protocol_11WriteBuffer__check_readonly(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_check_readonly", 0); /* "asyncpg/protocol/buffer.pyx":67 * * 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 (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":68 * cdef inline _check_readonly(self): * if self._view_count: * raise BufferError('the buffer is in read-only mode') # <<<<<<<<<<<<<< * * cdef inline len(self): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 68, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":67 * * cdef inline _check_readonly(self): * if self._view_count: # <<<<<<<<<<<<<< * raise BufferError('the buffer is in read-only mode') * */ } /* "asyncpg/protocol/buffer.pyx":66 * 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_AddTraceback("asyncpg.protocol.protocol.WriteBuffer._check_readonly", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":70 * raise BufferError('the buffer is in read-only mode') * * cdef inline len(self): # <<<<<<<<<<<<<< * return self._length * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_len(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("len", 0); /* "asyncpg/protocol/buffer.pyx":71 * * cdef inline len(self): * return self._length # <<<<<<<<<<<<<< * * cdef inline _ensure_alloced(self, ssize_t extra_length): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":70 * raise BufferError('the buffer is in read-only mode') * * cdef inline len(self): # <<<<<<<<<<<<<< * return self._length * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.WriteBuffer.len", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":73 * return self._length * * 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_8protocol_8protocol_11WriteBuffer__ensure_alloced(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("_ensure_alloced", 0); /* "asyncpg/protocol/buffer.pyx":74 * * 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/protocol/buffer.pyx":76 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":77 * * if new_size > self._size: * self._reallocate(new_size) # <<<<<<<<<<<<<< * * cdef _reallocate(self, ssize_t new_size): */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__reallocate(__pyx_v_self, __pyx_v_new_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":76 * cdef ssize_t new_size = extra_length + self._length * * if new_size > self._size: # <<<<<<<<<<<<<< * self._reallocate(new_size) * */ } /* "asyncpg/protocol/buffer.pyx":73 * return self._length * * 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.protocol.protocol.WriteBuffer._ensure_alloced", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":79 * self._reallocate(new_size) * * cdef _reallocate(self, ssize_t new_size): # <<<<<<<<<<<<<< * cdef char *new_buf * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__reallocate(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("_reallocate", 0); /* "asyncpg/protocol/buffer.pyx":82 * cdef char *new_buf * * if new_size < _BUFFER_MAX_GROW: # <<<<<<<<<<<<<< * new_size = _BUFFER_MAX_GROW * else: */ __pyx_t_1 = ((__pyx_v_new_size < 0x10000) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":83 * * if new_size < _BUFFER_MAX_GROW: * new_size = _BUFFER_MAX_GROW # <<<<<<<<<<<<<< * else: * # Add a little extra */ __pyx_v_new_size = 0x10000; /* "asyncpg/protocol/buffer.pyx":82 * cdef char *new_buf * * if new_size < _BUFFER_MAX_GROW: # <<<<<<<<<<<<<< * new_size = _BUFFER_MAX_GROW * else: */ goto __pyx_L3; } /* "asyncpg/protocol/buffer.pyx":86 * 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/protocol/buffer.pyx":88 * new_size += _BUFFER_INITIAL_SIZE * * if self._smallbuf_inuse: # <<<<<<<<<<<<<< * new_buf = PyMem_Malloc(sizeof(char) * new_size) * if new_buf is NULL: */ __pyx_t_1 = (__pyx_v_self->_smallbuf_inuse != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":89 * * if self._smallbuf_inuse: * new_buf = PyMem_Malloc(sizeof(char) * new_size) # <<<<<<<<<<<<<< * if new_buf is NULL: * self._buf = NULL */ __pyx_v_new_buf = ((char *)PyMem_Malloc(((sizeof(char)) * ((size_t)__pyx_v_new_size)))); /* "asyncpg/protocol/buffer.pyx":90 * if self._smallbuf_inuse: * new_buf = 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":91 * new_buf = PyMem_Malloc(sizeof(char) * new_size) * if new_buf is NULL: * self._buf = NULL # <<<<<<<<<<<<<< * self._size = 0 * self._length = 0 */ __pyx_v_self->_buf = NULL; /* "asyncpg/protocol/buffer.pyx":92 * if new_buf is NULL: * self._buf = NULL * self._size = 0 # <<<<<<<<<<<<<< * self._length = 0 * raise MemoryError */ __pyx_v_self->_size = 0; /* "asyncpg/protocol/buffer.pyx":93 * self._buf = NULL * self._size = 0 * self._length = 0 # <<<<<<<<<<<<<< * raise MemoryError * memcpy(new_buf, self._buf, self._size) */ __pyx_v_self->_length = 0; /* "asyncpg/protocol/buffer.pyx":94 * self._size = 0 * self._length = 0 * raise MemoryError # <<<<<<<<<<<<<< * memcpy(new_buf, self._buf, self._size) * self._size = new_size */ PyErr_NoMemory(); __PYX_ERR(3, 94, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":90 * if self._smallbuf_inuse: * new_buf = PyMem_Malloc(sizeof(char) * new_size) * if new_buf is NULL: # <<<<<<<<<<<<<< * self._buf = NULL * self._size = 0 */ } /* "asyncpg/protocol/buffer.pyx":95 * self._length = 0 * raise MemoryError * memcpy(new_buf, self._buf, self._size) # <<<<<<<<<<<<<< * self._size = new_size * self._buf = new_buf */ memcpy(__pyx_v_new_buf, __pyx_v_self->_buf, ((size_t)__pyx_v_self->_size)); /* "asyncpg/protocol/buffer.pyx":96 * 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/protocol/buffer.pyx":97 * 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/protocol/buffer.pyx":98 * self._size = new_size * self._buf = new_buf * self._smallbuf_inuse = False # <<<<<<<<<<<<<< * else: * new_buf = PyMem_Realloc(self._buf, new_size) */ __pyx_v_self->_smallbuf_inuse = 0; /* "asyncpg/protocol/buffer.pyx":88 * new_size += _BUFFER_INITIAL_SIZE * * if self._smallbuf_inuse: # <<<<<<<<<<<<<< * new_buf = PyMem_Malloc(sizeof(char) * new_size) * if new_buf is NULL: */ goto __pyx_L4; } /* "asyncpg/protocol/buffer.pyx":100 * self._smallbuf_inuse = False * else: * new_buf = PyMem_Realloc(self._buf, new_size) # <<<<<<<<<<<<<< * if new_buf is NULL: * PyMem_Free(self._buf) */ /*else*/ { __pyx_v_new_buf = ((char *)PyMem_Realloc(((void *)__pyx_v_self->_buf), ((size_t)__pyx_v_new_size))); /* "asyncpg/protocol/buffer.pyx":101 * else: * new_buf = PyMem_Realloc(self._buf, new_size) * if new_buf is NULL: # <<<<<<<<<<<<<< * PyMem_Free(self._buf) * self._buf = NULL */ __pyx_t_1 = ((__pyx_v_new_buf == NULL) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":102 * new_buf = PyMem_Realloc(self._buf, new_size) * if new_buf is NULL: * PyMem_Free(self._buf) # <<<<<<<<<<<<<< * self._buf = NULL * self._size = 0 */ PyMem_Free(__pyx_v_self->_buf); /* "asyncpg/protocol/buffer.pyx":103 * if new_buf is NULL: * PyMem_Free(self._buf) * self._buf = NULL # <<<<<<<<<<<<<< * self._size = 0 * self._length = 0 */ __pyx_v_self->_buf = NULL; /* "asyncpg/protocol/buffer.pyx":104 * PyMem_Free(self._buf) * self._buf = NULL * self._size = 0 # <<<<<<<<<<<<<< * self._length = 0 * raise MemoryError */ __pyx_v_self->_size = 0; /* "asyncpg/protocol/buffer.pyx":105 * self._buf = NULL * self._size = 0 * self._length = 0 # <<<<<<<<<<<<<< * raise MemoryError * self._buf = new_buf */ __pyx_v_self->_length = 0; /* "asyncpg/protocol/buffer.pyx":106 * self._size = 0 * self._length = 0 * raise MemoryError # <<<<<<<<<<<<<< * self._buf = new_buf * self._size = new_size */ PyErr_NoMemory(); __PYX_ERR(3, 106, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":101 * else: * new_buf = PyMem_Realloc(self._buf, new_size) * if new_buf is NULL: # <<<<<<<<<<<<<< * PyMem_Free(self._buf) * self._buf = NULL */ } /* "asyncpg/protocol/buffer.pyx":107 * self._length = 0 * raise MemoryError * self._buf = new_buf # <<<<<<<<<<<<<< * self._size = new_size * */ __pyx_v_self->_buf = __pyx_v_new_buf; /* "asyncpg/protocol/buffer.pyx":108 * 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/protocol/buffer.pyx":79 * 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.protocol.protocol.WriteBuffer._reallocate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":110 * 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') */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_start_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("start_message", 0); /* "asyncpg/protocol/buffer.pyx":111 * * 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_1 = ((__pyx_v_self->_length != 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":112 * 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 */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 112, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":111 * * 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) */ } /* "asyncpg/protocol/buffer.pyx":113 * 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 */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__ensure_alloced(__pyx_v_self, 5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":114 * 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 */ __pyx_v_self->_message_mode = 1; /* "asyncpg/protocol/buffer.pyx":115 * self._ensure_alloced(5) * self._message_mode = 1 * self._buf[0] = type # <<<<<<<<<<<<<< * self._length = 5 * */ (__pyx_v_self->_buf[0]) = __pyx_v_type; /* "asyncpg/protocol/buffer.pyx":116 * self._message_mode = 1 * self._buf[0] = type * self._length = 5 # <<<<<<<<<<<<<< * * cdef inline end_message(self): */ __pyx_v_self->_length = 5; /* "asyncpg/protocol/buffer.pyx":110 * 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') */ /* 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.WriteBuffer.start_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":118 * 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_8protocol_8protocol_11WriteBuffer_end_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("end_message", 0); /* "asyncpg/protocol/buffer.pyx":120 * 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/protocol/buffer.pyx":122 * cdef ssize_t mlen = self._length - 1 * * self._check_readonly() # <<<<<<<<<<<<<< * if not self._message_mode: * raise BufferError( */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":123 * * 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 != 0)) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":124 * 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 124, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":123 * * self._check_readonly() * if not self._message_mode: # <<<<<<<<<<<<<< * raise BufferError( * 'end_message can only be called with start_message') */ } /* "asyncpg/protocol/buffer.pyx":126 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":127 * '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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(3, 127, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":126 * 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/protocol/buffer.pyx":128 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":129 * 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 129, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":128 * if self._length < 5: * raise BufferError('end_message: buffer is too small') * if mlen > _MAXINT32: # <<<<<<<<<<<<<< * raise BufferError('end_message: message is too large') * */ } /* "asyncpg/protocol/buffer.pyx":131 * raise BufferError('end_message: message is too large') * * hton.pack_int32(&self._buf[1], mlen) # <<<<<<<<<<<<<< * return self * */ __pyx_f_7asyncpg_8protocol_4hton_pack_int32((&(__pyx_v_self->_buf[1])), ((int32_t)__pyx_v_mlen)); /* "asyncpg/protocol/buffer.pyx":132 * * hton.pack_int32(&self._buf[1], mlen) * return self # <<<<<<<<<<<<<< * * cdef write_buffer(self, WriteBuffer buf): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":118 * 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_AddTraceback("asyncpg.protocol.protocol.WriteBuffer.end_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":134 * return self * * cdef write_buffer(self, WriteBuffer buf): # <<<<<<<<<<<<<< * self._check_readonly() * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; __Pyx_RefNannySetupContext("write_buffer", 0); /* "asyncpg/protocol/buffer.pyx":135 * * cdef write_buffer(self, WriteBuffer buf): * self._check_readonly() # <<<<<<<<<<<<<< * * if not buf._length: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":137 * self._check_readonly() * * if not buf._length: # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = ((!(__pyx_v_buf->_length != 0)) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":138 * * 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/protocol/buffer.pyx":137 * self._check_readonly() * * if not buf._length: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/buffer.pyx":140 * return * * self._ensure_alloced(buf._length) # <<<<<<<<<<<<<< * memcpy(self._buf + self._length, * buf._buf, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__ensure_alloced(__pyx_v_self, __pyx_v_buf->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":141 * * self._ensure_alloced(buf._length) * memcpy(self._buf + self._length, # <<<<<<<<<<<<<< * buf._buf, * buf._length) */ memcpy((__pyx_v_self->_buf + __pyx_v_self->_length), ((void *)__pyx_v_buf->_buf), ((size_t)__pyx_v_buf->_length)); /* "asyncpg/protocol/buffer.pyx":144 * 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/protocol/buffer.pyx":134 * return self * * 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.protocol.protocol.WriteBuffer.write_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":146 * self._length += buf._length * * cdef write_byte(self, char b): # <<<<<<<<<<<<<< * self._check_readonly() * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, char __pyx_v_b) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("write_byte", 0); /* "asyncpg/protocol/buffer.pyx":147 * * cdef write_byte(self, char b): * self._check_readonly() # <<<<<<<<<<<<<< * * self._ensure_alloced(1) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":149 * self._check_readonly() * * self._ensure_alloced(1) # <<<<<<<<<<<<<< * self._buf[self._length] = b * self._length += 1 */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__ensure_alloced(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":150 * * self._ensure_alloced(1) * self._buf[self._length] = b # <<<<<<<<<<<<<< * self._length += 1 * */ (__pyx_v_self->_buf[__pyx_v_self->_length]) = __pyx_v_b; /* "asyncpg/protocol/buffer.pyx":151 * 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/protocol/buffer.pyx":146 * 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.protocol.protocol.WriteBuffer.write_byte", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":153 * self._length += 1 * * cdef write_bytes(self, bytes data): # <<<<<<<<<<<<<< * cdef char* buf * cdef ssize_t len */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("write_bytes", 0); /* "asyncpg/protocol/buffer.pyx":157 * 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(3, 157, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":158 * * cpython.PyBytes_AsStringAndSize(data, &buf, &len) * self.write_cstr(buf, len) # <<<<<<<<<<<<<< * * cdef write_bytestring(self, bytes string): */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_self, __pyx_v_buf, __pyx_v_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":153 * 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.protocol.protocol.WriteBuffer.write_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":160 * self.write_cstr(buf, len) * * cdef write_bytestring(self, bytes string): # <<<<<<<<<<<<<< * cdef char* buf * cdef ssize_t len */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytestring(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("write_bytestring", 0); /* "asyncpg/protocol/buffer.pyx":164 * 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(3, 164, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":167 * # 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_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_self, __pyx_v_buf, (__pyx_v_len + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":160 * 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.protocol.protocol.WriteBuffer.write_bytestring", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":169 * 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_8protocol_8protocol_11WriteBuffer_write_str(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_string, PyObject *__pyx_v_encoding) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("write_str", 0); /* "asyncpg/protocol/buffer.pyx":170 * * cdef write_str(self, str string, str encoding): * self.write_bytestring(string.encode(encoding)) # <<<<<<<<<<<<<< * * cdef write_cstr(self, const char *data, ssize_t len): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_string, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 170, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 170, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_encoding); __Pyx_GIVEREF(__pyx_v_encoding); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_encoding); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 170, __pyx_L1_error) __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytestring(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 170, __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/buffer.pyx":169 * self.write_cstr(buf, len + 1) * * cdef write_str(self, str string, str encoding): # <<<<<<<<<<<<<< * self.write_bytestring(string.encode(encoding)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.WriteBuffer.write_str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":172 * self.write_bytestring(string.encode(encoding)) * * cdef write_cstr(self, const char *data, ssize_t len): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(len) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("write_cstr", 0); /* "asyncpg/protocol/buffer.pyx":173 * * cdef write_cstr(self, const char *data, ssize_t len): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(len) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":174 * 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_8protocol_8protocol_11WriteBuffer__ensure_alloced(__pyx_v_self, __pyx_v_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":176 * self._ensure_alloced(len) * * memcpy(self._buf + self._length, data, len) # <<<<<<<<<<<<<< * self._length += len * */ memcpy((__pyx_v_self->_buf + __pyx_v_self->_length), ((void *)__pyx_v_data), ((size_t)__pyx_v_len)); /* "asyncpg/protocol/buffer.pyx":177 * * 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/protocol/buffer.pyx":172 * self.write_bytestring(string.encode(encoding)) * * 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.protocol.protocol.WriteBuffer.write_cstr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":179 * self._length += len * * cdef write_int16(self, int16_t i): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(2) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, int16_t __pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("write_int16", 0); /* "asyncpg/protocol/buffer.pyx":180 * * cdef write_int16(self, int16_t i): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(2) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":181 * 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_8protocol_8protocol_11WriteBuffer__ensure_alloced(__pyx_v_self, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":183 * self._ensure_alloced(2) * * hton.pack_int16(&self._buf[self._length], i) # <<<<<<<<<<<<<< * self._length += 2 * */ __pyx_f_7asyncpg_8protocol_4hton_pack_int16((&(__pyx_v_self->_buf[__pyx_v_self->_length])), __pyx_v_i); /* "asyncpg/protocol/buffer.pyx":184 * * 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/protocol/buffer.pyx":179 * 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.protocol.protocol.WriteBuffer.write_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":186 * self._length += 2 * * cdef write_int32(self, int32_t i): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(4) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, int32_t __pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("write_int32", 0); /* "asyncpg/protocol/buffer.pyx":187 * * cdef write_int32(self, int32_t i): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(4) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":188 * 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_8protocol_8protocol_11WriteBuffer__ensure_alloced(__pyx_v_self, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":190 * self._ensure_alloced(4) * * hton.pack_int32(&self._buf[self._length], i) # <<<<<<<<<<<<<< * self._length += 4 * */ __pyx_f_7asyncpg_8protocol_4hton_pack_int32((&(__pyx_v_self->_buf[__pyx_v_self->_length])), __pyx_v_i); /* "asyncpg/protocol/buffer.pyx":191 * * 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/protocol/buffer.pyx":186 * 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.protocol.protocol.WriteBuffer.write_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":193 * self._length += 4 * * cdef write_int64(self, int64_t i): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(8) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, int64_t __pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("write_int64", 0); /* "asyncpg/protocol/buffer.pyx":194 * * cdef write_int64(self, int64_t i): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(8) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":195 * 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_8protocol_8protocol_11WriteBuffer__ensure_alloced(__pyx_v_self, 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":197 * self._ensure_alloced(8) * * hton.pack_int64(&self._buf[self._length], i) # <<<<<<<<<<<<<< * self._length += 8 * */ __pyx_f_7asyncpg_8protocol_4hton_pack_int64((&(__pyx_v_self->_buf[__pyx_v_self->_length])), __pyx_v_i); /* "asyncpg/protocol/buffer.pyx":198 * * 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/protocol/buffer.pyx":193 * 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.protocol.protocol.WriteBuffer.write_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":200 * self._length += 8 * * cdef write_float(self, float f): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(4) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_float(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, float __pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("write_float", 0); /* "asyncpg/protocol/buffer.pyx":201 * * cdef write_float(self, float f): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(4) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":202 * 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_8protocol_8protocol_11WriteBuffer__ensure_alloced(__pyx_v_self, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":204 * self._ensure_alloced(4) * * hton.pack_float(&self._buf[self._length], f) # <<<<<<<<<<<<<< * self._length += 4 * */ __pyx_f_7asyncpg_8protocol_4hton_pack_float((&(__pyx_v_self->_buf[__pyx_v_self->_length])), __pyx_v_f); /* "asyncpg/protocol/buffer.pyx":205 * * 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/protocol/buffer.pyx":200 * 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.protocol.protocol.WriteBuffer.write_float", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":207 * self._length += 4 * * cdef write_double(self, double d): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(8) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, double __pyx_v_d) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("write_double", 0); /* "asyncpg/protocol/buffer.pyx":208 * * cdef write_double(self, double d): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(8) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":209 * 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_8protocol_8protocol_11WriteBuffer__ensure_alloced(__pyx_v_self, 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":211 * self._ensure_alloced(8) * * hton.pack_double(&self._buf[self._length], d) # <<<<<<<<<<<<<< * self._length += 8 * */ __pyx_f_7asyncpg_8protocol_4hton_pack_double((&(__pyx_v_self->_buf[__pyx_v_self->_length])), __pyx_v_d); /* "asyncpg/protocol/buffer.pyx":212 * * hton.pack_double(&self._buf[self._length], d) * self._length += 8 # <<<<<<<<<<<<<< * * @staticmethod */ __pyx_v_self->_length = (__pyx_v_self->_length + 8); /* "asyncpg/protocol/buffer.pyx":207 * 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.protocol.protocol.WriteBuffer.write_double", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":215 * * @staticmethod * cdef WriteBuffer new_message(char type): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message(char __pyx_v_type) { struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("new_message", 0); /* "asyncpg/protocol/buffer.pyx":217 * cdef WriteBuffer new_message(char type): * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) # <<<<<<<<<<<<<< * buf.start_message(type) * return buf */ __pyx_t_1 = __pyx_tp_new_7asyncpg_8protocol_8protocol_WriteBuffer(((PyTypeObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_WriteBuffer), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_WriteBuffer)))) __PYX_ERR(3, 217, __pyx_L1_error) __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":218 * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) * buf.start_message(type) # <<<<<<<<<<<<<< * return buf * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_start_message(__pyx_v_buf, __pyx_v_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":219 * 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/protocol/buffer.pyx":215 * * @staticmethod * cdef WriteBuffer new_message(char type): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.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/protocol/buffer.pyx":222 * * @staticmethod * cdef WriteBuffer new(): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new(void) { struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("new", 0); /* "asyncpg/protocol/buffer.pyx":224 * cdef WriteBuffer new(): * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) # <<<<<<<<<<<<<< * return buf * */ __pyx_t_1 = __pyx_tp_new_7asyncpg_8protocol_8protocol_WriteBuffer(((PyTypeObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_WriteBuffer), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_WriteBuffer)))) __PYX_ERR(3, 224, __pyx_L1_error) __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":225 * 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/protocol/buffer.pyx":222 * * @staticmethod * cdef WriteBuffer new(): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.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_8protocol_8protocol_11WriteBuffer_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_8__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __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, 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_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.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_8protocol_8protocol_11WriteBuffer_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_10__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_11WriteBuffer_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __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, 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_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.WriteBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":233 * cdef class ReadBuffer: * * def __cinit__(self): # <<<<<<<<<<<<<< * self._bufs = collections.deque() * self._bufs_append = self._bufs.append */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_10ReadBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_10ReadBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_10ReadBuffer___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_10ReadBuffer___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "asyncpg/protocol/buffer.pyx":234 * * def __cinit__(self): * self._bufs = collections.deque() # <<<<<<<<<<<<<< * self._bufs_append = self._bufs.append * self._bufs_popleft = self._bufs.popleft */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 234, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_bufs); __Pyx_DECREF(__pyx_v_self->_bufs); __pyx_v_self->_bufs = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":235 * def __cinit__(self): * self._bufs = collections.deque() * self._bufs_append = self._bufs.append # <<<<<<<<<<<<<< * self._bufs_popleft = self._bufs.popleft * self._bufs_len = 0 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_bufs, __pyx_n_s_append); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 235, __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/protocol/buffer.pyx":236 * self._bufs = collections.deque() * self._bufs_append = self._bufs.append * self._bufs_popleft = self._bufs.popleft # <<<<<<<<<<<<<< * self._bufs_len = 0 * self._buf0 = None */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_bufs, __pyx_n_s_popleft); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 236, __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/protocol/buffer.pyx":237 * 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/protocol/buffer.pyx":238 * 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/protocol/buffer.pyx":239 * 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/protocol/buffer.pyx":240 * self._buf0 = None * self._buf0_prev = None * self._pos0 = 0 # <<<<<<<<<<<<<< * self._len0 = 0 * self._length = 0 */ __pyx_v_self->_pos0 = 0; /* "asyncpg/protocol/buffer.pyx":241 * self._buf0_prev = None * self._pos0 = 0 * self._len0 = 0 # <<<<<<<<<<<<<< * self._length = 0 * */ __pyx_v_self->_len0 = 0; /* "asyncpg/protocol/buffer.pyx":242 * self._pos0 = 0 * self._len0 = 0 * self._length = 0 # <<<<<<<<<<<<<< * * self._current_message_type = 0 */ __pyx_v_self->_length = 0; /* "asyncpg/protocol/buffer.pyx":244 * 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/protocol/buffer.pyx":245 * * 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/protocol/buffer.pyx":246 * 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/protocol/buffer.pyx":247 * 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/protocol/buffer.pyx":233 * cdef class ReadBuffer: * * def __cinit__(self): # <<<<<<<<<<<<<< * self._bufs = collections.deque() * self._bufs_append = self._bufs.append */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":249 * self._current_message_ready = 0 * * cdef feed_data(self, data): # <<<<<<<<<<<<<< * cdef: * ssize_t dlen */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_feed_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, PyObject *__pyx_v_data) { Py_ssize_t __pyx_v_dlen; PyObject *__pyx_v_data_bytes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("feed_data", 0); /* "asyncpg/protocol/buffer.pyx":254 * bytes data_bytes * * if not cpython.PyBytes_CheckExact(data): # <<<<<<<<<<<<<< * raise BufferError('feed_data: bytes object expected') * data_bytes = data */ __pyx_t_1 = ((!(PyBytes_CheckExact(__pyx_v_data) != 0)) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":255 * * if not cpython.PyBytes_CheckExact(data): * raise BufferError('feed_data: bytes object expected') # <<<<<<<<<<<<<< * data_bytes = data * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 255, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":254 * bytes data_bytes * * if not cpython.PyBytes_CheckExact(data): # <<<<<<<<<<<<<< * raise BufferError('feed_data: bytes object expected') * data_bytes = data */ } /* "asyncpg/protocol/buffer.pyx":256 * if not cpython.PyBytes_CheckExact(data): * raise BufferError('feed_data: bytes object expected') * data_bytes = data # <<<<<<<<<<<<<< * * dlen = cpython.Py_SIZE(data_bytes) */ __pyx_t_3 = __pyx_v_data; __Pyx_INCREF(__pyx_t_3); __pyx_v_data_bytes = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":258 * data_bytes = data * * dlen = cpython.Py_SIZE(data_bytes) # <<<<<<<<<<<<<< * if dlen == 0: * # EOF? */ __pyx_v_dlen = Py_SIZE(__pyx_v_data_bytes); /* "asyncpg/protocol/buffer.pyx":259 * * dlen = cpython.Py_SIZE(data_bytes) * if dlen == 0: # <<<<<<<<<<<<<< * # EOF? * return */ __pyx_t_1 = ((__pyx_v_dlen == 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":261 * 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/protocol/buffer.pyx":259 * * dlen = cpython.Py_SIZE(data_bytes) * if dlen == 0: # <<<<<<<<<<<<<< * # EOF? * return */ } /* "asyncpg/protocol/buffer.pyx":263 * return * * self._bufs_append(data_bytes) # <<<<<<<<<<<<<< * self._length += dlen * */ __Pyx_INCREF(__pyx_v_self->_bufs_append); __pyx_t_2 = __pyx_v_self->_bufs_append; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_data_bytes}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 263, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_data_bytes}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 263, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_data_bytes); __Pyx_GIVEREF(__pyx_v_data_bytes); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_data_bytes); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 263, __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/buffer.pyx":264 * * 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/protocol/buffer.pyx":266 * self._length += dlen * * if self._bufs_len == 0: # <<<<<<<<<<<<<< * # First buffer * self._len0 = dlen */ __pyx_t_1 = ((__pyx_v_self->_bufs_len == 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":268 * if self._bufs_len == 0: * # First buffer * self._len0 = dlen # <<<<<<<<<<<<<< * self._buf0 = data_bytes * */ __pyx_v_self->_len0 = __pyx_v_dlen; /* "asyncpg/protocol/buffer.pyx":269 * # 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/protocol/buffer.pyx":266 * self._length += dlen * * if self._bufs_len == 0: # <<<<<<<<<<<<<< * # First buffer * self._len0 = dlen */ } /* "asyncpg/protocol/buffer.pyx":271 * 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/protocol/buffer.pyx":249 * self._current_message_ready = 0 * * cdef feed_data(self, data): # <<<<<<<<<<<<<< * cdef: * ssize_t dlen */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.feed_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data_bytes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":273 * self._bufs_len += 1 * * cdef inline _ensure_first_buf(self): # <<<<<<<<<<<<<< * if self._len0 == 0: * raise BufferError('empty first buffer') */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_ensure_first_buf", 0); /* "asyncpg/protocol/buffer.pyx":274 * * cdef inline _ensure_first_buf(self): * if self._len0 == 0: # <<<<<<<<<<<<<< * raise BufferError('empty first buffer') * */ __pyx_t_1 = ((__pyx_v_self->_len0 == 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":275 * cdef inline _ensure_first_buf(self): * if self._len0 == 0: * raise BufferError('empty first buffer') # <<<<<<<<<<<<<< * * if self._pos0 == self._len0: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 275, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":274 * * cdef inline _ensure_first_buf(self): * if self._len0 == 0: # <<<<<<<<<<<<<< * raise BufferError('empty first buffer') * */ } /* "asyncpg/protocol/buffer.pyx":277 * raise BufferError('empty first buffer') * * if self._pos0 == self._len0: # <<<<<<<<<<<<<< * self._switch_to_next_buf() * */ __pyx_t_1 = ((__pyx_v_self->_pos0 == __pyx_v_self->_len0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":278 * * if self._pos0 == self._len0: * self._switch_to_next_buf() # <<<<<<<<<<<<<< * * cdef _switch_to_next_buf(self): */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__switch_to_next_buf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":277 * raise BufferError('empty first buffer') * * if self._pos0 == self._len0: # <<<<<<<<<<<<<< * self._switch_to_next_buf() * */ } /* "asyncpg/protocol/buffer.pyx":273 * self._bufs_len += 1 * * cdef inline _ensure_first_buf(self): # <<<<<<<<<<<<<< * if self._len0 == 0: * raise BufferError('empty first buffer') */ /* 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.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/protocol/buffer.pyx":280 * 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_8protocol_8protocol_10ReadBuffer__switch_to_next_buf(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; Py_ssize_t __pyx_t_4; int __pyx_t_5; __Pyx_RefNannySetupContext("_switch_to_next_buf", 0); /* "asyncpg/protocol/buffer.pyx":282 * cdef _switch_to_next_buf(self): * # The first buffer is fully read, discard it * self._bufs_popleft() # <<<<<<<<<<<<<< * self._bufs_len -= 1 * */ __Pyx_INCREF(__pyx_v_self->_bufs_popleft); __pyx_t_2 = __pyx_v_self->_bufs_popleft; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 282, __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/buffer.pyx":283 * # 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/protocol/buffer.pyx":287 * # 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/protocol/buffer.pyx":288 * # in _ensure_first_buf() * self._buf0_prev = self._buf0 * self._buf0 = self._bufs[0] # <<<<<<<<<<<<<< * * self._pos0 = 0 */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->_bufs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_buf0); __Pyx_DECREF(__pyx_v_self->_buf0); __pyx_v_self->_buf0 = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":290 * self._buf0 = self._bufs[0] * * self._pos0 = 0 # <<<<<<<<<<<<<< * self._len0 = len(self._buf0) * */ __pyx_v_self->_pos0 = 0; /* "asyncpg/protocol/buffer.pyx":291 * * self._pos0 = 0 * self._len0 = len(self._buf0) # <<<<<<<<<<<<<< * * if ASYNCPG_DEBUG: */ __pyx_t_2 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(3, 291, __pyx_L1_error) } __pyx_t_4 = PyBytes_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(3, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->_len0 = __pyx_t_4; /* "asyncpg/protocol/buffer.pyx":293 * self._len0 = len(self._buf0) * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if self._len0 < 1: * raise RuntimeError( */ __pyx_t_5 = (ASYNCPG_DEBUG != 0); if (__pyx_t_5) { /* "asyncpg/protocol/buffer.pyx":294 * * if ASYNCPG_DEBUG: * if self._len0 < 1: # <<<<<<<<<<<<<< * raise RuntimeError( * 'debug: second buffer of ReadBuffer is empty') */ __pyx_t_5 = ((__pyx_v_self->_len0 < 1) != 0); if (__pyx_t_5) { /* "asyncpg/protocol/buffer.pyx":295 * if ASYNCPG_DEBUG: * if self._len0 < 1: * raise RuntimeError( # <<<<<<<<<<<<<< * 'debug: second buffer of ReadBuffer is empty') * */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 295, __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(3, 295, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":294 * * if ASYNCPG_DEBUG: * if self._len0 < 1: # <<<<<<<<<<<<<< * raise RuntimeError( * 'debug: second buffer of ReadBuffer is empty') */ } /* "asyncpg/protocol/buffer.pyx":293 * self._len0 = len(self._buf0) * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if self._len0 < 1: * raise RuntimeError( */ } /* "asyncpg/protocol/buffer.pyx":280 * 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.protocol.protocol.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/protocol/buffer.pyx":298 * '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_8protocol_8protocol_10ReadBuffer__try_read_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_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/protocol/buffer.pyx":310 * const char *result * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if nbytes > self._length: * return NULL */ __pyx_t_1 = (ASYNCPG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":311 * * if ASYNCPG_DEBUG: * if nbytes > self._length: # <<<<<<<<<<<<<< * return NULL * */ __pyx_t_1 = ((__pyx_v_nbytes > __pyx_v_self->_length) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":312 * if ASYNCPG_DEBUG: * if nbytes > self._length: * return NULL # <<<<<<<<<<<<<< * * if self._current_message_ready: */ __pyx_r = NULL; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":311 * * if ASYNCPG_DEBUG: * if nbytes > self._length: # <<<<<<<<<<<<<< * return NULL * */ } /* "asyncpg/protocol/buffer.pyx":310 * const char *result * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if nbytes > self._length: * return NULL */ } /* "asyncpg/protocol/buffer.pyx":314 * return NULL * * if self._current_message_ready: # <<<<<<<<<<<<<< * if self._current_message_len_unread < nbytes: * return NULL */ __pyx_t_1 = (__pyx_v_self->_current_message_ready != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":315 * * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":316 * 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/protocol/buffer.pyx":315 * * if self._current_message_ready: * if self._current_message_len_unread < nbytes: # <<<<<<<<<<<<<< * return NULL * */ } /* "asyncpg/protocol/buffer.pyx":314 * return NULL * * if self._current_message_ready: # <<<<<<<<<<<<<< * if self._current_message_len_unread < nbytes: * return NULL */ } /* "asyncpg/protocol/buffer.pyx":318 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":319 * * 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/protocol/buffer.pyx":320 * 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/protocol/buffer.pyx":321 * 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/protocol/buffer.pyx":322 * 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/protocol/buffer.pyx":323 * self._pos0 += nbytes * self._length -= nbytes * if self._current_message_ready: # <<<<<<<<<<<<<< * self._current_message_len_unread -= nbytes * return result */ __pyx_t_1 = (__pyx_v_self->_current_message_ready != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":324 * 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/protocol/buffer.pyx":323 * self._pos0 += nbytes * self._length -= nbytes * if self._current_message_ready: # <<<<<<<<<<<<<< * self._current_message_len_unread -= nbytes * return result */ } /* "asyncpg/protocol/buffer.pyx":325 * 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/protocol/buffer.pyx":318 * return NULL * * if self._pos0 + nbytes <= self._len0: # <<<<<<<<<<<<<< * result = cpython.PyBytes_AS_STRING(self._buf0) * result += self._pos0 */ } /* "asyncpg/protocol/buffer.pyx":327 * return result * else: * return NULL # <<<<<<<<<<<<<< * * cdef inline _read(self, char *buf, ssize_t nbytes): */ /*else*/ { __pyx_r = NULL; goto __pyx_L0; } /* "asyncpg/protocol/buffer.pyx":298 * '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/protocol/buffer.pyx":329 * return NULL * * cdef inline _read(self, char *buf, ssize_t nbytes): # <<<<<<<<<<<<<< * cdef: * ssize_t nread */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__read(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("_read", 0); /* "asyncpg/protocol/buffer.pyx":334 * char *buf0 * * while True: # <<<<<<<<<<<<<< * buf0 = cpython.PyBytes_AS_STRING(self._buf0) * */ while (1) { /* "asyncpg/protocol/buffer.pyx":335 * * 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/protocol/buffer.pyx":337 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":338 * * 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/protocol/buffer.pyx":339 * if self._pos0 + nbytes > self._len0: * nread = self._len0 - self._pos0 * memcpy(buf, buf0 + self._pos0, nread) # <<<<<<<<<<<<<< * self._pos0 = self._len0 * self._length -= nread */ memcpy(__pyx_v_buf, (__pyx_v_buf0 + __pyx_v_self->_pos0), ((size_t)__pyx_v_nread)); /* "asyncpg/protocol/buffer.pyx":340 * 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/protocol/buffer.pyx":341 * 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/protocol/buffer.pyx":342 * 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/protocol/buffer.pyx":343 * self._length -= nread * nbytes -= nread * buf += nread # <<<<<<<<<<<<<< * self._ensure_first_buf() * */ __pyx_v_buf = (__pyx_v_buf + __pyx_v_nread); /* "asyncpg/protocol/buffer.pyx":344 * nbytes -= nread * buf += nread * self._ensure_first_buf() # <<<<<<<<<<<<<< * * else: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":337 * 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/protocol/buffer.pyx":347 * * else: * memcpy(buf, buf0 + self._pos0, nbytes) # <<<<<<<<<<<<<< * self._pos0 += nbytes * self._length -= nbytes */ /*else*/ { memcpy(__pyx_v_buf, (__pyx_v_buf0 + __pyx_v_self->_pos0), ((size_t)__pyx_v_nbytes)); /* "asyncpg/protocol/buffer.pyx":348 * 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/protocol/buffer.pyx":349 * 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/protocol/buffer.pyx":350 * self._pos0 += nbytes * self._length -= nbytes * break # <<<<<<<<<<<<<< * * cdef read(self, ssize_t nbytes): */ goto __pyx_L4_break; } __pyx_L5:; } __pyx_L4_break:; /* "asyncpg/protocol/buffer.pyx":329 * return NULL * * cdef inline _read(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.protocol.protocol.ReadBuffer._read", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":352 * break * * cdef read(self, ssize_t nbytes): # <<<<<<<<<<<<<< * cdef: * bytearray result */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; 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; __Pyx_RefNannySetupContext("read", 0); /* "asyncpg/protocol/buffer.pyx":359 * char *buf * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(nbytes) * if cbuf != NULL: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":360 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(nbytes) # <<<<<<<<<<<<<< * if cbuf != NULL: * return Memory.new(cbuf, self._buf0, nbytes) */ __pyx_v_cbuf = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(__pyx_v_self, __pyx_v_nbytes); /* "asyncpg/protocol/buffer.pyx":361 * self._ensure_first_buf() * cbuf = self._try_read_bytes(nbytes) * if cbuf != NULL: # <<<<<<<<<<<<<< * return Memory.new(cbuf, self._buf0, nbytes) * */ __pyx_t_2 = ((__pyx_v_cbuf != NULL) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":362 * cbuf = self._try_read_bytes(nbytes) * if cbuf != NULL: * return Memory.new(cbuf, self._buf0, nbytes) # <<<<<<<<<<<<<< * * if nbytes > self._length: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_6Memory_new(__pyx_v_cbuf, __pyx_t_1, __pyx_v_nbytes)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 362, __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/protocol/buffer.pyx":361 * self._ensure_first_buf() * cbuf = self._try_read_bytes(nbytes) * if cbuf != NULL: # <<<<<<<<<<<<<< * return Memory.new(cbuf, self._buf0, nbytes) * */ } /* "asyncpg/protocol/buffer.pyx":364 * return Memory.new(cbuf, self._buf0, nbytes) * * if nbytes > self._length: # <<<<<<<<<<<<<< * raise BufferError( * 'not enough data to read {} bytes'.format(nbytes)) */ __pyx_t_2 = ((__pyx_v_nbytes > __pyx_v_self->_length) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":365 * * if nbytes > self._length: * raise BufferError( # <<<<<<<<<<<<<< * 'not enough data to read {} bytes'.format(nbytes)) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/buffer.pyx":366 * if nbytes > self._length: * raise BufferError( * 'not enough data to read {} bytes'.format(nbytes)) # <<<<<<<<<<<<<< * * if self._current_message_ready: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_not_enough_data_to_read_bytes, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 366, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 366, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 365, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 365, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 365, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":364 * return Memory.new(cbuf, self._buf0, nbytes) * * if nbytes > self._length: # <<<<<<<<<<<<<< * raise BufferError( * 'not enough data to read {} bytes'.format(nbytes)) */ } /* "asyncpg/protocol/buffer.pyx":368 * '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: */ __pyx_t_2 = (__pyx_v_self->_current_message_ready != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":369 * * 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/protocol/buffer.pyx":370 * if self._current_message_ready: * self._current_message_len_unread -= nbytes * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError('buffer overread') * */ __pyx_t_2 = ((__pyx_v_self->_current_message_len_unread < 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":371 * self._current_message_len_unread -= nbytes * if self._current_message_len_unread < 0: * raise BufferError('buffer overread') # <<<<<<<<<<<<<< * * result = PyByteArray_FromStringAndSize(NULL, nbytes) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(3, 371, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":370 * if self._current_message_ready: * self._current_message_len_unread -= nbytes * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError('buffer overread') * */ } /* "asyncpg/protocol/buffer.pyx":368 * '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/protocol/buffer.pyx":373 * raise BufferError('buffer overread') * * result = PyByteArray_FromStringAndSize(NULL, nbytes) # <<<<<<<<<<<<<< * buf = PyByteArray_AsString(result) * self._read(buf, nbytes) */ __pyx_t_1 = PyByteArray_FromStringAndSize(NULL, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyByteArray_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytearray", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 373, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":374 * * result = PyByteArray_FromStringAndSize(NULL, nbytes) * buf = PyByteArray_AsString(result) # <<<<<<<<<<<<<< * self._read(buf, nbytes) * */ __pyx_v_buf = PyByteArray_AsString(__pyx_v_result); /* "asyncpg/protocol/buffer.pyx":375 * result = PyByteArray_FromStringAndSize(NULL, nbytes) * buf = PyByteArray_AsString(result) * self._read(buf, nbytes) # <<<<<<<<<<<<<< * * return Memory.new(buf, result, nbytes) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__read(__pyx_v_self, __pyx_v_buf, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":377 * self._read(buf, nbytes) * * return Memory.new(buf, result, nbytes) # <<<<<<<<<<<<<< * * cdef inline read_byte(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_6Memory_new(__pyx_v_buf, __pyx_v_result, __pyx_v_nbytes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":352 * break * * cdef read(self, ssize_t nbytes): # <<<<<<<<<<<<<< * cdef: * bytearray result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.read", __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/protocol/buffer.pyx":379 * return Memory.new(buf, result, nbytes) * * cdef inline read_byte(self): # <<<<<<<<<<<<<< * cdef const char *first_byte * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_byte(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { char const *__pyx_v_first_byte; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("read_byte", 0); /* "asyncpg/protocol/buffer.pyx":382 * cdef const char *first_byte * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if not self._buf0: * raise RuntimeError( */ __pyx_t_1 = (ASYNCPG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":383 * * if ASYNCPG_DEBUG: * if not self._buf0: # <<<<<<<<<<<<<< * raise RuntimeError( * 'debug: first buffer of ReadBuffer is empty') */ __pyx_t_1 = (__pyx_v_self->_buf0 != Py_None) && (PyBytes_GET_SIZE(__pyx_v_self->_buf0) != 0); __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":384 * if ASYNCPG_DEBUG: * if not self._buf0: * raise RuntimeError( # <<<<<<<<<<<<<< * 'debug: first buffer of ReadBuffer is empty') * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 384, __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(3, 384, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":383 * * if ASYNCPG_DEBUG: * if not self._buf0: # <<<<<<<<<<<<<< * raise RuntimeError( * 'debug: first buffer of ReadBuffer is empty') */ } /* "asyncpg/protocol/buffer.pyx":382 * cdef const char *first_byte * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if not self._buf0: * raise RuntimeError( */ } /* "asyncpg/protocol/buffer.pyx":387 * '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_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":388 * * 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_v_first_byte = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(__pyx_v_self, 1); /* "asyncpg/protocol/buffer.pyx":389 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":390 * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(3, 390, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":389 * 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/protocol/buffer.pyx":392 * raise BufferError('not enough data to read one byte') * * return first_byte[0] # <<<<<<<<<<<<<< * * cdef inline const char* read_bytes(self, ssize_t n) except NULL: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_char((__pyx_v_first_byte[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":379 * return Memory.new(buf, result, nbytes) * * cdef inline read_byte(self): # <<<<<<<<<<<<<< * cdef const char *first_byte * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.read_byte", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":394 * return first_byte[0] * * cdef inline const char* read_bytes(self, ssize_t n) except NULL: # <<<<<<<<<<<<<< * cdef: * Memory mem */ static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_bytes(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_n) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_mem = 0; char const *__pyx_v_cbuf; char const *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("read_bytes", 0); /* "asyncpg/protocol/buffer.pyx":399 * const char *cbuf * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(n) * if cbuf != NULL: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":400 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(n) # <<<<<<<<<<<<<< * if cbuf != NULL: * return cbuf */ __pyx_v_cbuf = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(__pyx_v_self, __pyx_v_n); /* "asyncpg/protocol/buffer.pyx":401 * self._ensure_first_buf() * cbuf = self._try_read_bytes(n) * if cbuf != NULL: # <<<<<<<<<<<<<< * return cbuf * else: */ __pyx_t_2 = ((__pyx_v_cbuf != NULL) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":402 * cbuf = self._try_read_bytes(n) * if cbuf != NULL: * return cbuf # <<<<<<<<<<<<<< * else: * mem = (self.read(n)) */ __pyx_r = __pyx_v_cbuf; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":401 * self._ensure_first_buf() * cbuf = self._try_read_bytes(n) * if cbuf != NULL: # <<<<<<<<<<<<<< * return cbuf * else: */ } /* "asyncpg/protocol/buffer.pyx":404 * return cbuf * else: * mem = (self.read(n)) # <<<<<<<<<<<<<< * return mem.buf * */ /*else*/ { __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read(__pyx_v_self, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 404, __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_v_mem = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":405 * else: * mem = (self.read(n)) * return mem.buf # <<<<<<<<<<<<<< * * cdef inline read_int32(self): */ __pyx_r = __pyx_v_mem->buf; goto __pyx_L0; } /* "asyncpg/protocol/buffer.pyx":394 * return first_byte[0] * * cdef inline const char* read_bytes(self, ssize_t n) except NULL: # <<<<<<<<<<<<<< * cdef: * Memory mem */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mem); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":407 * return mem.buf * * cdef inline read_int32(self): # <<<<<<<<<<<<<< * cdef: * Memory mem */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_mem = 0; char const *__pyx_v_cbuf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("read_int32", 0); /* "asyncpg/protocol/buffer.pyx":412 * const char *cbuf * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(4) * if cbuf != NULL: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":413 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) # <<<<<<<<<<<<<< * if cbuf != NULL: * return hton.unpack_int32(cbuf) */ __pyx_v_cbuf = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(__pyx_v_self, 4); /* "asyncpg/protocol/buffer.pyx":414 * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int32(cbuf) * else: */ __pyx_t_2 = ((__pyx_v_cbuf != NULL) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":415 * cbuf = self._try_read_bytes(4) * if cbuf != NULL: * return hton.unpack_int32(cbuf) # <<<<<<<<<<<<<< * else: * mem = (self.read(4)) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_v_cbuf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":414 * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int32(cbuf) * else: */ } /* "asyncpg/protocol/buffer.pyx":417 * return hton.unpack_int32(cbuf) * else: * mem = (self.read(4)) # <<<<<<<<<<<<<< * return hton.unpack_int32(mem.buf) * */ /*else*/ { __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read(__pyx_v_self, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 417, __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_v_mem = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":418 * else: * mem = (self.read(4)) * return hton.unpack_int32(mem.buf) # <<<<<<<<<<<<<< * * cdef inline read_int16(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_v_mem->buf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "asyncpg/protocol/buffer.pyx":407 * return mem.buf * * cdef inline read_int32(self): # <<<<<<<<<<<<<< * cdef: * Memory mem */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.read_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":420 * return hton.unpack_int32(mem.buf) * * cdef inline read_int16(self): # <<<<<<<<<<<<<< * cdef: * Memory mem */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int16(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_mem = 0; char const *__pyx_v_cbuf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("read_int16", 0); /* "asyncpg/protocol/buffer.pyx":425 * const char *cbuf * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(2) * if cbuf != NULL: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":426 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(2) # <<<<<<<<<<<<<< * if cbuf != NULL: * return hton.unpack_int16(cbuf) */ __pyx_v_cbuf = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(__pyx_v_self, 2); /* "asyncpg/protocol/buffer.pyx":427 * self._ensure_first_buf() * cbuf = self._try_read_bytes(2) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int16(cbuf) * else: */ __pyx_t_2 = ((__pyx_v_cbuf != NULL) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":428 * cbuf = self._try_read_bytes(2) * if cbuf != NULL: * return hton.unpack_int16(cbuf) # <<<<<<<<<<<<<< * else: * mem = (self.read(2)) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_f_7asyncpg_8protocol_4hton_unpack_int16(__pyx_v_cbuf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":427 * self._ensure_first_buf() * cbuf = self._try_read_bytes(2) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int16(cbuf) * else: */ } /* "asyncpg/protocol/buffer.pyx":430 * return hton.unpack_int16(cbuf) * else: * mem = (self.read(2)) # <<<<<<<<<<<<<< * return hton.unpack_int16(mem.buf) * */ /*else*/ { __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read(__pyx_v_self, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 430, __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_v_mem = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":431 * else: * mem = (self.read(2)) * return hton.unpack_int16(mem.buf) # <<<<<<<<<<<<<< * * cdef inline read_cstr(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_int16_t(__pyx_f_7asyncpg_8protocol_4hton_unpack_int16(__pyx_v_mem->buf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "asyncpg/protocol/buffer.pyx":420 * return hton.unpack_int32(mem.buf) * * cdef inline read_int16(self): # <<<<<<<<<<<<<< * cdef: * Memory mem */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.read_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":433 * return hton.unpack_int16(mem.buf) * * cdef inline read_cstr(self): # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError( */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; __Pyx_RefNannySetupContext("read_cstr", 0); /* "asyncpg/protocol/buffer.pyx":434 * * cdef inline read_cstr(self): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError( * 'read_cstr only works when the message guaranteed ' */ __pyx_t_1 = ((!(__pyx_v_self->_current_message_ready != 0)) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":435 * cdef inline read_cstr(self): * if not self._current_message_ready: * raise BufferError( # <<<<<<<<<<<<<< * 'read_cstr only works when the message guaranteed ' * 'to be in the buffer') */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 435, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":434 * * cdef inline read_cstr(self): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError( * 'read_cstr only works when the message guaranteed ' */ } /* "asyncpg/protocol/buffer.pyx":446 * const char *buf_start * * self._ensure_first_buf() # <<<<<<<<<<<<<< * * buf_start = cpython.PyBytes_AS_STRING(self._buf0) */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":448 * 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_3 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_3); __pyx_v_buf_start = PyBytes_AS_STRING(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":449 * * 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/protocol/buffer.pyx":450 * 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) != 0); if (!__pyx_t_1) break; /* "asyncpg/protocol/buffer.pyx":451 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":452 * 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/protocol/buffer.pyx":453 * 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/protocol/buffer.pyx":454 * 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_v_buf = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(__pyx_v_self, (__pyx_v_nread + 1)); /* "asyncpg/protocol/buffer.pyx":455 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":456 * buf = self._try_read_bytes(nread + 1) * if buf != NULL: * return cpython.PyBytes_FromStringAndSize(buf, nread) # <<<<<<<<<<<<<< * else: * break */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_buf, __pyx_v_nread); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":455 * nread = pos - self._pos0 * buf = self._try_read_bytes(nread + 1) * if buf != NULL: # <<<<<<<<<<<<<< * return cpython.PyBytes_FromStringAndSize(buf, nread) * else: */ } /* "asyncpg/protocol/buffer.pyx":458 * return cpython.PyBytes_FromStringAndSize(buf, nread) * else: * break # <<<<<<<<<<<<<< * else: * buf += 1 */ /*else*/ { goto __pyx_L5_break; } /* "asyncpg/protocol/buffer.pyx":451 * buf = buf_start + self._pos0 * while buf - buf_start < self._len0: * if buf[0] == 0: # <<<<<<<<<<<<<< * pos = buf - buf_start * nread = pos - self._pos0 */ } /* "asyncpg/protocol/buffer.pyx":460 * break * else: * buf += 1 # <<<<<<<<<<<<<< * * result = b'' */ /*else*/ { __pyx_v_buf = (__pyx_v_buf + 1); } } __pyx_L5_break:; /* "asyncpg/protocol/buffer.pyx":462 * buf += 1 * * result = b'' # <<<<<<<<<<<<<< * while True: * pos = self._buf0.find(b'\x00', self._pos0) */ __Pyx_INCREF(__pyx_kp_b__22); __pyx_v_result = __pyx_kp_b__22; /* "asyncpg/protocol/buffer.pyx":463 * * result = b'' * while True: # <<<<<<<<<<<<<< * pos = self._buf0.find(b'\x00', self._pos0) * if pos >= 0: */ while (1) { /* "asyncpg/protocol/buffer.pyx":464 * result = b'' * while True: * pos = self._buf0.find(b'\x00', self._pos0) # <<<<<<<<<<<<<< * if pos >= 0: * result += self._buf0[self._pos0 : pos] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_buf0, __pyx_n_s_find); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_self->_pos0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_b__23, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 464, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_b__23, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 464, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_kp_b__23); __Pyx_GIVEREF(__pyx_kp_b__23); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_b__23); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = PyInt_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_pos = __pyx_t_8; /* "asyncpg/protocol/buffer.pyx":465 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":466 * 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(3, 466, __pyx_L1_error) } __pyx_t_3 = PySequence_GetSlice(__pyx_v_self->_buf0, __pyx_v_self->_pos0, __pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":467 * 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/protocol/buffer.pyx":468 * 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/protocol/buffer.pyx":469 * 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/protocol/buffer.pyx":471 * self._length -= nread * * self._current_message_len_unread -= nread # <<<<<<<<<<<<<< * if self._current_message_len_unread < 0: * raise BufferError('read_cstr: buffer overread') */ __pyx_v_self->_current_message_len_unread = (__pyx_v_self->_current_message_len_unread - __pyx_v_nread); /* "asyncpg/protocol/buffer.pyx":472 * * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError('read_cstr: buffer overread') * */ __pyx_t_1 = ((__pyx_v_self->_current_message_len_unread < 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":473 * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: * raise BufferError('read_cstr: buffer overread') # <<<<<<<<<<<<<< * * return result */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 473, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":472 * * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError('read_cstr: buffer overread') * */ } /* "asyncpg/protocol/buffer.pyx":475 * raise BufferError('read_cstr: buffer overread') * * return result # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":465 * 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/protocol/buffer.pyx":478 * * 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(3, 478, __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(3, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":479 * 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/protocol/buffer.pyx":480 * result += self._buf0[self._pos0:] * nread = self._len0 - self._pos0 * self._pos0 = self._len0 # <<<<<<<<<<<<<< * self._length -= nread * */ __pyx_t_8 = __pyx_v_self->_len0; __pyx_v_self->_pos0 = __pyx_t_8; /* "asyncpg/protocol/buffer.pyx":481 * 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/protocol/buffer.pyx":483 * self._length -= nread * * self._current_message_len_unread -= nread # <<<<<<<<<<<<<< * if self._current_message_len_unread < 0: * raise BufferError('read_cstr: buffer overread') */ __pyx_v_self->_current_message_len_unread = (__pyx_v_self->_current_message_len_unread - __pyx_v_nread); /* "asyncpg/protocol/buffer.pyx":484 * * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError('read_cstr: buffer overread') * */ __pyx_t_1 = ((__pyx_v_self->_current_message_len_unread < 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":485 * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: * raise BufferError('read_cstr: buffer overread') # <<<<<<<<<<<<<< * * self._ensure_first_buf() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 485, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":484 * * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError('read_cstr: buffer overread') * */ } /* "asyncpg/protocol/buffer.pyx":487 * raise BufferError('read_cstr: buffer overread') * * self._ensure_first_buf() # <<<<<<<<<<<<<< * * cdef int32_t has_message(self) except -1: */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* "asyncpg/protocol/buffer.pyx":433 * return hton.unpack_int16(mem.buf) * * cdef inline read_cstr(self): # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError( */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.read_cstr", __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/protocol/buffer.pyx":489 * self._ensure_first_buf() * * cdef int32_t has_message(self) except -1: # <<<<<<<<<<<<<< * cdef: * const char *cbuf */ static int32_t __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { char const *__pyx_v_cbuf; int32_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; __Pyx_RefNannySetupContext("has_message", 0); /* "asyncpg/protocol/buffer.pyx":493 * const char *cbuf * * if self._current_message_ready: # <<<<<<<<<<<<<< * return 1 * */ __pyx_t_1 = (__pyx_v_self->_current_message_ready != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":494 * * if self._current_message_ready: * return 1 # <<<<<<<<<<<<<< * * if self._current_message_type == 0: */ __pyx_r = 1; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":493 * const char *cbuf * * if self._current_message_ready: # <<<<<<<<<<<<<< * return 1 * */ } /* "asyncpg/protocol/buffer.pyx":496 * return 1 * * if self._current_message_type == 0: # <<<<<<<<<<<<<< * if self._length < 1: * return 0 */ __pyx_t_1 = ((__pyx_v_self->_current_message_type == 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":497 * * if self._current_message_type == 0: * if self._length < 1: # <<<<<<<<<<<<<< * return 0 * self._ensure_first_buf() */ __pyx_t_1 = ((__pyx_v_self->_length < 1) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":498 * 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/protocol/buffer.pyx":497 * * if self._current_message_type == 0: * if self._length < 1: # <<<<<<<<<<<<<< * return 0 * self._ensure_first_buf() */ } /* "asyncpg/protocol/buffer.pyx":499 * 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_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":500 * return 0 * self._ensure_first_buf() * cbuf = self._try_read_bytes(1) # <<<<<<<<<<<<<< * if cbuf == NULL: * raise BufferError( */ __pyx_v_cbuf = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(__pyx_v_self, 1); /* "asyncpg/protocol/buffer.pyx":501 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":502 * 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 502, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":501 * 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/protocol/buffer.pyx":504 * 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/protocol/buffer.pyx":496 * return 1 * * if self._current_message_type == 0: # <<<<<<<<<<<<<< * if self._length < 1: * return 0 */ } /* "asyncpg/protocol/buffer.pyx":506 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":507 * * if self._current_message_len == 0: * if self._length < 4: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = ((__pyx_v_self->_length < 4) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":508 * if self._current_message_len == 0: * if self._length < 4: * return 0 # <<<<<<<<<<<<<< * * self._ensure_first_buf() */ __pyx_r = 0; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":507 * * if self._current_message_len == 0: * if self._length < 4: # <<<<<<<<<<<<<< * return 0 * */ } /* "asyncpg/protocol/buffer.pyx":510 * return 0 * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(4) * if cbuf != NULL: */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":511 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) # <<<<<<<<<<<<<< * if cbuf != NULL: * self._current_message_len = hton.unpack_int32(cbuf) */ __pyx_v_cbuf = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(__pyx_v_self, 4); /* "asyncpg/protocol/buffer.pyx":512 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":513 * 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 = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_v_cbuf); /* "asyncpg/protocol/buffer.pyx":512 * 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/protocol/buffer.pyx":515 * 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_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 515, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->_current_message_len = __pyx_t_4; } __pyx_L9:; /* "asyncpg/protocol/buffer.pyx":517 * 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/protocol/buffer.pyx":506 * self._current_message_type = cbuf[0] * * if self._current_message_len == 0: # <<<<<<<<<<<<<< * if self._length < 4: * return 0 */ } /* "asyncpg/protocol/buffer.pyx":519 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":520 * * if self._length < self._current_message_len_unread: * return 0 # <<<<<<<<<<<<<< * * self._current_message_ready = 1 */ __pyx_r = 0; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":519 * self._current_message_len_unread = self._current_message_len - 4 * * if self._length < self._current_message_len_unread: # <<<<<<<<<<<<<< * return 0 * */ } /* "asyncpg/protocol/buffer.pyx":522 * return 0 * * self._current_message_ready = 1 # <<<<<<<<<<<<<< * return 1 * */ __pyx_v_self->_current_message_ready = 1; /* "asyncpg/protocol/buffer.pyx":523 * * self._current_message_ready = 1 * return 1 # <<<<<<<<<<<<<< * * cdef inline int32_t has_message_type(self, char mtype) except -1: */ __pyx_r = 1; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":489 * self._ensure_first_buf() * * cdef int32_t has_message(self) except -1: # <<<<<<<<<<<<<< * cdef: * const char *cbuf */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.has_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":525 * return 1 * * cdef inline int32_t has_message_type(self, char mtype) except -1: # <<<<<<<<<<<<<< * return self.has_message() and self.get_message_type() == mtype * */ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message_type(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, char __pyx_v_mtype) { int32_t __pyx_r; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; int32_t __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("has_message_type", 0); /* "asyncpg/protocol/buffer.pyx":526 * * cdef inline int32_t has_message_type(self, char mtype) except -1: * return self.has_message() and self.get_message_type() == mtype # <<<<<<<<<<<<<< * * cdef inline const char* try_consume_message(self, ssize_t* len): */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(3, 526, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = (__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_type(__pyx_v_self) == __pyx_v_mtype); __pyx_t_1 = __pyx_t_3; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":525 * return 1 * * cdef inline int32_t has_message_type(self, char mtype) except -1: # <<<<<<<<<<<<<< * return self.has_message() and self.get_message_type() == mtype * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.has_message_type", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":528 * return self.has_message() and self.get_message_type() == mtype * * cdef inline const char* try_consume_message(self, ssize_t* len): # <<<<<<<<<<<<<< * cdef: * ssize_t buf_len */ static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_try_consume_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("try_consume_message", 0); /* "asyncpg/protocol/buffer.pyx":533 * const char *buf * * if not self._current_message_ready: # <<<<<<<<<<<<<< * return NULL * */ __pyx_t_1 = ((!(__pyx_v_self->_current_message_ready != 0)) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":534 * * if not self._current_message_ready: * return NULL # <<<<<<<<<<<<<< * * self._ensure_first_buf() */ __pyx_r = NULL; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":533 * const char *buf * * if not self._current_message_ready: # <<<<<<<<<<<<<< * return NULL * */ } /* "asyncpg/protocol/buffer.pyx":536 * 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_8protocol_8protocol_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":537 * * 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/protocol/buffer.pyx":538 * 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_v_buf = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes(__pyx_v_self, __pyx_v_buf_len); /* "asyncpg/protocol/buffer.pyx":539 * buf_len = self._current_message_len_unread * buf = self._try_read_bytes(buf_len) * if buf != NULL: # <<<<<<<<<<<<<< * len[0] = buf_len * self._discard_message() */ __pyx_t_1 = ((__pyx_v_buf != NULL) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":540 * buf = self._try_read_bytes(buf_len) * if buf != NULL: * len[0] = buf_len # <<<<<<<<<<<<<< * self._discard_message() * return buf */ (__pyx_v_len[0]) = __pyx_v_buf_len; /* "asyncpg/protocol/buffer.pyx":541 * if buf != NULL: * len[0] = buf_len * self._discard_message() # <<<<<<<<<<<<<< * return buf * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__discard_message(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":539 * buf_len = self._current_message_len_unread * buf = self._try_read_bytes(buf_len) * if buf != NULL: # <<<<<<<<<<<<<< * len[0] = buf_len * self._discard_message() */ } /* "asyncpg/protocol/buffer.pyx":542 * len[0] = buf_len * self._discard_message() * return buf # <<<<<<<<<<<<<< * * cdef Memory consume_message(self): */ __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":528 * return self.has_message() and self.get_message_type() == mtype * * 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_WriteUnraisable("asyncpg.protocol.protocol.ReadBuffer.try_consume_message", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":544 * return buf * * cdef Memory consume_message(self): # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError('no message to consume') */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { PyObject *__pyx_v_mem = NULL; struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("consume_message", 0); /* "asyncpg/protocol/buffer.pyx":545 * * cdef Memory 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 != 0)) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":546 * cdef Memory 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(self._current_message_len_unread) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 546, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":545 * * cdef Memory consume_message(self): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError('no message to consume') * if self._current_message_len_unread > 0: */ } /* "asyncpg/protocol/buffer.pyx":547 * if not self._current_message_ready: * raise BufferError('no message to consume') * if self._current_message_len_unread > 0: # <<<<<<<<<<<<<< * mem = self.read(self._current_message_len_unread) * else: */ __pyx_t_1 = ((__pyx_v_self->_current_message_len_unread > 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":548 * raise BufferError('no message to consume') * if self._current_message_len_unread > 0: * mem = self.read(self._current_message_len_unread) # <<<<<<<<<<<<<< * else: * mem = None */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read(__pyx_v_self, __pyx_v_self->_current_message_len_unread); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_mem = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":547 * if not self._current_message_ready: * raise BufferError('no message to consume') * if self._current_message_len_unread > 0: # <<<<<<<<<<<<<< * mem = self.read(self._current_message_len_unread) * else: */ goto __pyx_L4; } /* "asyncpg/protocol/buffer.pyx":550 * mem = self.read(self._current_message_len_unread) * else: * mem = None # <<<<<<<<<<<<<< * self._discard_message() * return mem */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_mem = Py_None; } __pyx_L4:; /* "asyncpg/protocol/buffer.pyx":551 * else: * mem = None * self._discard_message() # <<<<<<<<<<<<<< * return mem * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__discard_message(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":552 * mem = None * self._discard_message() * return mem # <<<<<<<<<<<<<< * * cdef bytearray consume_messages(self, char mtype): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); if (!(likely(((__pyx_v_mem) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mem, __pyx_ptype_7asyncpg_8protocol_8protocol_Memory))))) __PYX_ERR(3, 552, __pyx_L1_error) __Pyx_INCREF(__pyx_v_mem); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_v_mem); goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":544 * return buf * * cdef Memory 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_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.consume_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mem); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":554 * return mem * * cdef bytearray consume_messages(self, char mtype): # <<<<<<<<<<<<<< * """Consume consecutive messages of the same type.""" * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_messages(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("consume_messages", 0); /* "asyncpg/protocol/buffer.pyx":559 * char *buf * ssize_t nbytes * ssize_t total_bytes = 0 # <<<<<<<<<<<<<< * bytearray result * */ __pyx_v_total_bytes = 0; /* "asyncpg/protocol/buffer.pyx":562 * bytearray result * * if not self.has_message_type(mtype): # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message_type(__pyx_v_self, __pyx_v_mtype); if (unlikely(__pyx_t_1 == ((int32_t)-1))) __PYX_ERR(3, 562, __pyx_L1_error) __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/buffer.pyx":563 * * if not self.has_message_type(mtype): * return None # <<<<<<<<<<<<<< * * # consume_messages is a volume-oriented method, so */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = ((PyObject*)Py_None); goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":562 * bytearray result * * if not self.has_message_type(mtype): # <<<<<<<<<<<<<< * return None * */ } /* "asyncpg/protocol/buffer.pyx":568 * # we assume that the remainder of the buffer will contain * # messages of the requested type. * result = PyByteArray_FromStringAndSize(NULL, self._length) # <<<<<<<<<<<<<< * buf = PyByteArray_AsString(result) * */ __pyx_t_3 = PyByteArray_FromStringAndSize(NULL, __pyx_v_self->_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyByteArray_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytearray", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 568, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":569 * # messages of the requested type. * result = PyByteArray_FromStringAndSize(NULL, self._length) * buf = PyByteArray_AsString(result) # <<<<<<<<<<<<<< * * while self.has_message_type(mtype): */ __pyx_v_buf = PyByteArray_AsString(__pyx_v_result); /* "asyncpg/protocol/buffer.pyx":571 * buf = PyByteArray_AsString(result) * * while self.has_message_type(mtype): # <<<<<<<<<<<<<< * nbytes = self._current_message_len_unread * self._read(buf, nbytes) */ while (1) { __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message_type(__pyx_v_self, __pyx_v_mtype); if (unlikely(__pyx_t_1 == ((int32_t)-1))) __PYX_ERR(3, 571, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/buffer.pyx":572 * * while self.has_message_type(mtype): * nbytes = self._current_message_len_unread # <<<<<<<<<<<<<< * self._read(buf, nbytes) * buf += nbytes */ __pyx_t_4 = __pyx_v_self->_current_message_len_unread; __pyx_v_nbytes = __pyx_t_4; /* "asyncpg/protocol/buffer.pyx":573 * while self.has_message_type(mtype): * nbytes = self._current_message_len_unread * self._read(buf, nbytes) # <<<<<<<<<<<<<< * buf += nbytes * total_bytes += nbytes */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__read(__pyx_v_self, __pyx_v_buf, __pyx_v_nbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":574 * nbytes = self._current_message_len_unread * self._read(buf, nbytes) * buf += nbytes # <<<<<<<<<<<<<< * total_bytes += nbytes * self._discard_message() */ __pyx_v_buf = (__pyx_v_buf + __pyx_v_nbytes); /* "asyncpg/protocol/buffer.pyx":575 * self._read(buf, nbytes) * buf += nbytes * total_bytes += nbytes # <<<<<<<<<<<<<< * self._discard_message() * */ __pyx_v_total_bytes = (__pyx_v_total_bytes + __pyx_v_nbytes); /* "asyncpg/protocol/buffer.pyx":576 * buf += nbytes * total_bytes += nbytes * self._discard_message() # <<<<<<<<<<<<<< * * # Clamp the result to an actual size read. */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__discard_message(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/protocol/buffer.pyx":579 * * # Clamp the result to an actual size read. * PyByteArray_Resize(result, total_bytes) # <<<<<<<<<<<<<< * * return result */ PyByteArray_Resize(__pyx_v_result, __pyx_v_total_bytes); /* "asyncpg/protocol/buffer.pyx":581 * PyByteArray_Resize(result, total_bytes) * * return result # <<<<<<<<<<<<<< * * cdef discard_message(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":554 * return mem * * 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.protocol.protocol.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/protocol/buffer.pyx":583 * return result * * cdef discard_message(self): # <<<<<<<<<<<<<< * if self._current_message_type == 0: * # Already discarded */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_discard_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { PyObject *__pyx_v_mtype = NULL; struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_discarded = 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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("discard_message", 0); /* "asyncpg/protocol/buffer.pyx":584 * * cdef discard_message(self): * if self._current_message_type == 0: # <<<<<<<<<<<<<< * # Already discarded * return */ __pyx_t_1 = ((__pyx_v_self->_current_message_type == 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":586 * if self._current_message_type == 0: * # Already discarded * return # <<<<<<<<<<<<<< * * if not self._current_message_ready: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":584 * * cdef discard_message(self): * if self._current_message_type == 0: # <<<<<<<<<<<<<< * # Already discarded * return */ } /* "asyncpg/protocol/buffer.pyx":588 * return * * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError('no message to discard') * */ __pyx_t_1 = ((!(__pyx_v_self->_current_message_ready != 0)) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":589 * * if not self._current_message_ready: * raise BufferError('no message to discard') # <<<<<<<<<<<<<< * * if self._current_message_len_unread: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 589, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":588 * return * * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError('no message to discard') * */ } /* "asyncpg/protocol/buffer.pyx":591 * raise BufferError('no message to discard') * * if self._current_message_len_unread: # <<<<<<<<<<<<<< * if ASYNCPG_DEBUG: * mtype = chr(self._current_message_type) */ __pyx_t_1 = (__pyx_v_self->_current_message_len_unread != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":592 * * if self._current_message_len_unread: * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * mtype = chr(self._current_message_type) * */ __pyx_t_1 = (ASYNCPG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":593 * if self._current_message_len_unread: * if ASYNCPG_DEBUG: * mtype = chr(self._current_message_type) # <<<<<<<<<<<<<< * * discarded = self.consume_message() */ __pyx_t_3 = __Pyx_PyInt_From_char(__pyx_v_self->_current_message_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_mtype = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":592 * * if self._current_message_len_unread: * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * mtype = chr(self._current_message_type) * */ } /* "asyncpg/protocol/buffer.pyx":595 * mtype = chr(self._current_message_type) * * discarded = self.consume_message() # <<<<<<<<<<<<<< * * if ASYNCPG_DEBUG: */ __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_discarded = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":597 * discarded = self.consume_message() * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, */ __pyx_t_1 = (ASYNCPG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":598 * * if ASYNCPG_DEBUG: * print('!!! discarding message {!r} unread data: {!r}'.format( # <<<<<<<<<<<<<< * mtype, * (discarded).as_bytes())) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_discarding_message_r_unread_dat, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/buffer.pyx":599 * if ASYNCPG_DEBUG: * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, # <<<<<<<<<<<<<< * (discarded).as_bytes())) * */ if (unlikely(!__pyx_v_mtype)) { __Pyx_RaiseUnboundLocalError("mtype"); __PYX_ERR(3, 599, __pyx_L1_error) } /* "asyncpg/protocol/buffer.pyx":600 * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, * (discarded).as_bytes())) # <<<<<<<<<<<<<< * * self._discard_message() */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_6Memory_as_bytes(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_v_discarded)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_mtype, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 598, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_mtype, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 598, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_mtype); __Pyx_GIVEREF(__pyx_v_mtype); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_mtype); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":598 * * if ASYNCPG_DEBUG: * print('!!! discarding message {!r} unread data: {!r}'.format( # <<<<<<<<<<<<<< * mtype, * (discarded).as_bytes())) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 598, __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/buffer.pyx":597 * discarded = self.consume_message() * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, */ } /* "asyncpg/protocol/buffer.pyx":591 * raise BufferError('no message to discard') * * if self._current_message_len_unread: # <<<<<<<<<<<<<< * if ASYNCPG_DEBUG: * mtype = chr(self._current_message_type) */ } /* "asyncpg/protocol/buffer.pyx":602 * (discarded).as_bytes())) * * self._discard_message() # <<<<<<<<<<<<<< * * cdef inline _discard_message(self): */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__discard_message(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/buffer.pyx":583 * return result * * cdef discard_message(self): # <<<<<<<<<<<<<< * if self._current_message_type == 0: * # Already discarded */ /* 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.protocol.protocol.ReadBuffer.discard_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mtype); __Pyx_XDECREF((PyObject *)__pyx_v_discarded); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":604 * self._discard_message() * * cdef inline _discard_message(self): # <<<<<<<<<<<<<< * self._current_message_type = 0 * self._current_message_len = 0 */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__discard_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_discard_message", 0); /* "asyncpg/protocol/buffer.pyx":605 * * cdef inline _discard_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/protocol/buffer.pyx":606 * cdef inline _discard_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/protocol/buffer.pyx":607 * 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/protocol/buffer.pyx":608 * self._current_message_len = 0 * self._current_message_ready = 0 * self._current_message_len_unread = 0 # <<<<<<<<<<<<<< * * cdef inline char get_message_type(self): */ __pyx_v_self->_current_message_len_unread = 0; /* "asyncpg/protocol/buffer.pyx":604 * self._discard_message() * * cdef inline _discard_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/protocol/buffer.pyx":610 * self._current_message_len_unread = 0 * * cdef inline char get_message_type(self): # <<<<<<<<<<<<<< * return self._current_message_type * */ static CYTHON_INLINE char __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { char __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_message_type", 0); /* "asyncpg/protocol/buffer.pyx":611 * * 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/protocol/buffer.pyx":610 * self._current_message_len_unread = 0 * * cdef inline char get_message_type(self): # <<<<<<<<<<<<<< * return self._current_message_type * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":613 * 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_8protocol_8protocol_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { int32_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_message_length", 0); /* "asyncpg/protocol/buffer.pyx":614 * * cdef inline int32_t get_message_length(self): * return self._current_message_len # <<<<<<<<<<<<<< * * @staticmethod */ __pyx_r = __pyx_v_self->_current_message_len; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":613 * return self._current_message_type * * cdef inline int32_t get_message_length(self): # <<<<<<<<<<<<<< * return self._current_message_len * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":617 * * @staticmethod * cdef ReadBuffer new_message_parser(object data): # <<<<<<<<<<<<<< * cdef ReadBuffer buf * */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_new_message_parser(PyObject *__pyx_v_data) { struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; __Pyx_RefNannySetupContext("new_message_parser", 0); /* "asyncpg/protocol/buffer.pyx":620 * cdef ReadBuffer buf * * buf = ReadBuffer.__new__(ReadBuffer) # <<<<<<<<<<<<<< * buf.feed_data(data) * */ __pyx_t_1 = __pyx_tp_new_7asyncpg_8protocol_8protocol_ReadBuffer(((PyTypeObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ReadBuffer), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_ReadBuffer)))) __PYX_ERR(3, 620, __pyx_L1_error) __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":621 * * buf = ReadBuffer.__new__(ReadBuffer) * buf.feed_data(data) # <<<<<<<<<<<<<< * * buf._current_message_ready = 1 */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_feed_data(__pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/buffer.pyx":623 * buf.feed_data(data) * * buf._current_message_ready = 1 # <<<<<<<<<<<<<< * buf._current_message_len_unread = buf._len0 * */ __pyx_v_buf->_current_message_ready = 1; /* "asyncpg/protocol/buffer.pyx":624 * * 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/protocol/buffer.pyx":626 * 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/protocol/buffer.pyx":617 * * @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.protocol.protocol.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_8protocol_8protocol_10ReadBuffer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_10ReadBuffer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_10ReadBuffer_2__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_10ReadBuffer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __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, 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_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.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_8protocol_8protocol_10ReadBuffer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_10ReadBuffer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_10ReadBuffer_4__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_10ReadBuffer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __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, 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_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ReadBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":634 * cdef class FastReadBuffer: * * cdef inline const char* read(self, ssize_t n) except NULL: # <<<<<<<<<<<<<< * cdef const char *result * */ static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_n) { char const *__pyx_v_result; char const *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; char const *__pyx_t_3; __Pyx_RefNannySetupContext("read", 0); /* "asyncpg/protocol/buffer.pyx":637 * cdef const char *result * * if n > self.len: # <<<<<<<<<<<<<< * self._raise_ins_err(n, self.len) * */ __pyx_t_1 = ((__pyx_v_n > __pyx_v_self->len) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/buffer.pyx":638 * * if n > self.len: * self._raise_ins_err(n, self.len) # <<<<<<<<<<<<<< * * result = self.buf */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer__raise_ins_err(__pyx_v_self, __pyx_v_n, __pyx_v_self->len); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/buffer.pyx":637 * cdef const char *result * * if n > self.len: # <<<<<<<<<<<<<< * self._raise_ins_err(n, self.len) * */ } /* "asyncpg/protocol/buffer.pyx":640 * self._raise_ins_err(n, self.len) * * result = self.buf # <<<<<<<<<<<<<< * self.buf += n * self.len -= n */ __pyx_t_3 = __pyx_v_self->buf; __pyx_v_result = __pyx_t_3; /* "asyncpg/protocol/buffer.pyx":641 * * result = self.buf * self.buf += n # <<<<<<<<<<<<<< * self.len -= n * */ __pyx_v_self->buf = (__pyx_v_self->buf + __pyx_v_n); /* "asyncpg/protocol/buffer.pyx":642 * result = self.buf * self.buf += n * self.len -= n # <<<<<<<<<<<<<< * * return result */ __pyx_v_self->len = (__pyx_v_self->len - __pyx_v_n); /* "asyncpg/protocol/buffer.pyx":644 * self.len -= n * * return result # <<<<<<<<<<<<<< * * cdef inline const char* read_all(self): */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":634 * cdef class FastReadBuffer: * * cdef inline const char* read(self, ssize_t n) except NULL: # <<<<<<<<<<<<<< * cdef const char *result * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.FastReadBuffer.read", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":646 * return result * * cdef inline const char* read_all(self): # <<<<<<<<<<<<<< * cdef const char *result * result = self.buf */ static CYTHON_INLINE char const *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read_all(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self) { char const *__pyx_v_result; char const *__pyx_r; __Pyx_RefNannyDeclarations char const *__pyx_t_1; __Pyx_RefNannySetupContext("read_all", 0); /* "asyncpg/protocol/buffer.pyx":648 * cdef inline const char* read_all(self): * cdef const char *result * result = self.buf # <<<<<<<<<<<<<< * self.buf += self.len * self.len = 0 */ __pyx_t_1 = __pyx_v_self->buf; __pyx_v_result = __pyx_t_1; /* "asyncpg/protocol/buffer.pyx":649 * cdef const char *result * result = self.buf * self.buf += self.len # <<<<<<<<<<<<<< * self.len = 0 * return result */ __pyx_v_self->buf = (__pyx_v_self->buf + __pyx_v_self->len); /* "asyncpg/protocol/buffer.pyx":650 * result = self.buf * self.buf += self.len * self.len = 0 # <<<<<<<<<<<<<< * return result * */ __pyx_v_self->len = 0; /* "asyncpg/protocol/buffer.pyx":651 * self.buf += self.len * self.len = 0 * return result # <<<<<<<<<<<<<< * * cdef inline FastReadBuffer slice_from(self, FastReadBuffer source, */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":646 * return result * * cdef inline const char* read_all(self): # <<<<<<<<<<<<<< * cdef const char *result * result = self.buf */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":653 * return result * * cdef inline FastReadBuffer slice_from(self, FastReadBuffer source, # <<<<<<<<<<<<<< * ssize_t len): * self.buf = source.read(len) */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_slice_from(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_source, Py_ssize_t __pyx_v_len) { struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; __Pyx_RefNannySetupContext("slice_from", 0); /* "asyncpg/protocol/buffer.pyx":655 * cdef inline FastReadBuffer slice_from(self, FastReadBuffer source, * ssize_t len): * self.buf = source.read(len) # <<<<<<<<<<<<<< * self.len = len * return self */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_source, __pyx_v_len); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(3, 655, __pyx_L1_error) __pyx_v_self->buf = __pyx_t_1; /* "asyncpg/protocol/buffer.pyx":656 * ssize_t len): * self.buf = source.read(len) * self.len = len # <<<<<<<<<<<<<< * return self * */ __pyx_v_self->len = __pyx_v_len; /* "asyncpg/protocol/buffer.pyx":657 * self.buf = source.read(len) * self.len = len * return self # <<<<<<<<<<<<<< * * cdef _raise_ins_err(self, ssize_t n, ssize_t len): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":653 * return result * * cdef inline FastReadBuffer slice_from(self, FastReadBuffer source, # <<<<<<<<<<<<<< * ssize_t len): * self.buf = source.read(len) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.FastReadBuffer.slice_from", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":659 * return self * * cdef _raise_ins_err(self, ssize_t n, ssize_t len): # <<<<<<<<<<<<<< * raise BufferError( * 'insufficient data in buffer: requested {}, remaining {}'. */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer__raise_ins_err(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_n, CYTHON_UNUSED Py_ssize_t __pyx_v_len) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("_raise_ins_err", 0); /* "asyncpg/protocol/buffer.pyx":660 * * cdef _raise_ins_err(self, ssize_t n, ssize_t len): * raise BufferError( # <<<<<<<<<<<<<< * 'insufficient data in buffer: requested {}, remaining {}'. * format(n, self.len)) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/buffer.pyx":661 * cdef _raise_ins_err(self, ssize_t n, ssize_t len): * raise BufferError( * 'insufficient data in buffer: requested {}, remaining {}'. # <<<<<<<<<<<<<< * format(n, self.len)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_insufficient_data_in_buffer_requ, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/buffer.pyx":662 * raise BufferError( * 'insufficient data in buffer: requested {}, remaining {}'. * format(n, self.len)) # <<<<<<<<<<<<<< * * @staticmethod */ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_self->len); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 662, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 662, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 660, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 660, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 660, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(3, 660, __pyx_L1_error) /* "asyncpg/protocol/buffer.pyx":659 * return self * * cdef _raise_ins_err(self, ssize_t n, ssize_t len): # <<<<<<<<<<<<<< * raise BufferError( * 'insufficient data in buffer: requested {}, remaining {}'. */ /* 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_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.FastReadBuffer._raise_ins_err", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/buffer.pyx":665 * * @staticmethod * cdef FastReadBuffer new(): # <<<<<<<<<<<<<< * return FastReadBuffer.__new__(FastReadBuffer) */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_new(void) { struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("new", 0); /* "asyncpg/protocol/buffer.pyx":666 * @staticmethod * cdef FastReadBuffer new(): * return FastReadBuffer.__new__(FastReadBuffer) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = __pyx_tp_new_7asyncpg_8protocol_8protocol_FastReadBuffer(((PyTypeObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_FastReadBuffer), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_FastReadBuffer)))) __PYX_ERR(3, 666, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/buffer.pyx":665 * * @staticmethod * cdef FastReadBuffer new(): # <<<<<<<<<<<<<< * return FastReadBuffer.__new__(FastReadBuffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.FastReadBuffer.new", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef bint use_setstate * state = (self.buf, self.len) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_14FastReadBuffer_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_14FastReadBuffer_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_14FastReadBuffer___reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_14FastReadBuffer___reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self) { int __pyx_v_use_setstate; PyObject *__pyx_v_state = NULL; PyObject *__pyx_v__dict = NULL; 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; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":3 * def __reduce_cython__(self): * cdef bint use_setstate * state = (self.buf, self.len) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_state = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":4 * cdef bint use_setstate * state = (self.buf, self.len) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v__dict = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":5 * state = (self.buf, self.len) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_4 = (__pyx_v__dict != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "(tree fragment)":6 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict); __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":7 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = False */ __pyx_v_use_setstate = 1; /* "(tree fragment)":5 * state = (self.buf, self.len) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":9 * use_setstate = True * else: * use_setstate = False # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_FastReadBuffer, (type(self), 0x7ea5e72, None), state */ /*else*/ { __pyx_v_use_setstate = 0; } __pyx_L3:; /* "(tree fragment)":10 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_FastReadBuffer, (type(self), 0x7ea5e72, None), state * else: */ __pyx_t_5 = (__pyx_v_use_setstate != 0); if (__pyx_t_5) { /* "(tree fragment)":11 * use_setstate = False * if use_setstate: * return __pyx_unpickle_FastReadBuffer, (type(self), 0x7ea5e72, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_FastReadBuffer, (type(self), 0x7ea5e72, state) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FastReadBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_132800114); __Pyx_GIVEREF(__pyx_int_132800114); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_132800114); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "(tree fragment)":10 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_FastReadBuffer, (type(self), 0x7ea5e72, None), state * else: */ } /* "(tree fragment)":13 * return __pyx_unpickle_FastReadBuffer, (type(self), 0x7ea5e72, None), state * else: * return __pyx_unpickle_FastReadBuffer, (type(self), 0x7ea5e72, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_FastReadBuffer__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FastReadBuffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_132800114); __Pyx_GIVEREF(__pyx_int_132800114); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_132800114); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef bint use_setstate * state = (self.buf, self.len) */ /* 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.FastReadBuffer.__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)":14 * else: * return __pyx_unpickle_FastReadBuffer, (type(self), 0x7ea5e72, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_FastReadBuffer__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_14FastReadBuffer_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_14FastReadBuffer_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_14FastReadBuffer_2__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_14FastReadBuffer_2__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":15 * return __pyx_unpickle_FastReadBuffer, (type(self), 0x7ea5e72, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_FastReadBuffer__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 15, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_FastReadBuffer__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":14 * else: * return __pyx_unpickle_FastReadBuffer, (type(self), 0x7ea5e72, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_FastReadBuffer__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.FastReadBuffer.__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":17 * 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; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oid,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 17, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_oid = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 17, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 17, __pyx_L3_error) __pyx_L3_error:; __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 */ __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; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "asyncpg/protocol/codecs/base.pyx":18 * * 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":19 * def __cinit__(self, uint32_t oid): * self.oid = oid * self.type = CODEC_UNDEFINED # <<<<<<<<<<<<<< * * cdef init(self, str name, str schema, str kind, */ __pyx_v_self->type = __pyx_e_7asyncpg_8protocol_8protocol_CODEC_UNDEFINED; /* "asyncpg/protocol/codecs/base.pyx":17 * cdef class Codec: * * def __cinit__(self, uint32_t oid): # <<<<<<<<<<<<<< * self.oid = oid * self.type = CODEC_UNDEFINED */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":21 * self.type = CODEC_UNDEFINED * * cdef init(self, str name, str schema, str kind, # <<<<<<<<<<<<<< * CodecType type, ServerDataFormat format, * ClientExchangeFormat xformat, */ 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, 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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("init", 0); /* "asyncpg/protocol/codecs/base.pyx":30 * Py_UCS4 element_delimiter): * * 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":31 * * 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":32 * 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":33 * 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":34 * 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":35 * 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":36 * self.format = format * self.xformat = xformat * self.c_encoder = c_encoder # <<<<<<<<<<<<<< * self.c_decoder = c_decoder * self.py_encoder = py_encoder */ __pyx_v_self->c_encoder = __pyx_v_c_encoder; /* "asyncpg/protocol/codecs/base.pyx":37 * self.xformat = xformat * self.c_encoder = c_encoder * self.c_decoder = c_decoder # <<<<<<<<<<<<<< * self.py_encoder = py_encoder * self.py_decoder = py_decoder */ __pyx_v_self->c_decoder = __pyx_v_c_decoder; /* "asyncpg/protocol/codecs/base.pyx":38 * self.c_encoder = c_encoder * self.c_decoder = c_decoder * 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":39 * self.c_decoder = c_decoder * 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":40 * 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(__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":41 * 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":42 * 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_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":43 * self.element_type_oids = element_type_oids * self.element_codecs = element_codecs * self.element_delimiter = element_delimiter # <<<<<<<<<<<<<< * * if element_names is not None: */ __pyx_v_self->element_delimiter = __pyx_v_element_delimiter; /* "asyncpg/protocol/codecs/base.pyx":45 * self.element_delimiter = element_delimiter * * if element_names is not None: # <<<<<<<<<<<<<< * self.element_names = record.ApgRecordDesc_New( * element_names, tuple(element_names)) */ __pyx_t_1 = (__pyx_v_element_names != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/base.pyx":47 * if element_names is not None: * self.element_names = record.ApgRecordDesc_New( * element_names, tuple(element_names)) # <<<<<<<<<<<<<< * else: * self.element_names = None */ __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_element_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/base.pyx":46 * * if element_names is not None: * self.element_names = record.ApgRecordDesc_New( # <<<<<<<<<<<<<< * element_names, tuple(element_names)) * else: */ __pyx_t_4 = ApgRecordDesc_New(__pyx_v_element_names, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->element_names); __Pyx_DECREF(__pyx_v_self->element_names); __pyx_v_self->element_names = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":45 * self.element_delimiter = element_delimiter * * if element_names is not None: # <<<<<<<<<<<<<< * self.element_names = record.ApgRecordDesc_New( * element_names, tuple(element_names)) */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":49 * element_names, tuple(element_names)) * else: * self.element_names = None # <<<<<<<<<<<<<< * * if type == CODEC_C: */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->element_names); __Pyx_DECREF(__pyx_v_self->element_names); __pyx_v_self->element_names = Py_None; } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":51 * self.element_names = 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":52 * * 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":53 * 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":51 * self.element_names = None * * if type == CODEC_C: # <<<<<<<<<<<<<< * self.encoder = &self.encode_scalar * self.decoder = &self.decode_scalar */ break; /* "asyncpg/protocol/codecs/base.pyx":54 * self.encoder = &self.encode_scalar * self.decoder = &self.decode_scalar * elif type == CODEC_ARRAY: # <<<<<<<<<<<<<< * if format == PG_FORMAT_BINARY: * self.encoder = &self.encode_array */ case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY: /* "asyncpg/protocol/codecs/base.pyx":55 * 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_2 = ((__pyx_v_format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/base.pyx":56 * 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":57 * 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":55 * 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_L4; } /* "asyncpg/protocol/codecs/base.pyx":59 * 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":60 * 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_L4:; /* "asyncpg/protocol/codecs/base.pyx":54 * 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; /* "asyncpg/protocol/codecs/base.pyx":61 * self.encoder = &self.encode_array_text * self.decoder = &self.decode_array_text * elif type == CODEC_RANGE: # <<<<<<<<<<<<<< * if format != PG_FORMAT_BINARY: * raise RuntimeError( */ case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE: /* "asyncpg/protocol/codecs/base.pyx":62 * self.decoder = &self.decode_array_text * elif type == CODEC_RANGE: * if format != PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * raise RuntimeError( * 'cannot encode type "{}"."{}": text encoding of ' */ __pyx_t_2 = ((__pyx_v_format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/base.pyx":65 * raise RuntimeError( * 'cannot encode type "{}"."{}": text encoding of ' * 'range types is not supported'.format(schema, name)) # <<<<<<<<<<<<<< * self.encoder = &self.encode_range * self.decoder = &self.decode_range */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_encode_type_text_encoding, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_schema, __pyx_v_name}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 65, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_schema, __pyx_v_name}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 65, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_schema); __Pyx_GIVEREF(__pyx_v_schema); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_schema); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":63 * elif type == CODEC_RANGE: * if format != PG_FORMAT_BINARY: * raise RuntimeError( # <<<<<<<<<<<<<< * 'cannot encode type "{}"."{}": text encoding of ' * 'range types is not supported'.format(schema, name)) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 63, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":62 * self.decoder = &self.decode_array_text * elif type == CODEC_RANGE: * if format != PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * raise RuntimeError( * 'cannot encode type "{}"."{}": text encoding of ' */ } /* "asyncpg/protocol/codecs/base.pyx":66 * 'cannot encode 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_COMPOSITE: */ __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":67 * 'range types is not supported'.format(schema, name)) * self.encoder = &self.encode_range * self.decoder = &self.decode_range # <<<<<<<<<<<<<< * 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_range)); /* "asyncpg/protocol/codecs/base.pyx":61 * self.encoder = &self.encode_array_text * self.decoder = &self.decode_array_text * elif type == CODEC_RANGE: # <<<<<<<<<<<<<< * if format != PG_FORMAT_BINARY: * raise RuntimeError( */ break; /* "asyncpg/protocol/codecs/base.pyx":68 * self.encoder = &self.encode_range * self.decoder = &self.decode_range * elif type == CODEC_COMPOSITE: # <<<<<<<<<<<<<< * if format != PG_FORMAT_BINARY: * raise RuntimeError( */ case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE: /* "asyncpg/protocol/codecs/base.pyx":69 * self.decoder = &self.decode_range * elif type == CODEC_COMPOSITE: * if format != PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * raise RuntimeError( * 'cannot encode type "{}"."{}": text encoding of ' */ __pyx_t_2 = ((__pyx_v_format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/base.pyx":72 * raise RuntimeError( * 'cannot encode type "{}"."{}": text encoding of ' * 'composite types is not supported'.format(schema, name)) # <<<<<<<<<<<<<< * self.encoder = &self.encode_composite * self.decoder = &self.decode_composite */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_encode_type_text_encoding_2, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_schema, __pyx_v_name}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 72, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_schema, __pyx_v_name}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 72, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_schema); __Pyx_GIVEREF(__pyx_v_schema); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_schema); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_name); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":70 * elif type == CODEC_COMPOSITE: * if format != PG_FORMAT_BINARY: * raise RuntimeError( # <<<<<<<<<<<<<< * 'cannot encode type "{}"."{}": text encoding of ' * 'composite types is not supported'.format(schema, name)) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 70, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":69 * self.decoder = &self.decode_range * elif type == CODEC_COMPOSITE: * if format != PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * raise RuntimeError( * 'cannot encode type "{}"."{}": text encoding of ' */ } /* "asyncpg/protocol/codecs/base.pyx":73 * 'cannot encode 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":74 * '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":68 * self.encoder = &self.encode_range * self.decoder = &self.decode_range * elif type == CODEC_COMPOSITE: # <<<<<<<<<<<<<< * if format != PG_FORMAT_BINARY: * raise RuntimeError( */ break; /* "asyncpg/protocol/codecs/base.pyx":75 * 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 */ case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_PY: /* "asyncpg/protocol/codecs/base.pyx":76 * 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":77 * elif type == CODEC_PY: * self.encoder = &self.encode_in_python * self.decoder = &self.decode_in_python # <<<<<<<<<<<<<< * else: * raise RuntimeError('unexpected codec type: {}'.format(type)) */ __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":75 * 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":79 * self.decoder = &self.decode_in_python * else: * raise RuntimeError('unexpected codec type: {}'.format(type)) # <<<<<<<<<<<<<< * * cdef Codec copy(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_codec_type, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(__pyx_v_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 79, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 79, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 79, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":21 * self.type = CODEC_UNDEFINED * * cdef init(self, str name, str schema, str kind, # <<<<<<<<<<<<<< * CodecType type, ServerDataFormat format, * ClientExchangeFormat xformat, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.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":81 * raise RuntimeError('unexpected codec type: {}'.format(type)) * * cdef Codec copy(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("copy", 0); /* "asyncpg/protocol/codecs/base.pyx":84 * cdef Codec codec * * codec = Codec(self.oid) # <<<<<<<<<<<<<< * codec.init(self.name, self.schema, self.kind, * self.type, self.format, self.xformat, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":85 * * codec = Codec(self.oid) * codec.init(self.name, self.schema, self.kind, # <<<<<<<<<<<<<< * self.type, self.format, self.xformat, * self.c_encoder, self.c_decoder, */ __pyx_t_1 = __pyx_v_self->name; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_v_self->schema; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_v_self->kind; __Pyx_INCREF(__pyx_t_3); /* "asyncpg/protocol/codecs/base.pyx":88 * self.type, self.format, self.xformat, * self.c_encoder, self.c_decoder, * self.py_encoder, self.py_decoder, # <<<<<<<<<<<<<< * self.element_codec, * self.element_type_oids, self.element_names, */ __pyx_t_4 = __pyx_v_self->py_encoder; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = __pyx_v_self->py_decoder; __Pyx_INCREF(__pyx_t_5); /* "asyncpg/protocol/codecs/base.pyx":89 * self.c_encoder, self.c_decoder, * self.py_encoder, self.py_decoder, * self.element_codec, # <<<<<<<<<<<<<< * self.element_type_oids, self.element_names, * self.element_codecs, self.element_delimiter) */ __pyx_t_6 = ((PyObject *)__pyx_v_self->element_codec); __Pyx_INCREF(__pyx_t_6); /* "asyncpg/protocol/codecs/base.pyx":90 * self.py_encoder, self.py_decoder, * self.element_codec, * self.element_type_oids, self.element_names, # <<<<<<<<<<<<<< * self.element_codecs, self.element_delimiter) * */ __pyx_t_7 = __pyx_v_self->element_type_oids; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = __pyx_v_self->element_names; __Pyx_INCREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":91 * self.element_codec, * self.element_type_oids, self.element_names, * self.element_codecs, self.element_delimiter) # <<<<<<<<<<<<<< * * return codec */ __pyx_t_9 = __pyx_v_self->element_codecs; __Pyx_INCREF(__pyx_t_9); /* "asyncpg/protocol/codecs/base.pyx":85 * * codec = Codec(self.oid) * codec.init(self.name, self.schema, self.kind, # <<<<<<<<<<<<<< * self.type, self.format, self.xformat, * self.c_encoder, self.c_decoder, */ __pyx_t_10 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_3), __pyx_v_self->type, __pyx_v_self->format, __pyx_v_self->xformat, __pyx_v_self->c_encoder, __pyx_v_self->c_decoder, __pyx_t_4, __pyx_t_5, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_6), ((PyObject*)__pyx_t_7), __pyx_t_8, ((PyObject*)__pyx_t_9), __pyx_v_self->element_delimiter); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __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; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":93 * 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":81 * raise RuntimeError('unexpected codec type: {}'.format(type)) * * cdef Codec copy(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_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":95 * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("encode_scalar", 0); /* "asyncpg/protocol/codecs/base.pyx":97 * 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(4, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":95 * 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":99 * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("encode_array", 0); /* "asyncpg/protocol/codecs/base.pyx":101 * 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(4, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":99 * 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":105 * (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_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("encode_array_text", 0); /* "asyncpg/protocol/codecs/base.pyx":107 * 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":110 * 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(4, 107, __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":105 * (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":112 * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("encode_range", 0); /* "asyncpg/protocol/codecs/base.pyx":114 * 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(4, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":112 * 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":118 * (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_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_elem_data = 0; int __pyx_v_i; PyObject *__pyx_v_elem_codecs = 0; Py_ssize_t __pyx_v_count; PyObject *__pyx_v_item = 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)(PyObject *); PyObject *__pyx_t_5 = NULL; int32_t __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("encode_composite", 0); /* "asyncpg/protocol/codecs/base.pyx":123 * WriteBuffer elem_data * int i * list elem_codecs = self.element_codecs # <<<<<<<<<<<<<< * ssize_t count * */ __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":126 * ssize_t count * * count = len(obj) # <<<<<<<<<<<<<< * if count > _MAXINT32: * raise ValueError('too many elements in composite type record') */ __pyx_t_2 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(4, 126, __pyx_L1_error) __pyx_v_count = __pyx_t_2; /* "asyncpg/protocol/codecs/base.pyx":127 * * count = len(obj) * if count > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in composite type record') * */ __pyx_t_3 = ((__pyx_v_count > 0x7FFFFFFF) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/base.pyx":128 * count = len(obj) * if count > _MAXINT32: * raise ValueError('too many elements in composite type record') # <<<<<<<<<<<<<< * * elem_data = WriteBuffer.new() */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 128, __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(4, 128, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":127 * * count = len(obj) * if count > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in composite type record') * */ } /* "asyncpg/protocol/codecs/base.pyx":130 * raise ValueError('too many elements in composite type record') * * elem_data = WriteBuffer.new() # <<<<<<<<<<<<<< * i = 0 * for item in obj: */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_elem_data = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":131 * * 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":132 * 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_2 = 0; __pyx_t_4 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 132, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 132, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 132, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 132, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":133 * 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(4, 133, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_self->element_type_oids, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_As_int32_t(__pyx_t_5); if (unlikely((__pyx_t_6 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_elem_data, ((int32_t)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":134 * 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_3 = (__pyx_v_item == Py_None); __pyx_t_7 = (__pyx_t_3 != 0); if (__pyx_t_7) { /* "asyncpg/protocol/codecs/base.pyx":135 * 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_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":134 * 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_L6; } /* "asyncpg/protocol/codecs/base.pyx":137 * 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(4, 137, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_elem_codecs, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5), __pyx_v_settings, __pyx_v_elem_data, __pyx_v_item); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L6:; /* "asyncpg/protocol/codecs/base.pyx":138 * 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":132 * 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":140 * 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(4, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":118 * (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_5); __Pyx_XDECREF(__pyx_t_8); __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_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":142 * 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_8protocol_8protocol_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; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("encode_in_python", 0); /* "asyncpg/protocol/codecs/base.pyx":144 * cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf, * object obj): * data = self.py_encoder(obj) # <<<<<<<<<<<<<< * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: */ __Pyx_INCREF(__pyx_v_self->py_encoder); __pyx_t_2 = __pyx_v_self->py_encoder; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 144, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 144, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":145 * object obj): * data = self.py_encoder(obj) * if self.xformat == PG_XFORMAT_OBJECT: # <<<<<<<<<<<<<< * if self.format == PG_FORMAT_BINARY: * bytea_encode(settings, buf, data) */ switch (__pyx_v_self->xformat) { case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT: /* "asyncpg/protocol/codecs/base.pyx":146 * data = self.py_encoder(obj) * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * bytea_encode(settings, buf, data) * elif self.format == PG_FORMAT_TEXT: */ __pyx_t_5 = ((__pyx_v_self->format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY) != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":147 * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: * bytea_encode(settings, buf, data) # <<<<<<<<<<<<<< * elif self.format == PG_FORMAT_TEXT: * text_encode(settings, buf, data) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_bytea_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":146 * data = self.py_encoder(obj) * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * bytea_encode(settings, buf, data) * elif self.format == PG_FORMAT_TEXT: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":148 * if self.format == PG_FORMAT_BINARY: * bytea_encode(settings, buf, data) * elif self.format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * text_encode(settings, buf, data) * else: */ __pyx_t_5 = ((__pyx_v_self->format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT) != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":149 * bytea_encode(settings, buf, data) * elif self.format == PG_FORMAT_TEXT: * text_encode(settings, buf, data) # <<<<<<<<<<<<<< * else: * raise RuntimeError( */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_text_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":148 * if self.format == PG_FORMAT_BINARY: * bytea_encode(settings, buf, data) * elif self.format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * text_encode(settings, buf, data) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":151 * text_encode(settings, buf, data) * else: * raise RuntimeError( # <<<<<<<<<<<<<< * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: */ /*else*/ { /* "asyncpg/protocol/codecs/base.pyx":152 * else: * raise RuntimeError( * 'unexpected data format: {}'.format(self.format)) # <<<<<<<<<<<<<< * elif self.xformat == PG_XFORMAT_TUPLE: * self.c_encoder(settings, buf, data) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_data_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_self->format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 152, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 152, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":151 * text_encode(settings, buf, data) * else: * raise RuntimeError( # <<<<<<<<<<<<<< * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(4, 151, __pyx_L1_error) } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":145 * object obj): * data = self.py_encoder(obj) * if self.xformat == PG_XFORMAT_OBJECT: # <<<<<<<<<<<<<< * if self.format == PG_FORMAT_BINARY: * bytea_encode(settings, buf, data) */ break; /* "asyncpg/protocol/codecs/base.pyx":153 * raise RuntimeError( * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * self.c_encoder(settings, buf, data) * else: */ case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE: /* "asyncpg/protocol/codecs/base.pyx":154 * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: * self.c_encoder(settings, buf, data) # <<<<<<<<<<<<<< * else: * raise RuntimeError( */ __pyx_t_1 = __pyx_v_self->c_encoder(__pyx_v_settings, __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":153 * raise RuntimeError( * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * self.c_encoder(settings, buf, data) * else: */ break; default: /* "asyncpg/protocol/codecs/base.pyx":157 * else: * raise RuntimeError( * 'unexpected exchange format: {}'.format(self.xformat)) # <<<<<<<<<<<<<< * * cdef encode(self, ConnectionSettings settings, WriteBuffer buf, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_exchange_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_self->xformat); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 157, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 157, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 157, __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/protocol/codecs/base.pyx":156 * self.c_encoder(settings, buf, data) * else: * raise RuntimeError( # <<<<<<<<<<<<<< * 'unexpected exchange format: {}'.format(self.xformat)) * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(4, 156, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":142 * 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_4); __Pyx_XDECREF(__pyx_t_6); __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":159 * '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_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("encode", 0); /* "asyncpg/protocol/codecs/base.pyx":161 * cdef encode(self, ConnectionSettings settings, WriteBuffer buf, * object obj): * return self.encoder(self, settings, buf, obj) # <<<<<<<<<<<<<< * * cdef decode_scalar(self, ConnectionSettings settings, FastReadBuffer 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(4, 161, __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":159 * '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":163 * return self.encoder(self, settings, buf, obj) * * cdef decode_scalar(self, ConnectionSettings settings, FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("decode_scalar", 0); /* "asyncpg/protocol/codecs/base.pyx":164 * * cdef decode_scalar(self, ConnectionSettings settings, FastReadBuffer buf): * return self.c_decoder(settings, buf) # <<<<<<<<<<<<<< * * cdef decode_array(self, ConnectionSettings settings, FastReadBuffer 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(4, 164, __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":163 * return self.encoder(self, settings, buf, obj) * * cdef decode_scalar(self, ConnectionSettings settings, FastReadBuffer 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":166 * return self.c_decoder(settings, buf) * * cdef decode_array(self, ConnectionSettings settings, FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("decode_array", 0); /* "asyncpg/protocol/codecs/base.pyx":167 * * cdef decode_array(self, ConnectionSettings settings, FastReadBuffer buf): * return array_decode(settings, buf, codec_decode_func_ex, # <<<<<<<<<<<<<< * (self.element_codec)) * */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/codecs/base.pyx":168 * cdef decode_array(self, ConnectionSettings settings, FastReadBuffer 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(4, 167, __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":166 * return self.c_decoder(settings, buf) * * cdef decode_array(self, ConnectionSettings settings, FastReadBuffer 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":170 * (self.element_codec)) * * cdef decode_array_text(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("decode_array_text", 0); /* "asyncpg/protocol/codecs/base.pyx":172 * cdef decode_array_text(self, ConnectionSettings settings, * FastReadBuffer 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":174 * return textarray_decode(settings, buf, codec_decode_func_ex, * (self.element_codec), * self.element_delimiter) # <<<<<<<<<<<<<< * * cdef decode_range(self, ConnectionSettings settings, FastReadBuffer 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(4, 172, __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":170 * (self.element_codec)) * * cdef decode_array_text(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FastReadBuffer 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":176 * self.element_delimiter) * * cdef decode_range(self, ConnectionSettings settings, FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("decode_range", 0); /* "asyncpg/protocol/codecs/base.pyx":177 * * cdef decode_range(self, ConnectionSettings settings, FastReadBuffer buf): * return range_decode(settings, buf, codec_decode_func_ex, # <<<<<<<<<<<<<< * (self.element_codec)) * */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/codecs/base.pyx":178 * cdef decode_range(self, ConnectionSettings settings, FastReadBuffer buf): * return range_decode(settings, buf, codec_decode_func_ex, * (self.element_codec)) # <<<<<<<<<<<<<< * * cdef decode_composite(self, ConnectionSettings settings, */ __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(4, 177, __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":176 * self.element_delimiter) * * cdef decode_range(self, ConnectionSettings settings, FastReadBuffer 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":180 * (self.element_codec)) * * cdef decode_composite(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_v_result = 0; uint32_t __pyx_v_elem_count; uint32_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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_elem_buf = 0; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; PyObject *__pyx_t_3 = NULL; uint32_t __pyx_t_4; uint32_t __pyx_t_5; uint32_t __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; __Pyx_RefNannySetupContext("decode_composite", 0); /* "asyncpg/protocol/codecs/base.pyx":190 * uint32_t received_elem_typ * Codec elem_codec * FastReadBuffer elem_buf = FastReadBuffer.new() # <<<<<<<<<<<<<< * * elem_count = hton.unpack_int32(buf.read(4)) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_elem_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":192 * FastReadBuffer elem_buf = FastReadBuffer.new() * * elem_count = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * result = record.ApgRecord_New(self.element_names, elem_count) * for i in range(elem_count): */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(4, 192, __pyx_L1_error) __pyx_v_elem_count = ((uint32_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2)); /* "asyncpg/protocol/codecs/base.pyx":193 * * elem_count = hton.unpack_int32(buf.read(4)) * result = record.ApgRecord_New(self.element_names, elem_count) # <<<<<<<<<<<<<< * for i in range(elem_count): * elem_typ = self.element_type_oids[i] */ __pyx_t_1 = __pyx_v_self->element_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = ApgRecord_New(__pyx_t_1, __pyx_v_elem_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_result = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":194 * elem_count = hton.unpack_int32(buf.read(4)) * result = record.ApgRecord_New(self.element_names, elem_count) * for i in range(elem_count): # <<<<<<<<<<<<<< * elem_typ = self.element_type_oids[i] * received_elem_typ = hton.unpack_int32(buf.read(4)) */ __pyx_t_4 = __pyx_v_elem_count; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "asyncpg/protocol/codecs/base.pyx":195 * result = record.ApgRecord_New(self.element_names, elem_count) * for i in range(elem_count): * elem_typ = self.element_type_oids[i] # <<<<<<<<<<<<<< * received_elem_typ = hton.unpack_int32(buf.read(4)) * */ if (unlikely(__pyx_v_self->element_type_oids == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 195, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->element_type_oids, __pyx_v_i, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_6 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_elem_typ = __pyx_t_6; /* "asyncpg/protocol/codecs/base.pyx":196 * for i in range(elem_count): * elem_typ = self.element_type_oids[i] * received_elem_typ = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * * if received_elem_typ != elem_typ: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(4, 196, __pyx_L1_error) __pyx_v_received_elem_typ = ((uint32_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2)); /* "asyncpg/protocol/codecs/base.pyx":198 * received_elem_typ = hton.unpack_int32(buf.read(4)) * * if received_elem_typ != elem_typ: # <<<<<<<<<<<<<< * raise RuntimeError( * 'unexpected data type of composite type attribute {}: ' */ __pyx_t_7 = ((__pyx_v_received_elem_typ != __pyx_v_elem_typ) != 0); if (__pyx_t_7) { /* "asyncpg/protocol/codecs/base.pyx":202 * 'unexpected data type of composite type attribute {}: ' * '{!r}, expected {!r}' * .format( # <<<<<<<<<<<<<< * i, * TYPEMAP.get(received_elem_typ, received_elem_typ), */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_data_type_of_composit, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/codecs/base.pyx":203 * '{!r}, expected {!r}' * .format( * i, # <<<<<<<<<<<<<< * TYPEMAP.get(received_elem_typ, received_elem_typ), * TYPEMAP.get(elem_typ, elem_typ) */ __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":204 * .format( * i, * TYPEMAP.get(received_elem_typ, received_elem_typ), # <<<<<<<<<<<<<< * TYPEMAP.get(elem_typ, elem_typ) * ) */ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPEMAP); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_get); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyInt_From_uint32_t(__pyx_v_received_elem_typ); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_PyInt_From_uint32_t(__pyx_v_received_elem_typ); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_10, __pyx_t_12}; __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 204, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_10, __pyx_t_12}; __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 204, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif { __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL; } __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_12 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/codecs/base.pyx":205 * i, * TYPEMAP.get(received_elem_typ, received_elem_typ), * TYPEMAP.get(elem_typ, elem_typ) # <<<<<<<<<<<<<< * ) * ) */ __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPEMAP); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_get); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = __Pyx_PyInt_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_10 = __Pyx_PyInt_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_15, __pyx_t_10}; __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_15, __pyx_t_10}; __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_13) { __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_13); __pyx_t_13 = NULL; } __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_14, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_14, __pyx_t_10); __pyx_t_15 = 0; __pyx_t_10 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_t_8, __pyx_t_9, __pyx_t_11}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_3); __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; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_t_8, __pyx_t_9, __pyx_t_11}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_3); __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; } else #endif { __pyx_t_16 = PyTuple_New(3+__pyx_t_14); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_12); __pyx_t_12 = NULL; } __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_14, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_14, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_14, __pyx_t_11); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_11 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":199 * * if received_elem_typ != elem_typ: * raise RuntimeError( # <<<<<<<<<<<<<< * 'unexpected data type of composite type attribute {}: ' * '{!r}, expected {!r}' */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 199, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":198 * received_elem_typ = hton.unpack_int32(buf.read(4)) * * if received_elem_typ != elem_typ: # <<<<<<<<<<<<<< * raise RuntimeError( * 'unexpected data type of composite type attribute {}: ' */ } /* "asyncpg/protocol/codecs/base.pyx":209 * ) * * elem_len = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * if elem_len == -1: * elem = None */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(4, 209, __pyx_L1_error) __pyx_v_elem_len = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":210 * * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ __pyx_t_7 = ((__pyx_v_elem_len == -1L) != 0); if (__pyx_t_7) { /* "asyncpg/protocol/codecs/base.pyx":211 * elem_len = hton.unpack_int32(buf.read(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":210 * * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ goto __pyx_L6; } /* "asyncpg/protocol/codecs/base.pyx":213 * elem = None * else: * elem_codec = self.element_codecs[i] # <<<<<<<<<<<<<< * elem = elem_codec.decode(settings, * elem_buf.slice_from(buf, elem_len)) */ /*else*/ { if (unlikely(__pyx_v_self->element_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 213, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->element_codecs, __pyx_v_i, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(4, 213, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":215 * elem_codec = self.element_codecs[i] * elem = elem_codec.decode(settings, * elem_buf.slice_from(buf, elem_len)) # <<<<<<<<<<<<<< * * cpython.Py_INCREF(elem) */ __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_slice_from(__pyx_v_elem_buf, __pyx_v_buf, __pyx_v_elem_len)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/base.pyx":214 * else: * elem_codec = self.element_codecs[i] * elem = elem_codec.decode(settings, # <<<<<<<<<<<<<< * elem_buf.slice_from(buf, elem_len)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_elem_codec, __pyx_v_settings, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L6:; /* "asyncpg/protocol/codecs/base.pyx":217 * elem_buf.slice_from(buf, elem_len)) * * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * record.ApgRecord_SET_ITEM(result, i, elem) * */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/codecs/base.pyx":218 * * cpython.Py_INCREF(elem) * record.ApgRecord_SET_ITEM(result, i, elem) # <<<<<<<<<<<<<< * * return result */ ApgRecord_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem); } /* "asyncpg/protocol/codecs/base.pyx":220 * record.ApgRecord_SET_ITEM(result, i, elem) * * return result # <<<<<<<<<<<<<< * * cdef decode_in_python(self, ConnectionSettings settings, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":180 * (self.element_codec)) * * cdef decode_composite(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FastReadBuffer buf): * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __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); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __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((PyObject *)__pyx_v_elem_buf); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":222 * return result * * cdef decode_in_python(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_v_data = 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; __Pyx_RefNannySetupContext("decode_in_python", 0); /* "asyncpg/protocol/codecs/base.pyx":224 * cdef decode_in_python(self, ConnectionSettings settings, * FastReadBuffer buf): * if self.xformat == PG_XFORMAT_OBJECT: # <<<<<<<<<<<<<< * if self.format == PG_FORMAT_BINARY: * data = bytea_decode(settings, buf) */ switch (__pyx_v_self->xformat) { case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT: /* "asyncpg/protocol/codecs/base.pyx":225 * FastReadBuffer buf): * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * data = bytea_decode(settings, buf) * elif self.format == PG_FORMAT_TEXT: */ __pyx_t_1 = ((__pyx_v_self->format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":226 * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: * data = bytea_decode(settings, buf) # <<<<<<<<<<<<<< * elif self.format == PG_FORMAT_TEXT: * data = text_decode(settings, buf) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_bytea_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_data = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":225 * FastReadBuffer buf): * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * data = bytea_decode(settings, buf) * elif self.format == PG_FORMAT_TEXT: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":227 * if self.format == PG_FORMAT_BINARY: * data = bytea_decode(settings, buf) * elif self.format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * data = text_decode(settings, buf) * else: */ __pyx_t_1 = ((__pyx_v_self->format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":228 * data = bytea_decode(settings, buf) * elif self.format == PG_FORMAT_TEXT: * data = text_decode(settings, buf) # <<<<<<<<<<<<<< * else: * raise RuntimeError( */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_data = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":227 * if self.format == PG_FORMAT_BINARY: * data = bytea_decode(settings, buf) * elif self.format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * data = text_decode(settings, buf) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":230 * data = text_decode(settings, buf) * else: * raise RuntimeError( # <<<<<<<<<<<<<< * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: */ /*else*/ { /* "asyncpg/protocol/codecs/base.pyx":231 * else: * raise RuntimeError( * 'unexpected data format: {}'.format(self.format)) # <<<<<<<<<<<<<< * elif self.xformat == PG_XFORMAT_TUPLE: * data = self.c_decoder(settings, buf) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_data_format, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_self->format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 231, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 231, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":230 * data = text_decode(settings, buf) * else: * raise RuntimeError( # <<<<<<<<<<<<<< * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 230, __pyx_L1_error) } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":224 * cdef decode_in_python(self, ConnectionSettings settings, * FastReadBuffer buf): * if self.xformat == PG_XFORMAT_OBJECT: # <<<<<<<<<<<<<< * if self.format == PG_FORMAT_BINARY: * data = bytea_decode(settings, buf) */ break; /* "asyncpg/protocol/codecs/base.pyx":232 * raise RuntimeError( * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * data = self.c_decoder(settings, buf) * else: */ case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE: /* "asyncpg/protocol/codecs/base.pyx":233 * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: * data = self.c_decoder(settings, buf) # <<<<<<<<<<<<<< * else: * raise RuntimeError( */ __pyx_t_2 = __pyx_v_self->c_decoder(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_data = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":232 * raise RuntimeError( * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * data = self.c_decoder(settings, buf) * else: */ break; default: /* "asyncpg/protocol/codecs/base.pyx":236 * else: * raise RuntimeError( * 'unexpected exchange format: {}'.format(self.xformat)) # <<<<<<<<<<<<<< * * return self.py_decoder(data) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_exchange_format, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_self->xformat); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 236, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 236, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":235 * data = self.c_decoder(settings, buf) * else: * raise RuntimeError( # <<<<<<<<<<<<<< * 'unexpected exchange format: {}'.format(self.xformat)) * */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 235, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":238 * 'unexpected exchange format: {}'.format(self.xformat)) * * return self.py_decoder(data) # <<<<<<<<<<<<<< * * cdef inline decode(self, ConnectionSettings settings, FastReadBuffer buf): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->py_decoder); __pyx_t_3 = __pyx_v_self->py_decoder; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_data}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 238, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_data}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 238, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_data); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":222 * return result * * cdef decode_in_python(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FastReadBuffer buf): * if self.xformat == PG_XFORMAT_OBJECT: */ /* 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.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":240 * return self.py_decoder(data) * * cdef inline decode(self, ConnectionSettings settings, FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("decode", 0); /* "asyncpg/protocol/codecs/base.pyx":241 * * cdef inline decode(self, ConnectionSettings settings, FastReadBuffer 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(4, 241, __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":240 * return self.py_decoder(data) * * cdef inline decode(self, ConnectionSettings settings, FastReadBuffer 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":243 * 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; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("has_encoder", 0); /* "asyncpg/protocol/codecs/base.pyx":246 * 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) != 0); 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_3 = (__pyx_t_2 != 0); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":247 * * 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: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":246 * 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":249 * return True * * elif self.type == CODEC_ARRAY or self.type == CODEC_RANGE: # <<<<<<<<<<<<<< * return self.element_codec.has_encoder() * */ switch (__pyx_v_self->type) { case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY: case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":250 * * elif self.type == CODEC_ARRAY or self.type == CODEC_RANGE: * return self.element_codec.has_encoder() # <<<<<<<<<<<<<< * * elif self.type == CODEC_COMPOSITE: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_self->element_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":249 * return True * * elif self.type == CODEC_ARRAY or self.type == CODEC_RANGE: # <<<<<<<<<<<<<< * return self.element_codec.has_encoder() * */ } /* "asyncpg/protocol/codecs/base.pyx":252 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":253 * * 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(4, 253, __pyx_L1_error) } __pyx_t_4 = __pyx_v_self->element_codecs; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 253, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(4, 253, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_6)); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":254 * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: * if not elem_codec.has_encoder(): # <<<<<<<<<<<<<< * return False * return True */ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_elem_codec); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = ((!__pyx_t_1) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/base.pyx":255 * 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_4); __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":254 * 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":253 * * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: # <<<<<<<<<<<<<< * if not elem_codec.has_encoder(): * return False */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":256 * 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":252 * 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":259 * * 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":243 * 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_4); __Pyx_XDECREF(__pyx_t_6); __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":261 * 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; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("has_decoder", 0); /* "asyncpg/protocol/codecs/base.pyx":264 * 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) != 0); 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_3 = (__pyx_t_2 != 0); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":265 * * 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: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":264 * 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":267 * return True * * elif self.type == CODEC_ARRAY or self.type == CODEC_RANGE: # <<<<<<<<<<<<<< * return self.element_codec.has_decoder() * */ switch (__pyx_v_self->type) { case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY: case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":268 * * elif self.type == CODEC_ARRAY or self.type == CODEC_RANGE: * return self.element_codec.has_decoder() # <<<<<<<<<<<<<< * * elif self.type == CODEC_COMPOSITE: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_self->element_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":267 * return True * * elif self.type == CODEC_ARRAY or self.type == CODEC_RANGE: # <<<<<<<<<<<<<< * return self.element_codec.has_decoder() * */ } /* "asyncpg/protocol/codecs/base.pyx":270 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":271 * * 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(4, 271, __pyx_L1_error) } __pyx_t_4 = __pyx_v_self->element_codecs; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; for (;;) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 271, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(4, 271, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_6)); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":272 * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: * if not elem_codec.has_decoder(): # <<<<<<<<<<<<<< * return False * return True */ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_elem_codec); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = ((!__pyx_t_1) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/base.pyx":273 * 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_4); __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":272 * 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":271 * * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: # <<<<<<<<<<<<<< * if not elem_codec.has_decoder(): * return False */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":274 * 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":270 * 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":277 * * 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":261 * return False * * cdef has_decoder(self): # <<<<<<<<<<<<<< * cdef Codec elem_codec * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __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":279 * 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; __Pyx_RefNannySetupContext("is_binary", 0); /* "asyncpg/protocol/codecs/base.pyx":280 * * 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(4, 280, __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":279 * 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":282 * 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) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __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; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); /* "asyncpg/protocol/codecs/base.pyx":283 * * def __repr__(self): * return ''.format( # <<<<<<<<<<<<<< * self.oid, * 'NA' if self.element_codec is None else self.element_codec.oid, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Codec_oid_elem_oid_core, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":284 * def __repr__(self): * return ''.format( * self.oid, # <<<<<<<<<<<<<< * 'NA' if self.element_codec is None else self.element_codec.oid, * has_core_codec(self.oid)) */ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/base.pyx":285 * 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 != 0)) { __Pyx_INCREF(__pyx_n_u_NA); __pyx_t_4 = __pyx_n_u_NA; } else { __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->element_codec->oid); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; } /* "asyncpg/protocol/codecs/base.pyx":286 * self.oid, * 'NA' if self.element_codec is None else self.element_codec.oid, * has_core_codec(self.oid)) # <<<<<<<<<<<<<< * * @staticmethod */ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_f_7asyncpg_8protocol_8protocol_has_core_codec(__pyx_v_self->oid)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_6}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 283, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __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; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_6}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 283, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __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; } else #endif { __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_6); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":282 * return self.format == PG_FORMAT_BINARY * * def __repr__(self): # <<<<<<<<<<<<<< * return ''.format( * self.oid, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __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":289 * * @staticmethod * cdef Codec new_array_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec, Py_UCS4 __pyx_v_element_delimiter) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("new_array_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":295 * 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, element_codec, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":296 * cdef Codec codec * codec = Codec(oid) * codec.init(name, schema, 'array', CODEC_ARRAY, element_codec.format, # <<<<<<<<<<<<<< * PG_XFORMAT_OBJECT, NULL, NULL, 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_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, 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(4, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":299 * PG_XFORMAT_OBJECT, NULL, NULL, 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":289 * * @staticmethod * cdef Codec new_array_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_array_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":302 * * @staticmethod * cdef Codec new_range_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("new_range_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":307 * 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, element_codec, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":308 * cdef Codec codec * codec = Codec(oid) * codec.init(name, schema, 'range', CODEC_RANGE, element_codec.format, # <<<<<<<<<<<<<< * PG_XFORMAT_OBJECT, NULL, NULL, 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_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, Py_None, Py_None, __pyx_v_element_codec, ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":311 * PG_XFORMAT_OBJECT, NULL, NULL, 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":302 * * @staticmethod * cdef Codec new_range_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_range_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":314 * * @staticmethod * cdef Codec new_composite_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, PyObject *__pyx_v_element_codecs, PyObject *__pyx_v_element_type_oids, PyObject *__pyx_v_element_names) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("new_composite_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":322 * object element_names): * cdef Codec codec * codec = Codec(oid) # <<<<<<<<<<<<<< * codec.init(name, schema, 'composite', CODEC_COMPOSITE, * format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":323 * cdef Codec codec * codec = Codec(oid) * codec.init(name, schema, 'composite', CODEC_COMPOSITE, # <<<<<<<<<<<<<< * format, PG_XFORMAT_OBJECT, NULL, NULL, 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_n_u_composite, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE, __pyx_v_format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, NULL, NULL, 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(4, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":326 * format, PG_XFORMAT_OBJECT, NULL, NULL, 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":314 * * @staticmethod * cdef Codec new_composite_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_composite_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":329 * * @staticmethod * cdef Codec new_python_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, PyObject *__pyx_v_kind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder, 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; __Pyx_RefNannySetupContext("new_python_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":340 * ClientExchangeFormat xformat): * cdef Codec codec * codec = Codec(oid) # <<<<<<<<<<<<<< * codec.init(name, schema, kind, CODEC_PY, format, xformat, * c_encoder, c_decoder, encoder, decoder, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":341 * cdef Codec codec * codec = Codec(oid) * codec.init(name, schema, kind, CODEC_PY, format, xformat, # <<<<<<<<<<<<<< * c_encoder, c_decoder, 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_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(4, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":344 * c_encoder, c_decoder, 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":329 * * @staticmethod * cdef Codec new_python_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __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 PyObject *__pyx_t_1 = NULL; __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __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, 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_XDECREF(__pyx_t_1); __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, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Codec_6__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __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 PyObject *__pyx_t_1 = NULL; __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __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, 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_XDECREF(__pyx_t_1); __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":348 * * # 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, void const *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("codec_encode_func_ex", 0); /* "asyncpg/protocol/codecs/base.pyx":350 * 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(4, 350, __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":348 * * # 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":354 * * # Decode callback for arrays * cdef codec_decode_func_ex(ConnectionSettings settings, FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf, void const *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("codec_decode_func_ex", 0); /* "asyncpg/protocol/codecs/base.pyx":356 * cdef codec_decode_func_ex(ConnectionSettings settings, FastReadBuffer 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(4, 356, __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":354 * * # Decode callback for arrays * cdef codec_decode_func_ex(ConnectionSettings settings, FastReadBuffer 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":360 * * cdef class DataCodecConfig: * def __init__(self, cache_key): # <<<<<<<<<<<<<< * try: * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] */ /* 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) { PyObject *__pyx_v_cache_key = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cache_key,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cache_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 360, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_cache_key = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 360, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig___init__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_cache_key); /* 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, PyObject *__pyx_v_cache_key) { 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; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("__init__", 0); /* "asyncpg/protocol/codecs/base.pyx":361 * cdef class DataCodecConfig: * def __init__(self, cache_key): * try: # <<<<<<<<<<<<<< * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] * except KeyError: */ { __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":362 * def __init__(self, cache_key): * try: * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] # <<<<<<<<<<<<<< * except KeyError: * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] = {} */ if (unlikely(__pyx_v_7asyncpg_8protocol_8protocol_TYPE_CODECS_CACHE == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 362, __pyx_L3_error) } __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_7asyncpg_8protocol_8protocol_TYPE_CODECS_CACHE, __pyx_v_cache_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 362, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(4, 362, __pyx_L3_error) __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->_type_codecs_cache); __Pyx_DECREF(__pyx_v_self->_type_codecs_cache); __pyx_v_self->_type_codecs_cache = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":361 * cdef class DataCodecConfig: * def __init__(self, cache_key): * try: # <<<<<<<<<<<<<< * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] * except KeyError: */ } __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/codecs/base.pyx":363 * try: * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] * except KeyError: # <<<<<<<<<<<<<< * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] = {} * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(4, 363, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/codecs/base.pyx":364 * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] * except KeyError: * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] = {} # <<<<<<<<<<<<<< * * self._local_type_codecs = {} */ __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 364, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __Pyx_GOTREF(__pyx_v_self->_type_codecs_cache); __Pyx_DECREF(__pyx_v_self->_type_codecs_cache); __pyx_v_self->_type_codecs_cache = __pyx_t_8; if (unlikely(__pyx_v_7asyncpg_8protocol_8protocol_TYPE_CODECS_CACHE == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 364, __pyx_L5_except_error) } if (unlikely(PyDict_SetItem(__pyx_v_7asyncpg_8protocol_8protocol_TYPE_CODECS_CACHE, __pyx_v_cache_key, __pyx_t_8) < 0)) __PYX_ERR(4, 364, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "asyncpg/protocol/codecs/base.pyx":361 * cdef class DataCodecConfig: * def __init__(self, cache_key): * try: # <<<<<<<<<<<<<< * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] * except KeyError: */ __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":366 * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] = {} * * self._local_type_codecs = {} # <<<<<<<<<<<<<< * * def add_types(self, types): */ __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __Pyx_GOTREF(__pyx_v_self->_local_type_codecs); __Pyx_DECREF(__pyx_v_self->_local_type_codecs); __pyx_v_self->_local_type_codecs = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":360 * * cdef class DataCodecConfig: * def __init__(self, cache_key): # <<<<<<<<<<<<<< * try: * self._type_codecs_cache = TYPE_CODECS_CACHE[cache_key] */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __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.DataCodecConfig.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":368 * self._local_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, PyObject *__pyx_v_types); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types(PyObject *__pyx_v_self, PyObject *__pyx_v_types) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_types (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_2add_types(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), ((PyObject *)__pyx_v_types)); /* function exit code */ __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_format; 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; int __pyx_t_5; int __pyx_t_6; uint32_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; Py_UCS4 __pyx_t_12; Py_ssize_t __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); PyObject *__pyx_t_15 = NULL; int __pyx_t_16; __Pyx_RefNannySetupContext("add_types", 0); /* "asyncpg/protocol/codecs/base.pyx":377 * 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(4, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 377, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 377, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(4, 377, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 377, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_ti, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":378 * * for ti in types: * oid = ti['oid'] # <<<<<<<<<<<<<< * * if not ti['has_bin_io']: */ __pyx_t_4 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_oid); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 378, __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":380 * oid = ti['oid'] * * if not ti['has_bin_io']: # <<<<<<<<<<<<<< * format = PG_FORMAT_TEXT * else: */ __pyx_t_4 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_has_bin_io); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":381 * * if not ti['has_bin_io']: * format = PG_FORMAT_TEXT # <<<<<<<<<<<<<< * else: * format = PG_FORMAT_BINARY */ __pyx_v_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT; /* "asyncpg/protocol/codecs/base.pyx":380 * oid = ti['oid'] * * if not ti['has_bin_io']: # <<<<<<<<<<<<<< * format = PG_FORMAT_TEXT * else: */ goto __pyx_L5; } /* "asyncpg/protocol/codecs/base.pyx":383 * format = PG_FORMAT_TEXT * else: * format = PG_FORMAT_BINARY # <<<<<<<<<<<<<< * * has_text_elements = False */ /*else*/ { __pyx_v_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY; } __pyx_L5:; /* "asyncpg/protocol/codecs/base.pyx":385 * format = PG_FORMAT_BINARY * * has_text_elements = False # <<<<<<<<<<<<<< * * if self.get_codec(oid, format) is not None: */ __pyx_v_has_text_elements = 0; /* "asyncpg/protocol/codecs/base.pyx":387 * has_text_elements = False * * if self.get_codec(oid, format) is not None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 387, __pyx_L1_error) __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_7, __pyx_v_format)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 387, __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; __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":388 * * if self.get_codec(oid, format) is not None: * continue # <<<<<<<<<<<<<< * * name = ti['name'] */ goto __pyx_L3_continue; /* "asyncpg/protocol/codecs/base.pyx":387 * has_text_elements = False * * if self.get_codec(oid, format) is not None: # <<<<<<<<<<<<<< * continue * */ } /* "asyncpg/protocol/codecs/base.pyx":390 * continue * * name = ti['name'] # <<<<<<<<<<<<<< * schema = ti['ns'] * array_element_oid = ti['elemtype'] */ __pyx_t_4 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 390, __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":391 * * name = ti['name'] * schema = ti['ns'] # <<<<<<<<<<<<<< * array_element_oid = ti['elemtype'] * range_subtype_oid = ti['range_subtype'] */ __pyx_t_4 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 391, __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":392 * name = ti['name'] * schema = ti['ns'] * array_element_oid = ti['elemtype'] # <<<<<<<<<<<<<< * range_subtype_oid = ti['range_subtype'] * if ti['attrtypoids']: */ __pyx_t_4 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_elemtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 392, __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":393 * 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 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_range_subtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 393, __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":394 * array_element_oid = ti['elemtype'] * range_subtype_oid = ti['range_subtype'] * if ti['attrtypoids']: # <<<<<<<<<<<<<< * comp_type_attrs = tuple(ti['attrtypoids']) * else: */ __pyx_t_4 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_attrtypoids); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 394, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":395 * range_subtype_oid = ti['range_subtype'] * if ti['attrtypoids']: * comp_type_attrs = tuple(ti['attrtypoids']) # <<<<<<<<<<<<<< * else: * comp_type_attrs = None */ __pyx_t_4 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_attrtypoids); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_comp_type_attrs, __pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":394 * array_element_oid = ti['elemtype'] * range_subtype_oid = ti['range_subtype'] * if ti['attrtypoids']: # <<<<<<<<<<<<<< * comp_type_attrs = tuple(ti['attrtypoids']) * else: */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":397 * 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, Py_None); } __pyx_L7:; /* "asyncpg/protocol/codecs/base.pyx":398 * else: * comp_type_attrs = None * base_type = ti['basetype'] # <<<<<<<<<<<<<< * * if array_element_oid: */ __pyx_t_8 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_basetype); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_base_type, __pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":400 * base_type = ti['basetype'] * * if array_element_oid: # <<<<<<<<<<<<<< * # Array type (note, there is no separate 'kind' for arrays) * */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_array_element_oid); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 400, __pyx_L1_error) if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":404 * * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): # <<<<<<<<<<<<<< * name = name[1:] * name = '{}[]'.format(name) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":405 * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): * name = name[1:] # <<<<<<<<<<<<<< * name = '{}[]'.format(name) * */ __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_name, 1, 0, NULL, NULL, &__pyx_slice__35, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":404 * * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): # <<<<<<<<<<<<<< * name = name[1:] * name = '{}[]'.format(name) */ } /* "asyncpg/protocol/codecs/base.pyx":406 * if name.startswith('_'): * name = name[1:] * name = '{}[]'.format(name) # <<<<<<<<<<<<<< * * if ti['elem_has_bin_io']: */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__36, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_9) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_name}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 406, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_name}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 406, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_name); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":408 * name = '{}[]'.format(name) * * if ti['elem_has_bin_io']: # <<<<<<<<<<<<<< * elem_format = PG_FORMAT_BINARY * else: */ __pyx_t_4 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_elem_has_bin_io); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":409 * * if ti['elem_has_bin_io']: * elem_format = PG_FORMAT_BINARY # <<<<<<<<<<<<<< * else: * elem_format = PG_FORMAT_TEXT */ __pyx_v_elem_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY; /* "asyncpg/protocol/codecs/base.pyx":408 * name = '{}[]'.format(name) * * if ti['elem_has_bin_io']: # <<<<<<<<<<<<<< * elem_format = PG_FORMAT_BINARY * else: */ goto __pyx_L10; } /* "asyncpg/protocol/codecs/base.pyx":411 * elem_format = PG_FORMAT_BINARY * else: * elem_format = PG_FORMAT_TEXT # <<<<<<<<<<<<<< * * elem_codec = self.get_codec(array_element_oid, elem_format) */ /*else*/ { __pyx_v_elem_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT; } __pyx_L10:; /* "asyncpg/protocol/codecs/base.pyx":413 * elem_format = PG_FORMAT_TEXT * * elem_codec = self.get_codec(array_element_oid, elem_format) # <<<<<<<<<<<<<< * if elem_codec is None: * elem_format = PG_FORMAT_TEXT */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_array_element_oid); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 413, __pyx_L1_error) __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_7, __pyx_v_elem_format)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 413, __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":414 * * elem_codec = self.get_codec(array_element_oid, elem_format) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( */ __pyx_t_5 = (((PyObject *)__pyx_v_elem_codec) == Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":415 * elem_codec = self.get_codec(array_element_oid, elem_format) * if elem_codec is None: * elem_format = PG_FORMAT_TEXT # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * array_element_oid, name, schema) */ __pyx_v_elem_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT; /* "asyncpg/protocol/codecs/base.pyx":416 * if elem_codec is None: * elem_format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * array_element_oid, name, schema) * */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_declare_fallback_codec); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":417 * elem_format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( * array_element_oid, name, schema) # <<<<<<<<<<<<<< * * elem_delim = ti['elemdelim'][0] */ __pyx_t_10 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_array_element_oid, __pyx_v_name, __pyx_v_schema}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 416, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_array_element_oid, __pyx_v_name, __pyx_v_schema}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 416, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_9 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(__pyx_v_array_element_oid); __Pyx_GIVEREF(__pyx_v_array_element_oid); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_11, __pyx_v_array_element_oid); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_11, __pyx_v_name); __Pyx_INCREF(__pyx_v_schema); __Pyx_GIVEREF(__pyx_v_schema); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_11, __pyx_v_schema); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":416 * if elem_codec is None: * elem_format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * array_element_oid, name, schema) * */ if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(4, 416, __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":414 * * elem_codec = self.get_codec(array_element_oid, elem_format) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( */ } /* "asyncpg/protocol/codecs/base.pyx":419 * array_element_oid, name, schema) * * elem_delim = ti['elemdelim'][0] # <<<<<<<<<<<<<< * * self._type_codecs_cache[oid, elem_format] = \ */ __pyx_t_4 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_elemdelim); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_8); if (unlikely((__pyx_t_12 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(4, 419, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_elem_delim = ((Py_UCS4)__pyx_t_12); /* "asyncpg/protocol/codecs/base.pyx":423 * self._type_codecs_cache[oid, elem_format] = \ * Codec.new_array_codec( * oid, name, schema, elem_codec, elem_delim) # <<<<<<<<<<<<<< * * elif ti['kind'] == b'c': */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 423, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(4, 423, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_schema))||((__pyx_v_schema) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_schema)->tp_name), 0))) __PYX_ERR(4, 423, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":422 * * self._type_codecs_cache[oid, elem_format] = \ * Codec.new_array_codec( # <<<<<<<<<<<<<< * oid, name, schema, elem_codec, elem_delim) * */ __pyx_t_8 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec(__pyx_t_7, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_schema), __pyx_v_elem_codec, __pyx_v_elem_delim)); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":421 * elem_delim = ti['elemdelim'][0] * * self._type_codecs_cache[oid, elem_format] = \ # <<<<<<<<<<<<<< * Codec.new_array_codec( * oid, name, schema, elem_codec, elem_delim) */ if (unlikely(__pyx_v_self->_type_codecs_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 421, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_oid); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4); __pyx_t_4 = 0; if (unlikely(PyDict_SetItem(__pyx_v_self->_type_codecs_cache, __pyx_t_9, __pyx_t_8) < 0)) __PYX_ERR(4, 421, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":400 * base_type = ti['basetype'] * * if array_element_oid: # <<<<<<<<<<<<<< * # Array type (note, there is no separate 'kind' for arrays) * */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/base.pyx":425 * oid, name, schema, elem_codec, elem_delim) * * elif ti['kind'] == b'c': # <<<<<<<<<<<<<< * if not comp_type_attrs: * raise RuntimeError( */ __pyx_t_8 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_8, __pyx_n_b_c, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 425, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":426 * * elif ti['kind'] == b'c': * if not comp_type_attrs: # <<<<<<<<<<<<<< * raise RuntimeError( * 'type record missing field types for ' */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_comp_type_attrs); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 426, __pyx_L1_error) __pyx_t_5 = ((!__pyx_t_6) != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":429 * raise RuntimeError( * 'type record missing field types for ' * 'composite {}'.format(oid)) # <<<<<<<<<<<<<< * * # Composite type */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_type_record_missing_field_types, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_4) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_oid); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_oid}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 429, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_oid}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 429, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_oid); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/codecs/base.pyx":427 * elif ti['kind'] == b'c': * if not comp_type_attrs: * raise RuntimeError( # <<<<<<<<<<<<<< * 'type record missing field types for ' * 'composite {}'.format(oid)) */ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(4, 427, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":426 * * elif ti['kind'] == b'c': * if not comp_type_attrs: # <<<<<<<<<<<<<< * raise RuntimeError( * 'type record missing field types for ' */ } /* "asyncpg/protocol/codecs/base.pyx":433 * # Composite type * * comp_elem_codecs = [] # <<<<<<<<<<<<<< * * for typoid in comp_type_attrs: */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_comp_elem_codecs, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":435 * comp_elem_codecs = [] * * for typoid in comp_type_attrs: # <<<<<<<<<<<<<< * elem_codec = self.get_codec(typoid, PG_FORMAT_BINARY) * if elem_codec is None: */ if (likely(PyList_CheckExact(__pyx_v_comp_type_attrs)) || PyTuple_CheckExact(__pyx_v_comp_type_attrs)) { __pyx_t_8 = __pyx_v_comp_type_attrs; __Pyx_INCREF(__pyx_t_8); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { __pyx_t_13 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_comp_type_attrs); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_14 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 435, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_14)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(4, 435, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(4, 435, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_14(__pyx_t_8); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 435, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XDECREF_SET(__pyx_v_typoid, __pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/codecs/base.pyx":436 * * for typoid in comp_type_attrs: * elem_codec = self.get_codec(typoid, PG_FORMAT_BINARY) # <<<<<<<<<<<<<< * if elem_codec is None: * elem_codec = self.get_codec(typoid, PG_FORMAT_TEXT) */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_typoid); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 436, __pyx_L1_error) __pyx_t_9 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_7, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY)); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_9)); __pyx_t_9 = 0; /* "asyncpg/protocol/codecs/base.pyx":437 * for typoid in comp_type_attrs: * elem_codec = self.get_codec(typoid, PG_FORMAT_BINARY) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_codec = self.get_codec(typoid, PG_FORMAT_TEXT) * has_text_elements = True */ __pyx_t_5 = (((PyObject *)__pyx_v_elem_codec) == Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":438 * elem_codec = self.get_codec(typoid, PG_FORMAT_BINARY) * if elem_codec is None: * elem_codec = self.get_codec(typoid, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * has_text_elements = True * if elem_codec is None: */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_typoid); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 438, __pyx_L1_error) __pyx_t_9 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_7, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT)); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_9)); __pyx_t_9 = 0; /* "asyncpg/protocol/codecs/base.pyx":439 * if elem_codec is None: * elem_codec = self.get_codec(typoid, PG_FORMAT_TEXT) * has_text_elements = True # <<<<<<<<<<<<<< * if elem_codec is None: * raise RuntimeError( */ __pyx_v_has_text_elements = 1; /* "asyncpg/protocol/codecs/base.pyx":437 * for typoid in comp_type_attrs: * elem_codec = self.get_codec(typoid, PG_FORMAT_BINARY) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_codec = self.get_codec(typoid, PG_FORMAT_TEXT) * has_text_elements = True */ } /* "asyncpg/protocol/codecs/base.pyx":440 * elem_codec = self.get_codec(typoid, PG_FORMAT_TEXT) * has_text_elements = True * if elem_codec is None: # <<<<<<<<<<<<<< * raise RuntimeError( * 'no codec for composite attribute type {}'.format( */ __pyx_t_6 = (((PyObject *)__pyx_v_elem_codec) == Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":442 * if elem_codec is None: * raise RuntimeError( * 'no codec for composite attribute type {}'.format( # <<<<<<<<<<<<<< * typoid)) * comp_elem_codecs.append(elem_codec) */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_no_codec_for_composite_attribute, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); /* "asyncpg/protocol/codecs/base.pyx":443 * raise RuntimeError( * 'no codec for composite attribute type {}'.format( * typoid)) # <<<<<<<<<<<<<< * comp_elem_codecs.append(elem_codec) * */ __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_4) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_typoid); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_typoid}; __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 442, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_typoid}; __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 442, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_9); } else #endif { __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_typoid); __Pyx_GIVEREF(__pyx_v_typoid); PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_typoid); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":441 * has_text_elements = True * if elem_codec is None: * raise RuntimeError( # <<<<<<<<<<<<<< * 'no codec for composite attribute type {}'.format( * typoid)) */ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(4, 441, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":440 * elem_codec = self.get_codec(typoid, PG_FORMAT_TEXT) * has_text_elements = True * if elem_codec is None: # <<<<<<<<<<<<<< * raise RuntimeError( * 'no codec for composite attribute type {}'.format( */ } /* "asyncpg/protocol/codecs/base.pyx":444 * 'no codec for composite attribute type {}'.format( * typoid)) * 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(4, 444, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":435 * comp_elem_codecs = [] * * for typoid in comp_type_attrs: # <<<<<<<<<<<<<< * elem_codec = self.get_codec(typoid, PG_FORMAT_BINARY) * if elem_codec is None: */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":446 * comp_elem_codecs.append(elem_codec) * * element_names = collections.OrderedDict() # <<<<<<<<<<<<<< * for i, attrname in enumerate(ti['attrnames']): * element_names[attrname] = i */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (__pyx_t_9) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 446, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 446, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_element_names, __pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":447 * * element_names = collections.OrderedDict() * for i, attrname in enumerate(ti['attrnames']): # <<<<<<<<<<<<<< * element_names[attrname] = i * */ __Pyx_INCREF(__pyx_int_0); __pyx_t_8 = __pyx_int_0; __pyx_t_10 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_attrnames); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { __pyx_t_13 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 447, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { if (likely(!__pyx_t_14)) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_10); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(4, 447, __pyx_L1_error) #else __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_10); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(4, 447, __pyx_L1_error) #else __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } } else { __pyx_t_10 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_10)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 447, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_10); } __Pyx_XDECREF_SET(__pyx_v_attrname, __pyx_t_10); __pyx_t_10 = 0; __Pyx_INCREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8); __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = __pyx_t_10; __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":448 * element_names = collections.OrderedDict() * for i, attrname in enumerate(ti['attrnames']): * element_names[attrname] = i # <<<<<<<<<<<<<< * * if has_text_elements: */ if (unlikely(PyObject_SetItem(__pyx_v_element_names, __pyx_v_attrname, __pyx_v_i) < 0)) __PYX_ERR(4, 448, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":447 * * element_names = collections.OrderedDict() * for i, attrname in enumerate(ti['attrnames']): # <<<<<<<<<<<<<< * element_names[attrname] = i * */ } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":450 * element_names[attrname] = i * * if has_text_elements: # <<<<<<<<<<<<<< * format = PG_FORMAT_TEXT * */ __pyx_t_5 = (__pyx_v_has_text_elements != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":451 * * if has_text_elements: * format = PG_FORMAT_TEXT # <<<<<<<<<<<<<< * * self._type_codecs_cache[oid, format] = \ */ __pyx_v_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT; /* "asyncpg/protocol/codecs/base.pyx":450 * element_names[attrname] = i * * if has_text_elements: # <<<<<<<<<<<<<< * format = PG_FORMAT_TEXT * */ } /* "asyncpg/protocol/codecs/base.pyx":455 * self._type_codecs_cache[oid, format] = \ * Codec.new_composite_codec( * oid, name, schema, format, comp_elem_codecs, # <<<<<<<<<<<<<< * comp_type_attrs, element_names) * */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 455, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(4, 455, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_schema))||((__pyx_v_schema) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_schema)->tp_name), 0))) __PYX_ERR(4, 455, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":456 * Codec.new_composite_codec( * oid, name, schema, format, comp_elem_codecs, * comp_type_attrs, element_names) # <<<<<<<<<<<<<< * * elif ti['kind'] == b'd': */ if (!(likely(PyTuple_CheckExact(__pyx_v_comp_type_attrs))||((__pyx_v_comp_type_attrs) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_comp_type_attrs)->tp_name), 0))) __PYX_ERR(4, 456, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":454 * * self._type_codecs_cache[oid, format] = \ * Codec.new_composite_codec( # <<<<<<<<<<<<<< * oid, name, schema, format, comp_elem_codecs, * comp_type_attrs, element_names) */ __pyx_t_8 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(__pyx_t_7, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_schema), __pyx_v_format, __pyx_v_comp_elem_codecs, ((PyObject*)__pyx_v_comp_type_attrs), __pyx_v_element_names)); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":453 * format = PG_FORMAT_TEXT * * self._type_codecs_cache[oid, format] = \ # <<<<<<<<<<<<<< * Codec.new_composite_codec( * oid, name, schema, format, comp_elem_codecs, */ if (unlikely(__pyx_v_self->_type_codecs_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 453, __pyx_L1_error) } __pyx_t_9 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_oid); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); __pyx_t_9 = 0; if (unlikely(PyDict_SetItem(__pyx_v_self->_type_codecs_cache, __pyx_t_10, __pyx_t_8) < 0)) __PYX_ERR(4, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":425 * oid, name, schema, elem_codec, elem_delim) * * elif ti['kind'] == b'c': # <<<<<<<<<<<<<< * if not comp_type_attrs: * raise RuntimeError( */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/base.pyx":458 * comp_type_attrs, element_names) * * elif ti['kind'] == b'd': # <<<<<<<<<<<<<< * # Domain type * */ __pyx_t_8 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_t_8, __pyx_n_b_d, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":461 * # Domain type * * if not base_type: # <<<<<<<<<<<<<< * raise RuntimeError( * 'type record missing base type for domain {}'.format( */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_base_type); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 461, __pyx_L1_error) __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":463 * if not base_type: * raise RuntimeError( * 'type record missing base type for domain {}'.format( # <<<<<<<<<<<<<< * oid)) * */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_type_record_missing_base_type_fo, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); /* "asyncpg/protocol/codecs/base.pyx":464 * raise RuntimeError( * 'type record missing base type for domain {}'.format( * oid)) # <<<<<<<<<<<<<< * * elem_codec = self.get_codec(base_type, format) */ __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_9) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_oid); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_oid}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 463, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_oid}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 463, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif { __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_oid); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":462 * * if not base_type: * raise RuntimeError( # <<<<<<<<<<<<<< * 'type record missing base type for domain {}'.format( * oid)) */ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(4, 462, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":461 * # Domain type * * if not base_type: # <<<<<<<<<<<<<< * raise RuntimeError( * 'type record missing base type for domain {}'.format( */ } /* "asyncpg/protocol/codecs/base.pyx":466 * oid)) * * elem_codec = self.get_codec(base_type, format) # <<<<<<<<<<<<<< * if elem_codec is None: * format = PG_FORMAT_TEXT */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_base_type); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 466, __pyx_L1_error) __pyx_t_8 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_7, __pyx_v_format)); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_8)); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":467 * * elem_codec = self.get_codec(base_type, format) * if elem_codec is None: # <<<<<<<<<<<<<< * format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( */ __pyx_t_6 = (((PyObject *)__pyx_v_elem_codec) == Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":468 * elem_codec = self.get_codec(base_type, format) * if elem_codec is None: * format = PG_FORMAT_TEXT # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * base_type, name, schema) */ __pyx_v_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT; /* "asyncpg/protocol/codecs/base.pyx":469 * if elem_codec is None: * format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * base_type, name, schema) * */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_declare_fallback_codec); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); /* "asyncpg/protocol/codecs/base.pyx":470 * format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( * base_type, name, schema) # <<<<<<<<<<<<<< * * self._type_codecs_cache[oid, format] = elem_codec */ __pyx_t_15 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[4] = {__pyx_t_15, __pyx_v_base_type, __pyx_v_name, __pyx_v_schema}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 469, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[4] = {__pyx_t_15, __pyx_v_base_type, __pyx_v_name, __pyx_v_schema}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 469, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif { __pyx_t_9 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_base_type); __Pyx_GIVEREF(__pyx_v_base_type); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_11, __pyx_v_base_type); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_11, __pyx_v_name); __Pyx_INCREF(__pyx_v_schema); __Pyx_GIVEREF(__pyx_v_schema); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_11, __pyx_v_schema); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":469 * if elem_codec is None: * format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * base_type, name, schema) * */ if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(4, 469, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_8)); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":467 * * elem_codec = self.get_codec(base_type, format) * if elem_codec is None: # <<<<<<<<<<<<<< * format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( */ } /* "asyncpg/protocol/codecs/base.pyx":472 * base_type, name, schema) * * self._type_codecs_cache[oid, format] = elem_codec # <<<<<<<<<<<<<< * * elif ti['kind'] == b'r': */ if (unlikely(__pyx_v_self->_type_codecs_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 472, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_oid); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8); __pyx_t_8 = 0; if (unlikely(PyDict_SetItem(__pyx_v_self->_type_codecs_cache, __pyx_t_10, ((PyObject *)__pyx_v_elem_codec)) < 0)) __PYX_ERR(4, 472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":458 * comp_type_attrs, element_names) * * elif ti['kind'] == b'd': # <<<<<<<<<<<<<< * # Domain type * */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/base.pyx":474 * self._type_codecs_cache[oid, format] = elem_codec * * elif ti['kind'] == b'r': # <<<<<<<<<<<<<< * # Range type * */ __pyx_t_10 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_kind); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_t_10, __pyx_n_b_r, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":477 * # Range type * * if not range_subtype_oid: # <<<<<<<<<<<<<< * raise RuntimeError( * 'type record missing base type for range {}'.format( */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_range_subtype_oid); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 477, __pyx_L1_error) __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":479 * if not range_subtype_oid: * raise RuntimeError( * 'type record missing base type for range {}'.format( # <<<<<<<<<<<<<< * oid)) * */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_type_record_missing_base_type_fo_2, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":480 * raise RuntimeError( * 'type record missing base type for range {}'.format( * oid)) # <<<<<<<<<<<<<< * * if ti['elem_has_bin_io']: */ __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_9) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_oid); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_oid}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 479, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_oid}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 479, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_oid); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":478 * * if not range_subtype_oid: * raise RuntimeError( # <<<<<<<<<<<<<< * 'type record missing base type for range {}'.format( * oid)) */ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(4, 478, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":477 * # Range type * * if not range_subtype_oid: # <<<<<<<<<<<<<< * raise RuntimeError( * 'type record missing base type for range {}'.format( */ } /* "asyncpg/protocol/codecs/base.pyx":482 * oid)) * * if ti['elem_has_bin_io']: # <<<<<<<<<<<<<< * elem_format = PG_FORMAT_BINARY * else: */ __pyx_t_10 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_elem_has_bin_io); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":483 * * if ti['elem_has_bin_io']: * elem_format = PG_FORMAT_BINARY # <<<<<<<<<<<<<< * else: * elem_format = PG_FORMAT_TEXT */ __pyx_v_elem_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY; /* "asyncpg/protocol/codecs/base.pyx":482 * oid)) * * if ti['elem_has_bin_io']: # <<<<<<<<<<<<<< * elem_format = PG_FORMAT_BINARY * else: */ goto __pyx_L23; } /* "asyncpg/protocol/codecs/base.pyx":485 * elem_format = PG_FORMAT_BINARY * else: * elem_format = PG_FORMAT_TEXT # <<<<<<<<<<<<<< * * elem_codec = self.get_codec(range_subtype_oid, elem_format) */ /*else*/ { __pyx_v_elem_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT; } __pyx_L23:; /* "asyncpg/protocol/codecs/base.pyx":487 * elem_format = PG_FORMAT_TEXT * * elem_codec = self.get_codec(range_subtype_oid, elem_format) # <<<<<<<<<<<<<< * if elem_codec is None: * elem_format = PG_FORMAT_TEXT */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 487, __pyx_L1_error) __pyx_t_10 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_7, __pyx_v_elem_format)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_10)); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":488 * * elem_codec = self.get_codec(range_subtype_oid, elem_format) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( */ __pyx_t_6 = (((PyObject *)__pyx_v_elem_codec) == Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":489 * elem_codec = self.get_codec(range_subtype_oid, elem_format) * if elem_codec is None: * elem_format = PG_FORMAT_TEXT # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * range_subtype_oid, name, schema) */ __pyx_v_elem_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT; /* "asyncpg/protocol/codecs/base.pyx":490 * if elem_codec is None: * elem_format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * range_subtype_oid, name, schema) * */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_declare_fallback_codec); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":491 * elem_format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( * range_subtype_oid, name, schema) # <<<<<<<<<<<<<< * * self._type_codecs_cache[oid, elem_format] = \ */ __pyx_t_15 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_15, __pyx_v_range_subtype_oid, __pyx_v_name, __pyx_v_schema}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 490, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_15, __pyx_v_range_subtype_oid, __pyx_v_name, __pyx_v_schema}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 490, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_9 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_range_subtype_oid); __Pyx_GIVEREF(__pyx_v_range_subtype_oid); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_11, __pyx_v_range_subtype_oid); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_11, __pyx_v_name); __Pyx_INCREF(__pyx_v_schema); __Pyx_GIVEREF(__pyx_v_schema); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_11, __pyx_v_schema); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":490 * if elem_codec is None: * elem_format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * range_subtype_oid, name, schema) * */ if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(4, 490, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_10)); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":488 * * elem_codec = self.get_codec(range_subtype_oid, elem_format) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_format = PG_FORMAT_TEXT * elem_codec = self.declare_fallback_codec( */ } /* "asyncpg/protocol/codecs/base.pyx":494 * * self._type_codecs_cache[oid, elem_format] = \ * Codec.new_range_codec(oid, name, schema, elem_codec) # <<<<<<<<<<<<<< * * elif ti['kind'] == b'e': */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 494, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(4, 494, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_schema))||((__pyx_v_schema) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_schema)->tp_name), 0))) __PYX_ERR(4, 494, __pyx_L1_error) __pyx_t_10 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(__pyx_t_7, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_schema), __pyx_v_elem_codec)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); /* "asyncpg/protocol/codecs/base.pyx":493 * range_subtype_oid, name, schema) * * self._type_codecs_cache[oid, elem_format] = \ # <<<<<<<<<<<<<< * Codec.new_range_codec(oid, name, schema, elem_codec) * */ if (unlikely(__pyx_v_self->_type_codecs_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 493, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_oid); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); __pyx_t_8 = 0; if (unlikely(PyDict_SetItem(__pyx_v_self->_type_codecs_cache, __pyx_t_9, __pyx_t_10) < 0)) __PYX_ERR(4, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":474 * self._type_codecs_cache[oid, format] = elem_codec * * elif ti['kind'] == b'r': # <<<<<<<<<<<<<< * # Range type * */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/base.pyx":496 * Codec.new_range_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_10 = PyObject_GetItem(__pyx_v_ti, __pyx_n_u_kind); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_t_10, __pyx_n_b_e, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_5) { /* "asyncpg/protocol/codecs/base.pyx":498 * 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_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_builtin_type_codec_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/codecs/base.pyx":499 * # 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_8 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_15 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[7] = {__pyx_t_15, __pyx_v_oid, __pyx_v_name, __pyx_v_schema, __pyx_n_u_scalar, __pyx_int_25, __pyx_t_8}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 6+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 498, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[7] = {__pyx_t_15, __pyx_v_oid, __pyx_v_name, __pyx_v_schema, __pyx_n_u_scalar, __pyx_int_25, __pyx_t_8}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 6+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 498, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_4 = PyTuple_New(6+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_11, __pyx_v_oid); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_11, __pyx_v_name); __Pyx_INCREF(__pyx_v_schema); __Pyx_GIVEREF(__pyx_v_schema); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_11, __pyx_v_schema); __Pyx_INCREF(__pyx_n_u_scalar); __Pyx_GIVEREF(__pyx_n_u_scalar); PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_11, __pyx_n_u_scalar); __Pyx_INCREF(__pyx_int_25); __Pyx_GIVEREF(__pyx_int_25); PyTuple_SET_ITEM(__pyx_t_4, 4+__pyx_t_11, __pyx_int_25); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 5+__pyx_t_11, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":496 * Codec.new_range_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_L8; } /* "asyncpg/protocol/codecs/base.pyx":501 * TEXTOID, PG_FORMAT_ANY) * else: * self.declare_fallback_codec(oid, name, schema) # <<<<<<<<<<<<<< * * def add_python_codec(self, typeoid, typename, typeschema, typekind, */ /*else*/ { __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_declare_fallback_codec); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_oid, __pyx_v_name, __pyx_v_schema}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_oid, __pyx_v_name, __pyx_v_schema}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 501, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_8 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_11, __pyx_v_oid); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_11, __pyx_v_name); __Pyx_INCREF(__pyx_v_schema); __Pyx_GIVEREF(__pyx_v_schema); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_11, __pyx_v_schema); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __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_L8:; /* "asyncpg/protocol/codecs/base.pyx":377 * 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":368 * self._local_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_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __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":503 * self.declare_fallback_codec(oid, name, schema) * * def add_python_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * encoder, decoder, format, xformat): * cdef: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_typeoid = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_typeschema = 0; PyObject *__pyx_v_typekind = 0; PyObject *__pyx_v_encoder = 0; PyObject *__pyx_v_decoder = 0; PyObject *__pyx_v_format = 0; PyObject *__pyx_v_xformat = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_python_codec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,&__pyx_n_s_typekind,&__pyx_n_s_encoder,&__pyx_n_s_decoder,&__pyx_n_s_format,&__pyx_n_s_xformat,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeoid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 1); __PYX_ERR(4, 503, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeschema)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 2); __PYX_ERR(4, 503, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typekind)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 3); __PYX_ERR(4, 503, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoder)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 4); __PYX_ERR(4, 503, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_decoder)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 5); __PYX_ERR(4, 503, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 6); __PYX_ERR(4, 503, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xformat)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 7); __PYX_ERR(4, 503, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_python_codec") < 0)) __PYX_ERR(4, 503, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; __pyx_v_typekind = values[3]; __pyx_v_encoder = values[4]; __pyx_v_decoder = values[5]; __pyx_v_format = values[6]; __pyx_v_xformat = values[7]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 503, __pyx_L3_error) __pyx_L3_error:; __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_encoder, __pyx_v_decoder, __pyx_v_format, __pyx_v_xformat); /* function exit code */ __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_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; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; uint32_t __pyx_t_4; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_t_5; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_t_6; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_any_core_codec __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_t_11; __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_t_12; int __pyx_t_13; __Pyx_RefNannySetupContext("add_python_codec", 0); __Pyx_INCREF(__pyx_v_format); /* "asyncpg/protocol/codecs/base.pyx":507 * cdef: * Codec core_codec * encode_func c_encoder = NULL # <<<<<<<<<<<<<< * decode_func c_decoder = NULL * */ __pyx_v_c_encoder = NULL; /* "asyncpg/protocol/codecs/base.pyx":508 * Codec core_codec * encode_func c_encoder = NULL * decode_func c_decoder = NULL # <<<<<<<<<<<<<< * * if xformat == PG_XFORMAT_TUPLE: */ __pyx_v_c_decoder = NULL; /* "asyncpg/protocol/codecs/base.pyx":510 * decode_func c_decoder = NULL * * if xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * core_codec = get_any_core_codec(typeoid, format, xformat) * if core_codec is None: */ __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_xformat, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 510, __pyx_L1_error) __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(4, 510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "asyncpg/protocol/codecs/base.pyx":511 * * if xformat == PG_XFORMAT_TUPLE: * core_codec = get_any_core_codec(typeoid, format, xformat) # <<<<<<<<<<<<<< * if core_codec is None: * raise ValueError( */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_typeoid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 511, __pyx_L1_error) __pyx_t_5 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 511, __pyx_L1_error) __pyx_t_6 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 511, __pyx_L1_error) __pyx_t_7.__pyx_n = 1; __pyx_t_7.xformat = __pyx_t_6; __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_any_core_codec(__pyx_t_4, __pyx_t_5, &__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_core_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":512 * if xformat == PG_XFORMAT_TUPLE: * core_codec = get_any_core_codec(typeoid, format, xformat) * if core_codec is None: # <<<<<<<<<<<<<< * raise ValueError( * "{} type does not support 'tuple' exchange format".format( */ __pyx_t_3 = (((PyObject *)__pyx_v_core_codec) == Py_None); __pyx_t_8 = (__pyx_t_3 != 0); if (__pyx_t_8) { /* "asyncpg/protocol/codecs/base.pyx":514 * if core_codec is None: * raise ValueError( * "{} type does not support 'tuple' exchange format".format( # <<<<<<<<<<<<<< * typename)) * c_encoder = core_codec.c_encoder */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_type_does_not_support_tuple_exc, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/codecs/base.pyx":515 * raise ValueError( * "{} type does not support 'tuple' exchange format".format( * typename)) # <<<<<<<<<<<<<< * c_encoder = core_codec.c_encoder * c_decoder = core_codec.c_decoder */ __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_9) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_typename); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_typename}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 514, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_typename}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 514, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_typename); __Pyx_GIVEREF(__pyx_v_typename); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_typename); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":513 * core_codec = get_any_core_codec(typeoid, format, xformat) * if core_codec is None: * raise ValueError( # <<<<<<<<<<<<<< * "{} type does not support 'tuple' exchange format".format( * typename)) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 513, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":512 * if xformat == PG_XFORMAT_TUPLE: * core_codec = get_any_core_codec(typeoid, format, xformat) * if core_codec is None: # <<<<<<<<<<<<<< * raise ValueError( * "{} type does not support 'tuple' exchange format".format( */ } /* "asyncpg/protocol/codecs/base.pyx":516 * "{} type does not support 'tuple' exchange format".format( * typename)) * c_encoder = core_codec.c_encoder # <<<<<<<<<<<<<< * c_decoder = core_codec.c_decoder * format = core_codec.format */ __pyx_t_11 = __pyx_v_core_codec->c_encoder; __pyx_v_c_encoder = __pyx_t_11; /* "asyncpg/protocol/codecs/base.pyx":517 * typename)) * c_encoder = core_codec.c_encoder * c_decoder = core_codec.c_decoder # <<<<<<<<<<<<<< * format = core_codec.format * */ __pyx_t_12 = __pyx_v_core_codec->c_decoder; __pyx_v_c_decoder = __pyx_t_12; /* "asyncpg/protocol/codecs/base.pyx":518 * c_encoder = core_codec.c_encoder * c_decoder = core_codec.c_decoder * format = core_codec.format # <<<<<<<<<<<<<< * * # Clear all previous overrides (this also clears type cache). */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_core_codec->format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":510 * decode_func c_decoder = NULL * * if xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * core_codec = get_any_core_codec(typeoid, format, xformat) * if core_codec is None: */ } /* "asyncpg/protocol/codecs/base.pyx":521 * * # Clear all previous overrides (this also clears type cache). * self.remove_python_codec(typeoid, typename, typeschema) # <<<<<<<<<<<<<< * * self._local_type_codecs[typeoid] = \ */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_python_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = NULL; __pyx_t_13 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_13 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 521, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 521, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_9 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_13, __pyx_v_typeoid); __Pyx_INCREF(__pyx_v_typename); __Pyx_GIVEREF(__pyx_v_typename); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_13, __pyx_v_typename); __Pyx_INCREF(__pyx_v_typeschema); __Pyx_GIVEREF(__pyx_v_typeschema); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_13, __pyx_v_typeschema); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":524 * * self._local_type_codecs[typeoid] = \ * Codec.new_python_codec(typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * encoder, decoder, c_encoder, c_decoder, * format, xformat) */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_typeoid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 524, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_typename))||((__pyx_v_typename) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_typename)->tp_name), 0))) __PYX_ERR(4, 524, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_typeschema))||((__pyx_v_typeschema) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_typeschema)->tp_name), 0))) __PYX_ERR(4, 524, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_typekind))||((__pyx_v_typekind) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_typekind)->tp_name), 0))) __PYX_ERR(4, 524, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":526 * Codec.new_python_codec(typeoid, typename, typeschema, typekind, * encoder, decoder, c_encoder, c_decoder, * format, xformat) # <<<<<<<<<<<<<< * * def remove_python_codec(self, typeoid, typename, typeschema): */ __pyx_t_5 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 526, __pyx_L1_error) __pyx_t_6 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 526, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":524 * * self._local_type_codecs[typeoid] = \ * Codec.new_python_codec(typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * encoder, decoder, c_encoder, c_decoder, * format, xformat) */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(__pyx_t_4, ((PyObject*)__pyx_v_typename), ((PyObject*)__pyx_v_typeschema), ((PyObject*)__pyx_v_typekind), __pyx_v_encoder, __pyx_v_decoder, __pyx_v_c_encoder, __pyx_v_c_decoder, __pyx_t_5, __pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":523 * self.remove_python_codec(typeoid, typename, typeschema) * * self._local_type_codecs[typeoid] = \ # <<<<<<<<<<<<<< * Codec.new_python_codec(typeoid, typename, typeschema, typekind, * encoder, decoder, c_encoder, c_decoder, */ if (unlikely(__pyx_v_self->_local_type_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 523, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_self->_local_type_codecs, __pyx_v_typeoid, __pyx_t_2) < 0)) __PYX_ERR(4, 523, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":503 * self.declare_fallback_codec(oid, name, schema) * * def add_python_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * 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_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __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(__pyx_v_format); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":528 * format, xformat) * * def remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * self._local_type_codecs.pop(typeoid, None) * self.clear_type_cache() */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_typeoid = 0; CYTHON_UNUSED PyObject *__pyx_v_typename = 0; CYTHON_UNUSED PyObject *__pyx_v_typeschema = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_python_codec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeoid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, 1); __PYX_ERR(4, 528, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeschema)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, 2); __PYX_ERR(4, 528, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_python_codec") < 0)) __PYX_ERR(4, 528, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 528, __pyx_L3_error) __pyx_L3_error:; __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 */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_6remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, CYTHON_UNUSED PyObject *__pyx_v_typename, CYTHON_UNUSED PyObject *__pyx_v_typeschema) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("remove_python_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":529 * * def remove_python_codec(self, typeoid, typename, typeschema): * self._local_type_codecs.pop(typeoid, None) # <<<<<<<<<<<<<< * self.clear_type_cache() * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local_type_codecs, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_typeoid, Py_None}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 529, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_typeoid, Py_None}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 529, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_typeoid); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, Py_None); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":530 * def remove_python_codec(self, typeoid, typename, typeschema): * self._local_type_codecs.pop(typeoid, None) * self.clear_type_cache() # <<<<<<<<<<<<<< * * def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_type_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 530, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":528 * format, xformat) * * def remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * self._local_type_codecs.pop(typeoid, None) * self.clear_type_cache() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __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":532 * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { 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; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_set_builtin_type_codec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,&__pyx_n_s_typekind,&__pyx_n_s_alias_to,&__pyx_n_s_format,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[5] = __pyx_k__37; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeoid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, 1); __PYX_ERR(4, 532, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeschema)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, 2); __PYX_ERR(4, 532, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typekind)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, 3); __PYX_ERR(4, 532, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alias_to)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, 4); __PYX_ERR(4, 532, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set_builtin_type_codec") < 0)) __PYX_ERR(4, 532, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; __pyx_v_typekind = values[3]; __pyx_v_alias_to = values[4]; __pyx_v_format = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 532, __pyx_L3_error) __pyx_L3_error:; __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 */ __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; PyObject *__pyx_v_formats = 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; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); uint32_t __pyx_t_7; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("_set_builtin_type_codec", 0); __Pyx_INCREF(__pyx_v_format); /* "asyncpg/protocol/codecs/base.pyx":538 * Codec target_codec * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) * else: */ __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_format, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 538, __pyx_L1_error) __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(4, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "asyncpg/protocol/codecs/base.pyx":539 * * if format == PG_FORMAT_ANY: * formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * else: * formats = (format,) */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_v_formats = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":538 * Codec target_codec * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":541 * formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) * else: * formats = (format,) # <<<<<<<<<<<<<< * * for format in formats: */ /*else*/ { __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_format); __pyx_v_formats = __pyx_t_4; __pyx_t_4 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":543 * formats = (format,) * * for format in formats: # <<<<<<<<<<<<<< * if self.get_codec(typeoid, format) is not None: * raise ValueError('cannot override codec for type {}'.format( */ if (likely(PyList_CheckExact(__pyx_v_formats)) || PyTuple_CheckExact(__pyx_v_formats)) { __pyx_t_4 = __pyx_v_formats; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_formats); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 543, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 543, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(4, 543, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 543, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":544 * * for format in formats: * if self.get_codec(typeoid, format) is not None: # <<<<<<<<<<<<<< * raise ValueError('cannot override codec for type {}'.format( * typeoid)) */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_typeoid); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 544, __pyx_L1_error) __pyx_t_8 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 544, __pyx_L1_error) __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_7, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = (__pyx_t_3 != 0); if (__pyx_t_9) { /* "asyncpg/protocol/codecs/base.pyx":545 * for format in formats: * if self.get_codec(typeoid, format) is not None: * raise ValueError('cannot override codec for type {}'.format( # <<<<<<<<<<<<<< * typeoid)) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_override_codec_for_type, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":546 * if self.get_codec(typeoid, format) is not None: * raise ValueError('cannot override codec for type {}'.format( * typeoid)) # <<<<<<<<<<<<<< * * if isinstance(alias_to, int): */ __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_10) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_typeoid); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_typeoid}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 545, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_typeoid}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 545, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_typeoid); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":545 * for format in formats: * if self.get_codec(typeoid, format) is not None: * raise ValueError('cannot override codec for type {}'.format( # <<<<<<<<<<<<<< * typeoid)) * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(4, 545, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":544 * * for format in formats: * if self.get_codec(typeoid, format) is not None: # <<<<<<<<<<<<<< * raise ValueError('cannot override codec for type {}'.format( * typeoid)) */ } /* "asyncpg/protocol/codecs/base.pyx":548 * typeoid)) * * if isinstance(alias_to, int): # <<<<<<<<<<<<<< * target_codec = self.get_codec(alias_to, format) * else: */ __pyx_t_9 = PyInt_Check(__pyx_v_alias_to); __pyx_t_3 = (__pyx_t_9 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/base.pyx":549 * * if isinstance(alias_to, int): * target_codec = self.get_codec(alias_to, format) # <<<<<<<<<<<<<< * else: * target_codec = get_extra_codec(alias_to, format) */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_alias_to); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 549, __pyx_L1_error) __pyx_t_8 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 549, __pyx_L1_error) __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_7, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_target_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":548 * typeoid)) * * if isinstance(alias_to, int): # <<<<<<<<<<<<<< * target_codec = self.get_codec(alias_to, format) * else: */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":551 * target_codec = self.get_codec(alias_to, format) * else: * target_codec = get_extra_codec(alias_to, format) # <<<<<<<<<<<<<< * * if target_codec is None: */ /*else*/ { if (!(likely(PyUnicode_CheckExact(__pyx_v_alias_to))||((__pyx_v_alias_to) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_alias_to)->tp_name), 0))) __PYX_ERR(4, 551, __pyx_L1_error) __pyx_t_8 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 551, __pyx_L1_error) __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_extra_codec(((PyObject*)__pyx_v_alias_to), __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_target_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L7:; /* "asyncpg/protocol/codecs/base.pyx":553 * target_codec = get_extra_codec(alias_to, format) * * if target_codec is None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_3 = (((PyObject *)__pyx_v_target_codec) == Py_None); __pyx_t_9 = (__pyx_t_3 != 0); if (__pyx_t_9) { /* "asyncpg/protocol/codecs/base.pyx":554 * * if target_codec is None: * continue # <<<<<<<<<<<<<< * * codec = target_codec.copy() */ goto __pyx_L4_continue; /* "asyncpg/protocol/codecs/base.pyx":553 * target_codec = get_extra_codec(alias_to, format) * * if target_codec is None: # <<<<<<<<<<<<<< * continue * */ } /* "asyncpg/protocol/codecs/base.pyx":556 * continue * * codec = target_codec.copy() # <<<<<<<<<<<<<< * codec.oid = typeoid * codec.name = typename */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(__pyx_v_target_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":557 * * codec = target_codec.copy() * codec.oid = typeoid # <<<<<<<<<<<<<< * codec.name = typename * codec.schema = typeschema */ __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_v_typeoid); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 557, __pyx_L1_error) __pyx_v_codec->oid = __pyx_t_7; /* "asyncpg/protocol/codecs/base.pyx":558 * codec = target_codec.copy() * codec.oid = typeoid * codec.name = typename # <<<<<<<<<<<<<< * codec.schema = typeschema * codec.kind = typekind */ if (!(likely(PyUnicode_CheckExact(__pyx_v_typename))||((__pyx_v_typename) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_typename)->tp_name), 0))) __PYX_ERR(4, 558, __pyx_L1_error) __pyx_t_1 = __pyx_v_typename; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_codec->name); __Pyx_DECREF(__pyx_v_codec->name); __pyx_v_codec->name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":559 * codec.oid = typeoid * codec.name = typename * codec.schema = typeschema # <<<<<<<<<<<<<< * codec.kind = typekind * */ if (!(likely(PyUnicode_CheckExact(__pyx_v_typeschema))||((__pyx_v_typeschema) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_typeschema)->tp_name), 0))) __PYX_ERR(4, 559, __pyx_L1_error) __pyx_t_1 = __pyx_v_typeschema; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_codec->schema); __Pyx_DECREF(__pyx_v_codec->schema); __pyx_v_codec->schema = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":560 * codec.name = typename * codec.schema = typeschema * codec.kind = typekind # <<<<<<<<<<<<<< * * self._local_type_codecs[typeoid] = codec */ if (!(likely(PyUnicode_CheckExact(__pyx_v_typekind))||((__pyx_v_typekind) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_typekind)->tp_name), 0))) __PYX_ERR(4, 560, __pyx_L1_error) __pyx_t_1 = __pyx_v_typekind; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_codec->kind); __Pyx_DECREF(__pyx_v_codec->kind); __pyx_v_codec->kind = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":562 * codec.kind = typekind * * self._local_type_codecs[typeoid] = codec # <<<<<<<<<<<<<< * break * else: */ if (unlikely(__pyx_v_self->_local_type_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 562, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_self->_local_type_codecs, __pyx_v_typeoid, ((PyObject *)__pyx_v_codec)) < 0)) __PYX_ERR(4, 562, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":563 * * self._local_type_codecs[typeoid] = codec * break # <<<<<<<<<<<<<< * else: * raise ValueError('unknown alias target: {}'.format(alias_to)) */ goto __pyx_L5_break; /* "asyncpg/protocol/codecs/base.pyx":543 * formats = (format,) * * for format in formats: # <<<<<<<<<<<<<< * if self.get_codec(typeoid, format) is not None: * raise ValueError('cannot override codec for type {}'.format( */ __pyx_L4_continue:; } /*else*/ { /* "asyncpg/protocol/codecs/base.pyx":565 * break * else: * raise ValueError('unknown alias target: {}'.format(alias_to)) # <<<<<<<<<<<<<< * * def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unknown_alias_target, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_11) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_alias_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_alias_to}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 565, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_alias_to}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 565, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_INCREF(__pyx_v_alias_to); __Pyx_GIVEREF(__pyx_v_alias_to); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_alias_to); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(4, 565, __pyx_L1_error) } /* "asyncpg/protocol/codecs/base.pyx":543 * formats = (format,) * * for format in formats: # <<<<<<<<<<<<<< * if self.get_codec(typeoid, format) is not None: * raise ValueError('cannot override codec for type {}'.format( */ __pyx_L5_break:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":532 * 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_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig._set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF((PyObject *)__pyx_v_target_codec); __Pyx_XDECREF(__pyx_v_formats); __Pyx_XDECREF(__pyx_v_format); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":567 * raise ValueError('unknown alias target: {}'.format(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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { 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; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_builtin_type_codec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,&__pyx_n_s_typekind,&__pyx_n_s_alias_to,&__pyx_n_s_format,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[5] = __pyx_k__38; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeoid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, 1); __PYX_ERR(4, 567, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typeschema)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, 2); __PYX_ERR(4, 567, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_typekind)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, 3); __PYX_ERR(4, 567, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alias_to)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, 4); __PYX_ERR(4, 567, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_builtin_type_codec") < 0)) __PYX_ERR(4, 567, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; __pyx_v_typekind = values[3]; __pyx_v_alias_to = values[4]; __pyx_v_format = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 567, __pyx_L3_error) __pyx_L3_error:; __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 */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_10set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("set_builtin_type_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":569 * def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, * alias_to, format=PG_FORMAT_ANY): * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format) * self.clear_type_cache() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_builtin_type_codec_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":570 * alias_to, format=PG_FORMAT_ANY): * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, * alias_to, format) # <<<<<<<<<<<<<< * self.clear_type_cache() * */ __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 6+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 569, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 6+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 569, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(6+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_typeoid); __Pyx_INCREF(__pyx_v_typename); __Pyx_GIVEREF(__pyx_v_typename); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_typename); __Pyx_INCREF(__pyx_v_typeschema); __Pyx_GIVEREF(__pyx_v_typeschema); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_typeschema); __Pyx_INCREF(__pyx_v_typekind); __Pyx_GIVEREF(__pyx_v_typekind); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_typekind); __Pyx_INCREF(__pyx_v_alias_to); __Pyx_GIVEREF(__pyx_v_alias_to); PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_alias_to); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_format); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":571 * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, * alias_to, format) * self.clear_type_cache() # <<<<<<<<<<<<<< * * def clear_type_cache(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_type_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 571, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 571, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":567 * raise ValueError('unknown alias target: {}'.format(alias_to)) * * def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format=PG_FORMAT_ANY): * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __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":573 * self.clear_type_cache() * * def clear_type_cache(self): # <<<<<<<<<<<<<< * self._type_codecs_cache.clear() * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear_type_cache (wrapper)", 0); __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; __Pyx_RefNannySetupContext("clear_type_cache", 0); /* "asyncpg/protocol/codecs/base.pyx":574 * * def clear_type_cache(self): * self._type_codecs_cache.clear() # <<<<<<<<<<<<<< * * def declare_fallback_codec(self, uint32_t oid, str name, str schema): */ if (unlikely(__pyx_v_self->_type_codecs_cache == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(4, 574, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_self->_type_codecs_cache); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 574, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":573 * self.clear_type_cache() * * def clear_type_cache(self): # <<<<<<<<<<<<<< * self._type_codecs_cache.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":576 * self._type_codecs_cache.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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { uint32_t __pyx_v_oid; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_schema = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("declare_fallback_codec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oid,&__pyx_n_s_name,&__pyx_n_s_schema,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("declare_fallback_codec", 1, 3, 3, 1); __PYX_ERR(4, 576, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_schema)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("declare_fallback_codec", 1, 3, 3, 2); __PYX_ERR(4, 576, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "declare_fallback_codec") < 0)) __PYX_ERR(4, 576, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_oid = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 576, __pyx_L3_error) __pyx_v_name = ((PyObject*)values[1]); __pyx_v_schema = ((PyObject*)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("declare_fallback_codec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 576, __pyx_L3_error) __pyx_L3_error:; __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(4, 576, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), (&PyUnicode_Type), 1, "schema", 1))) __PYX_ERR(4, 576, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_14declare_fallback_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_oid, __pyx_v_name, __pyx_v_schema); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __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 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; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("declare_fallback_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":579 * cdef Codec codec * * codec = self.get_codec(oid, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * if codec is not None: * return codec */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":580 * * codec = self.get_codec(oid, PG_FORMAT_TEXT) * if codec is not None: # <<<<<<<<<<<<<< * return codec * */ __pyx_t_2 = (((PyObject *)__pyx_v_codec) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/base.pyx":581 * codec = self.get_codec(oid, PG_FORMAT_TEXT) * if codec is not None: * return codec # <<<<<<<<<<<<<< * * if oid <= MAXBUILTINOID: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_codec)); __pyx_r = ((PyObject *)__pyx_v_codec); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":580 * * codec = self.get_codec(oid, PG_FORMAT_TEXT) * if codec is not None: # <<<<<<<<<<<<<< * return codec * */ } /* "asyncpg/protocol/codecs/base.pyx":583 * return codec * * if oid <= MAXBUILTINOID: # <<<<<<<<<<<<<< * # This is a BKI type, for which asyncpg has no * # defined codec. This should only happen for newly */ __pyx_t_3 = ((__pyx_v_oid <= 0x270F) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/base.pyx":590 * # * raise NotImplementedError( * 'unhandled standard data type {!r} (OID {})'.format( # <<<<<<<<<<<<<< * name, oid)) * else: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unhandled_standard_data_type_r_O, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/base.pyx":591 * raise NotImplementedError( * 'unhandled standard data type {!r} (OID {})'.format( * name, oid)) # <<<<<<<<<<<<<< * else: * # This is a non-BKI type, and as such, has no */ __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_name, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 590, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_name, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 590, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":589 * # asyncpg is lacking support. * # * raise NotImplementedError( # <<<<<<<<<<<<<< * 'unhandled standard data type {!r} (OID {})'.format( * name, oid)) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(4, 589, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":583 * return 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":599 * # using Connection.set_type_codec(). * # * self._set_builtin_type_codec(oid, name, schema, 'scalar', # <<<<<<<<<<<<<< * TEXTOID, PG_FORMAT_TEXT) * */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_builtin_type_codec_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":600 * # * self._set_builtin_type_codec(oid, name, schema, 'scalar', * TEXTOID, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * * codec = self.get_codec(oid, PG_FORMAT_TEXT) */ __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[7] = {__pyx_t_6, __pyx_t_8, __pyx_v_name, __pyx_v_schema, __pyx_n_u_scalar, __pyx_int_25, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 6+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 599, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[7] = {__pyx_t_6, __pyx_t_8, __pyx_v_name, __pyx_v_schema, __pyx_n_u_scalar, __pyx_int_25, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 6+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 599, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_9 = PyTuple_New(6+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_v_name); __Pyx_INCREF(__pyx_v_schema); __Pyx_GIVEREF(__pyx_v_schema); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_7, __pyx_v_schema); __Pyx_INCREF(__pyx_n_u_scalar); __Pyx_GIVEREF(__pyx_n_u_scalar); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_7, __pyx_n_u_scalar); __Pyx_INCREF(__pyx_int_25); __Pyx_GIVEREF(__pyx_int_25); PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_7, __pyx_int_25); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 5+__pyx_t_7, __pyx_t_5); __pyx_t_8 = 0; __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":602 * TEXTOID, PG_FORMAT_TEXT) * * codec = self.get_codec(oid, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * * return codec */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1)); __pyx_t_1 = 0; } /* "asyncpg/protocol/codecs/base.pyx":604 * 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":576 * self._type_codecs_cache.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_1); __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.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":606 * return codec * * cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format): # <<<<<<<<<<<<<< * 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_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; 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 = NULL; int __pyx_t_9; __Pyx_RefNannySetupContext("get_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":609 * cdef Codec codec * * codec = self.get_local_codec(oid) # <<<<<<<<<<<<<< * if codec is not None: * if codec.format != format: */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_local_codec(__pyx_v_self, __pyx_v_oid)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":610 * * codec = self.get_local_codec(oid) * if codec is not None: # <<<<<<<<<<<<<< * if codec.format != format: * # The codec for this OID has been overridden by */ __pyx_t_2 = (((PyObject *)__pyx_v_codec) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/base.pyx":611 * codec = self.get_local_codec(oid) * 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_3 = ((__pyx_v_codec->format != __pyx_v_format) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/base.pyx":615 * # 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_INCREF(Py_None); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":611 * codec = self.get_local_codec(oid) * 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":617 * 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":610 * * codec = self.get_local_codec(oid) * if codec is not None: # <<<<<<<<<<<<<< * if codec.format != format: * # The codec for this OID has been overridden by */ } /* "asyncpg/protocol/codecs/base.pyx":619 * return codec * * codec = get_core_codec(oid, format) # <<<<<<<<<<<<<< * if codec is not None: * return codec */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_v_format, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":620 * * codec = get_core_codec(oid, format) * if codec is not None: # <<<<<<<<<<<<<< * return codec * else: */ __pyx_t_3 = (((PyObject *)__pyx_v_codec) != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/base.pyx":621 * 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":620 * * codec = get_core_codec(oid, format) * if codec is not None: # <<<<<<<<<<<<<< * return codec * else: */ } /* "asyncpg/protocol/codecs/base.pyx":623 * return codec * else: * try: # <<<<<<<<<<<<<< * return self._type_codecs_cache[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":624 * else: * try: * return self._type_codecs_cache[oid, format] # <<<<<<<<<<<<<< * except KeyError: * return None */ __Pyx_XDECREF(((PyObject *)__pyx_r)); if (unlikely(__pyx_v_self->_type_codecs_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 624, __pyx_L6_error) } __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 624, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 624, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 624, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->_type_codecs_cache, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 624, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(4, 624, __pyx_L6_error) __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L10_try_return; /* "asyncpg/protocol/codecs/base.pyx":623 * return codec * else: * try: # <<<<<<<<<<<<<< * return self._type_codecs_cache[oid, format] * except KeyError: */ } __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":625 * try: * return self._type_codecs_cache[oid, format] * except KeyError: # <<<<<<<<<<<<<< * return None * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.get_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_1) < 0) __PYX_ERR(4, 625, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/codecs/base.pyx":626 * return self._type_codecs_cache[oid, format] * except KeyError: * return None # <<<<<<<<<<<<<< * * cdef inline Codec get_local_codec(self, uint32_t oid): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(Py_None); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L9_except_return; } goto __pyx_L8_except_error; __pyx_L8_except_error:; /* "asyncpg/protocol/codecs/base.pyx":623 * return codec * else: * try: # <<<<<<<<<<<<<< * return self._type_codecs_cache[oid, format] * except KeyError: */ __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_L10_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_L9_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":606 * return codec * * cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format): # <<<<<<<<<<<<<< * cdef Codec codec * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __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":628 * return None * * cdef inline Codec get_local_codec(self, uint32_t oid): # <<<<<<<<<<<<<< * return self._local_type_codecs.get(oid) * */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_local_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_local_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":629 * * cdef inline Codec get_local_codec(self, uint32_t oid): * return self._local_type_codecs.get(oid) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); if (unlikely(__pyx_v_self->_local_type_codecs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(4, 629, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_local_type_codecs, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(4, 629, __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":628 * return None * * cdef inline Codec get_local_codec(self, uint32_t oid): # <<<<<<<<<<<<<< * return self._local_type_codecs.get(oid) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.get_local_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef bint use_setstate * state = (self._local_type_codecs, self._type_codecs_cache) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __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) { int __pyx_v_use_setstate; PyObject *__pyx_v_state = NULL; PyObject *__pyx_v__dict = 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; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":3 * def __reduce_cython__(self): * cdef bint use_setstate * state = (self._local_type_codecs, self._type_codecs_cache) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->_local_type_codecs); __Pyx_GIVEREF(__pyx_v_self->_local_type_codecs); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_local_type_codecs); __Pyx_INCREF(__pyx_v_self->_type_codecs_cache); __Pyx_GIVEREF(__pyx_v_self->_type_codecs_cache); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_type_codecs_cache); __pyx_v_state = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":4 * cdef bint use_setstate * state = (self._local_type_codecs, self._type_codecs_cache) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":5 * state = (self._local_type_codecs, self._type_codecs_cache) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "(tree fragment)":6 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __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)":7 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._local_type_codecs is not None or self._type_codecs_cache is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":5 * state = (self._local_type_codecs, self._type_codecs_cache) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":9 * use_setstate = True * else: * use_setstate = self._local_type_codecs is not None or self._type_codecs_cache is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xb75bfc9, None), state */ /*else*/ { __pyx_t_2 = (__pyx_v_self->_local_type_codecs != ((PyObject*)Py_None)); __pyx_t_5 = (__pyx_t_2 != 0); if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->_type_codecs_cache != ((PyObject*)Py_None)); __pyx_t_2 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_2; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_3; } __pyx_L3:; /* "(tree fragment)":10 * else: * use_setstate = self._local_type_codecs is not None or self._type_codecs_cache is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_DataCodecConfig, (type(self), 0xb75bfc9, None), state * else: */ __pyx_t_3 = (__pyx_v_use_setstate != 0); if (__pyx_t_3) { /* "(tree fragment)":11 * use_setstate = self._local_type_codecs is not None or self._type_codecs_cache is not None * if use_setstate: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xb75bfc9, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xb75bfc9, state) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_DataCodecConfig); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 11, __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)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_192266185); __Pyx_GIVEREF(__pyx_int_192266185); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_192266185); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "(tree fragment)":10 * else: * use_setstate = self._local_type_codecs is not None or self._type_codecs_cache is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_DataCodecConfig, (type(self), 0xb75bfc9, None), state * else: */ } /* "(tree fragment)":13 * return __pyx_unpickle_DataCodecConfig, (type(self), 0xb75bfc9, None), state * else: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xb75bfc9, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_DataCodecConfig); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_192266185); __Pyx_GIVEREF(__pyx_int_192266185); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_192266185); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_6 = 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 bint use_setstate * state = (self._local_type_codecs, self._type_codecs_cache) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __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)":14 * else: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xb75bfc9, 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, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_18__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __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; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":15 * return __pyx_unpickle_DataCodecConfig, (type(self), 0xb75bfc9, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 15, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":14 * else: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xb75bfc9, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":632 * * * cdef inline Codec get_core_codec( # <<<<<<<<<<<<<< * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec *__pyx_optional_args) { enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat = __pyx_k__39; void *__pyx_v_ptr; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_core_codec", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_xformat = __pyx_optional_args->xformat; } } /* "asyncpg/protocol/codecs/base.pyx":636 * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): * cdef: * void *ptr = NULL # <<<<<<<<<<<<<< * * if oid > MAXSUPPORTEDOID: */ __pyx_v_ptr = NULL; /* "asyncpg/protocol/codecs/base.pyx":638 * void *ptr = NULL * * if oid > MAXSUPPORTEDOID: # <<<<<<<<<<<<<< * return None * if format == PG_FORMAT_BINARY: */ __pyx_t_1 = ((__pyx_v_oid > 0x1000) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":639 * * if oid > MAXSUPPORTEDOID: * return None # <<<<<<<<<<<<<< * if format == PG_FORMAT_BINARY: * ptr = binary_codec_map[oid * xformat] */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(Py_None); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":638 * void *ptr = NULL * * if oid > MAXSUPPORTEDOID: # <<<<<<<<<<<<<< * return None * if format == PG_FORMAT_BINARY: */ } /* "asyncpg/protocol/codecs/base.pyx":640 * if oid > MAXSUPPORTEDOID: * return None * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * ptr = binary_codec_map[oid * xformat] * elif format == PG_FORMAT_TEXT: */ switch (__pyx_v_format) { case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY: /* "asyncpg/protocol/codecs/base.pyx":641 * return None * if format == PG_FORMAT_BINARY: * ptr = binary_codec_map[oid * xformat] # <<<<<<<<<<<<<< * elif format == PG_FORMAT_TEXT: * ptr = text_codec_map[oid * xformat] */ __pyx_v_ptr = (__pyx_v_7asyncpg_8protocol_8protocol_binary_codec_map[(__pyx_v_oid * __pyx_v_xformat)]); /* "asyncpg/protocol/codecs/base.pyx":640 * if oid > MAXSUPPORTEDOID: * return None * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * ptr = binary_codec_map[oid * xformat] * elif format == PG_FORMAT_TEXT: */ break; /* "asyncpg/protocol/codecs/base.pyx":642 * if format == PG_FORMAT_BINARY: * ptr = binary_codec_map[oid * xformat] * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * ptr = text_codec_map[oid * xformat] * */ case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT: /* "asyncpg/protocol/codecs/base.pyx":643 * ptr = binary_codec_map[oid * xformat] * elif format == PG_FORMAT_TEXT: * ptr = text_codec_map[oid * xformat] # <<<<<<<<<<<<<< * * if ptr is NULL: */ __pyx_v_ptr = (__pyx_v_7asyncpg_8protocol_8protocol_text_codec_map[(__pyx_v_oid * __pyx_v_xformat)]); /* "asyncpg/protocol/codecs/base.pyx":642 * if format == PG_FORMAT_BINARY: * ptr = binary_codec_map[oid * xformat] * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * ptr = text_codec_map[oid * xformat] * */ break; default: break; } /* "asyncpg/protocol/codecs/base.pyx":645 * ptr = text_codec_map[oid * xformat] * * if ptr is NULL: # <<<<<<<<<<<<<< * return None * else: */ __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":646 * * if ptr is NULL: * return None # <<<<<<<<<<<<<< * else: * return ptr */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(Py_None); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":645 * ptr = text_codec_map[oid * xformat] * * if ptr is NULL: # <<<<<<<<<<<<<< * return None * else: */ } /* "asyncpg/protocol/codecs/base.pyx":648 * 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":632 * * * cdef inline Codec get_core_codec( # <<<<<<<<<<<<<< * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":651 * * * cdef inline Codec get_any_core_codec( # <<<<<<<<<<<<<< * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_any_core_codec(uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_any_core_codec *__pyx_optional_args) { enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat = __pyx_k__40; 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_t_4; __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":658 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":659 * * 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(4, 659, __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":660 * 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); __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":661 * 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(4, 661, __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":660 * 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":658 * 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":663 * 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(4, 663, __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":665 * 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":651 * * * 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":668 * * * cdef inline int has_core_codec(uint32_t oid): # <<<<<<<<<<<<<< * return binary_codec_map[oid] != NULL or text_codec_map[oid] != NULL * */ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol_has_core_codec(uint32_t __pyx_v_oid) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("has_core_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":669 * * cdef inline int has_core_codec(uint32_t oid): * return binary_codec_map[oid] != NULL or text_codec_map[oid] != NULL # <<<<<<<<<<<<<< * * */ __pyx_t_2 = ((__pyx_v_7asyncpg_8protocol_8protocol_binary_codec_map[__pyx_v_oid]) != NULL); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_2 = ((__pyx_v_7asyncpg_8protocol_8protocol_text_codec_map[__pyx_v_oid]) != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":668 * * * cdef inline int has_core_codec(uint32_t oid): # <<<<<<<<<<<<<< * return binary_codec_map[oid] != NULL or text_codec_map[oid] != NULL * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":672 * * * cdef register_core_codec(uint32_t oid, # <<<<<<<<<<<<<< * encode_func encode, * decode_func decode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(uint32_t __pyx_v_oid, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_encode, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_decode, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec *__pyx_optional_args) { enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat = __pyx_k__41; 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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; __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":678 * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): * * if oid > MAXSUPPORTEDOID: # <<<<<<<<<<<<<< * raise RuntimeError( * 'cannot register core codec for OID {}: it is greater ' */ __pyx_t_1 = ((__pyx_v_oid > 0x1000) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":681 * raise RuntimeError( * 'cannot register core codec for OID {}: it is greater ' * 'than MAXSUPPORTEDOID ({})'.format(oid, MAXSUPPORTEDOID)) # <<<<<<<<<<<<<< * * cdef: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_register_core_codec_for_O, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_int_4096}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 681, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_int_4096}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 681, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_int_4096); __Pyx_GIVEREF(__pyx_int_4096); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_int_4096); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":679 * * if oid > MAXSUPPORTEDOID: * raise RuntimeError( # <<<<<<<<<<<<<< * 'cannot register core codec for OID {}: it is greater ' * 'than MAXSUPPORTEDOID ({})'.format(oid, MAXSUPPORTEDOID)) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 679, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":678 * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): * * if oid > MAXSUPPORTEDOID: # <<<<<<<<<<<<<< * raise RuntimeError( * 'cannot register core codec for OID {}: it is greater ' */ } /* "asyncpg/protocol/codecs/base.pyx":688 * str kind * * name = TYPEMAP[oid] # <<<<<<<<<<<<<< * kind = 'array' if oid in ARRAY_TYPES else 'scalar' * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPEMAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_oid, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(4, 688, __pyx_L1_error) __pyx_v_name = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":689 * * name = TYPEMAP[oid] * kind = 'array' if oid in ARRAY_TYPES else 'scalar' # <<<<<<<<<<<<<< * * codec = Codec(oid) */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 689, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((__pyx_t_1 != 0)) { __Pyx_INCREF(__pyx_n_u_array); __pyx_t_3 = __pyx_n_u_array; } else { __Pyx_INCREF(__pyx_n_u_scalar); __pyx_t_3 = __pyx_n_u_scalar; } __pyx_v_kind = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":691 * 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, 0) */ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":692 * * codec = Codec(oid) * codec.init(name, 'pg_catalog', kind, CODEC_C, format, xformat, # <<<<<<<<<<<<<< * encode, decode, None, None, None, None, None, None, 0) * cpython.Py_INCREF(codec) # immortalize */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_n_u_pg_catalog, __pyx_v_kind, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C, __pyx_v_format, __pyx_v_xformat, __pyx_v_encode, __pyx_v_decode, 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_3)) __PYX_ERR(4, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":694 * codec.init(name, 'pg_catalog', kind, CODEC_C, format, xformat, * encode, decode, 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":696 * cpython.Py_INCREF(codec) # immortalize * * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * binary_codec_map[oid * xformat] = codec * elif format == PG_FORMAT_TEXT: */ switch (__pyx_v_format) { case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY: /* "asyncpg/protocol/codecs/base.pyx":697 * * if format == PG_FORMAT_BINARY: * binary_codec_map[oid * xformat] = codec # <<<<<<<<<<<<<< * elif format == PG_FORMAT_TEXT: * text_codec_map[oid * xformat] = codec */ (__pyx_v_7asyncpg_8protocol_8protocol_binary_codec_map[(__pyx_v_oid * __pyx_v_xformat)]) = ((void *)__pyx_v_codec); /* "asyncpg/protocol/codecs/base.pyx":696 * cpython.Py_INCREF(codec) # immortalize * * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * binary_codec_map[oid * xformat] = codec * elif format == PG_FORMAT_TEXT: */ break; /* "asyncpg/protocol/codecs/base.pyx":698 * if format == PG_FORMAT_BINARY: * binary_codec_map[oid * xformat] = codec * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * text_codec_map[oid * xformat] = codec * else: */ case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT: /* "asyncpg/protocol/codecs/base.pyx":699 * binary_codec_map[oid * xformat] = codec * elif format == PG_FORMAT_TEXT: * text_codec_map[oid * xformat] = codec # <<<<<<<<<<<<<< * else: * raise RuntimeError('invalid data format: {}'.format(format)) */ (__pyx_v_7asyncpg_8protocol_8protocol_text_codec_map[(__pyx_v_oid * __pyx_v_xformat)]) = ((void *)__pyx_v_codec); /* "asyncpg/protocol/codecs/base.pyx":698 * if format == PG_FORMAT_BINARY: * binary_codec_map[oid * xformat] = codec * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * text_codec_map[oid * xformat] = codec * else: */ break; default: /* "asyncpg/protocol/codecs/base.pyx":701 * text_codec_map[oid * xformat] = codec * else: * raise RuntimeError('invalid data format: {}'.format(format)) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_data_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 701, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 701, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 701, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 701, __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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 701, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":672 * * * 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_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":704 * * * 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; __Pyx_RefNannySetupContext("register_extra_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":712 * str kind * * kind = 'scalar' # <<<<<<<<<<<<<< * * codec = Codec(INVALIDOID) */ __Pyx_INCREF(__pyx_n_u_scalar); __pyx_v_kind = __pyx_n_u_scalar; /* "asyncpg/protocol/codecs/base.pyx":714 * kind = 'scalar' * * codec = Codec(INVALIDOID) # <<<<<<<<<<<<<< * codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, * encode, decode, None, None, None, None, None, None, 0) */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":715 * * codec = Codec(INVALIDOID) * codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, # <<<<<<<<<<<<<< * encode, decode, None, None, None, None, None, None, 0) * EXTRA_CODECS[name, format] = codec */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, ((PyObject*)Py_None), __pyx_v_kind, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C, __pyx_v_format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, __pyx_v_encode, __pyx_v_decode, 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(4, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":717 * codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, * encode, decode, None, None, None, None, None, None, 0) * EXTRA_CODECS[name, format] = codec # <<<<<<<<<<<<<< * * */ if (unlikely(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(4, 717, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyDict_SetItem(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS, __pyx_t_2, ((PyObject *)__pyx_v_codec)) < 0)) __PYX_ERR(4, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":704 * * * cdef register_extra_codec(str name, # <<<<<<<<<<<<<< * encode_func encode, * decode_func decode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.register_extra_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF(__pyx_v_kind); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":720 * * * cdef inline Codec get_extra_codec(str name, ServerDataFormat format): # <<<<<<<<<<<<<< * return EXTRA_CODECS.get((name, format)) */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_extra_codec(PyObject *__pyx_v_name, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_extra_codec", 0); /* "asyncpg/protocol/codecs/base.pyx":721 * * cdef inline Codec get_extra_codec(str name, ServerDataFormat format): * return EXTRA_CODECS.get((name, format)) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(((PyObject *)__pyx_r)); if (unlikely(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(4, 721, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(4, 721, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":720 * * * cdef inline Codec get_extra_codec(str name, ServerDataFormat format): # <<<<<<<<<<<<<< * return EXTRA_CODECS.get((name, format)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.get_extra_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/textutils.pyx":8 * * * cdef inline uint32_t _apg_tolower(uint32_t c): # <<<<<<<<<<<<<< * if c >= 'A' and c <= 'Z': * return c + 'a' - 'A' */ static CYTHON_INLINE uint32_t __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(uint32_t __pyx_v_c) { uint32_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("_apg_tolower", 0); /* "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))) != 0); 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))) != 0); __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:; __Pyx_RefNannyFinishContext(); 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; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("apg_strcasecmp", 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) != 0); 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_v_c1 = __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c1); /* "asyncpg/protocol/codecs/textutils.pyx":27 * if c1 != c2: * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) # <<<<<<<<<<<<<< * if c1 != c2: * return c1 - c2 */ __pyx_v_c2 = __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c2); /* "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) != 0); 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_2 = ((__pyx_v_c1 == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } __pyx_t_2 = ((__pyx_v_c2 == 0) != 0); __pyx_t_1 = __pyx_t_2; __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_L0:; __Pyx_RefNannyFinishContext(); 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; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("apg_strcasecmp_char", 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) != 0); 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_v_c1 = ((uint8_t)__pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c1)); /* "asyncpg/protocol/codecs/textutils.pyx":51 * if c1 != c2: * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) # <<<<<<<<<<<<<< * if c1 != c2: * return c1 - c2 */ __pyx_v_c2 = ((uint8_t)__pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c2)); /* "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) != 0); 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_2 = ((__pyx_v_c1 == 0) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } __pyx_t_2 = ((__pyx_v_c2 == 0) != 0); __pyx_t_1 = __pyx_t_2; __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_L0:; __Pyx_RefNannyFinishContext(); 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; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("apg_ascii_isspace", 0); /* "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: /* "asyncpg/protocol/codecs/textutils.pyx":66 * return ( * ch == ' ' or * ch == '\n' or # <<<<<<<<<<<<<< * ch == '\r' or * ch == '\t' or */ case 10: /* "asyncpg/protocol/codecs/textutils.pyx":67 * ch == ' ' or * ch == '\n' or * ch == '\r' or # <<<<<<<<<<<<<< * ch == '\t' or * ch == '\v' or */ case 13: /* "asyncpg/protocol/codecs/textutils.pyx":68 * ch == '\n' or * ch == '\r' or * ch == '\t' or # <<<<<<<<<<<<<< * ch == '\v' or * ch == '\f' */ case 9: /* "asyncpg/protocol/codecs/textutils.pyx":69 * ch == '\r' or * ch == '\t' or * ch == '\v' or # <<<<<<<<<<<<<< * ch == '\f' * ) */ case 11: /* "asyncpg/protocol/codecs/textutils.pyx":70 * 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:; __Pyx_RefNannyFinishContext(); 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; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("apg_parse_int32", 0); /* "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) != 0); 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) != 0); 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))) != 0); 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))) != 0); __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) != 0); 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)) != 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:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/bytea.pyx":8 * * * cdef bytea_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * Py_buffer pybuf */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bytea_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("bytea_encode", 0); /* "asyncpg/protocol/codecs/bytea.pyx":11 * cdef: * Py_buffer pybuf * bint pybuf_used = False # <<<<<<<<<<<<<< * char *buf * ssize_t len */ __pyx_v_pybuf_used = 0; /* "asyncpg/protocol/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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/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/protocol/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/protocol/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/protocol/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(9, 19, __pyx_L1_error) /* "asyncpg/protocol/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/protocol/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/protocol/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/protocol/codecs/bytea.pyx":24 * len = pybuf.len * * try: # <<<<<<<<<<<<<< * wbuf.write_int32(len) * wbuf.write_cstr(buf, len) */ /*try:*/ { /* "asyncpg/protocol/codecs/bytea.pyx":25 * * try: * wbuf.write_int32(len) # <<<<<<<<<<<<<< * wbuf.write_cstr(buf, len) * finally: */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_len)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 25, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/bytea.pyx":26 * try: * wbuf.write_int32(len) * wbuf.write_cstr(buf, len) # <<<<<<<<<<<<<< * finally: * if pybuf_used: */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_wbuf, __pyx_v_buf, __pyx_v_len); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 26, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/codecs/bytea.pyx":28 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = (__pyx_v_pybuf_used != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/bytea.pyx":29 * finally: * if pybuf_used: * cpython.PyBuffer_Release(&pybuf) # <<<<<<<<<<<<<< * * */ PyBuffer_Release((&__pyx_v_pybuf)); /* "asyncpg/protocol/codecs/bytea.pyx":28 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ } goto __pyx_L6; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L5_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_2 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { __pyx_t_1 = (__pyx_v_pybuf_used != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/bytea.pyx":29 * finally: * if pybuf_used: * cpython.PyBuffer_Release(&pybuf) # <<<<<<<<<<<<<< * * */ PyBuffer_Release((&__pyx_v_pybuf)); /* "asyncpg/protocol/codecs/bytea.pyx":28 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; } __pyx_L6:; } /* "asyncpg/protocol/codecs/bytea.pyx":8 * * * cdef bytea_encode(ConnectionSettings 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.protocol.protocol.bytea_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/bytea.pyx":32 * * * cdef bytea_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef ssize_t buf_len = buf.len * return cpython.PyBytes_FromStringAndSize(buf.read_all(), buf_len) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bytea_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { Py_ssize_t __pyx_v_buf_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("bytea_decode", 0); /* "asyncpg/protocol/codecs/bytea.pyx":33 * * cdef bytea_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef ssize_t buf_len = buf.len # <<<<<<<<<<<<<< * return cpython.PyBytes_FromStringAndSize(buf.read_all(), buf_len) * */ __pyx_t_1 = __pyx_v_buf->len; __pyx_v_buf_len = __pyx_t_1; /* "asyncpg/protocol/codecs/bytea.pyx":34 * cdef bytea_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef ssize_t buf_len = buf.len * return cpython.PyBytes_FromStringAndSize(buf.read_all(), buf_len) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyBytes_FromStringAndSize(__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read_all(__pyx_v_buf), __pyx_v_buf_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/bytea.pyx":32 * * * cdef bytea_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef ssize_t buf_len = buf.len * return cpython.PyBytes_FromStringAndSize(buf.read_all(), buf_len) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.bytea_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/bytea.pyx":37 * * * cdef init_bytea_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BYTEAOID, * &bytea_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bytea_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_bytea_codecs", 0); /* "asyncpg/protocol/codecs/bytea.pyx":38 * * cdef init_bytea_codecs(): * register_core_codec(BYTEAOID, # <<<<<<<<<<<<<< * &bytea_encode, * &bytea_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(17, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_bytea_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_bytea_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/bytea.pyx":43 * PG_FORMAT_BINARY) * * register_core_codec(CHAROID, # <<<<<<<<<<<<<< * &bytea_encode, * &bytea_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(18, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_bytea_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_bytea_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/bytea.pyx":37 * * * cdef init_bytea_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BYTEAOID, * &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/text.pyx":8 * * * cdef inline as_pg_string_and_size( # <<<<<<<<<<<<<< * ConnectionSettings settings, obj, char **cstr, ssize_t *size): * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_as_pg_string_and_size(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__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; char *__pyx_t_7; int __pyx_t_8; __Pyx_RefNannySetupContext("as_pg_string_and_size", 0); /* "asyncpg/protocol/codecs/text.pyx":11 * ConnectionSettings 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) != 0)) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/text.pyx":12 * * if not cpython.PyUnicode_Check(obj): * raise TypeError('expected str, got {}'.format(type(obj).__name__)) # <<<<<<<<<<<<<< * * if settings.is_encoding_utf8(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_expected_str_got, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(10, 12, __pyx_L1_error) /* "asyncpg/protocol/codecs/text.pyx":11 * ConnectionSettings settings, obj, char **cstr, ssize_t *size): * * if not cpython.PyUnicode_Check(obj): # <<<<<<<<<<<<<< * raise TypeError('expected str, got {}'.format(type(obj).__name__)) * */ } /* "asyncpg/protocol/codecs/text.pyx":14 * raise TypeError('expected str, got {}'.format(type(obj).__name__)) * * if settings.is_encoding_utf8(): # <<<<<<<<<<<<<< * cstr[0] = PyUnicode_AsUTF8AndSize(obj, size) * else: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_is_encoding_utf8(__pyx_v_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 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(10, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/text.pyx":15 * * if settings.is_encoding_utf8(): * cstr[0] = PyUnicode_AsUTF8AndSize(obj, size) # <<<<<<<<<<<<<< * else: * encoded = settings.get_text_codec().encode(obj) */ __pyx_t_7 = PyUnicode_AsUTF8AndSize(__pyx_v_obj, __pyx_v_size); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(10, 15, __pyx_L1_error) (__pyx_v_cstr[0]) = __pyx_t_7; /* "asyncpg/protocol/codecs/text.pyx":14 * raise TypeError('expected str, got {}'.format(type(obj).__name__)) * * if settings.is_encoding_utf8(): # <<<<<<<<<<<<<< * cstr[0] = PyUnicode_AsUTF8AndSize(obj, size) * else: */ goto __pyx_L4; } /* "asyncpg/protocol/codecs/text.pyx":17 * cstr[0] = PyUnicode_AsUTF8AndSize(obj, size) * else: * encoded = settings.get_text_codec().encode(obj) # <<<<<<<<<<<<<< * cpython.PyBytes_AsStringAndSize(encoded, cstr, size) * */ /*else*/ { __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec(__pyx_v_settings, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 17, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 17, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_encoded = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/text.pyx":18 * else: * encoded = settings.get_text_codec().encode(obj) * cpython.PyBytes_AsStringAndSize(encoded, cstr, size) # <<<<<<<<<<<<<< * * if size[0] > 0x7fffffff: */ __pyx_t_8 = PyBytes_AsStringAndSize(__pyx_v_encoded, __pyx_v_cstr, ((Py_ssize_t *)__pyx_v_size)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(10, 18, __pyx_L1_error) } __pyx_L4:; /* "asyncpg/protocol/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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/text.pyx":21 * * if size[0] > 0x7fffffff: * raise ValueError('string too long') # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 21, __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(10, 21, __pyx_L1_error) /* "asyncpg/protocol/codecs/text.pyx":20 * cpython.PyBytes_AsStringAndSize(encoded, cstr, size) * * if size[0] > 0x7fffffff: # <<<<<<<<<<<<<< * raise ValueError('string too long') * */ } /* "asyncpg/protocol/codecs/text.pyx":8 * * * cdef inline as_pg_string_and_size( # <<<<<<<<<<<<<< * ConnectionSettings 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.protocol.protocol.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/protocol/codecs/text.pyx":24 * * * cdef text_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("text_encode", 0); /* "asyncpg/protocol/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_8protocol_8protocol_as_pg_string_and_size(__pyx_v_settings, __pyx_v_obj, (&__pyx_v_str), (&__pyx_v_size)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/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_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_size)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/text.pyx":32 * * buf.write_int32(size) * buf.write_cstr(str, size) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_buf, __pyx_v_str, __pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/text.pyx":24 * * * cdef text_encode(ConnectionSettings 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.protocol.protocol.text_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/text.pyx":35 * * * cdef inline decode_pg_string(ConnectionSettings settings, const char* data, # <<<<<<<<<<<<<< * ssize_t len): * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_decode_pg_string(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__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; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("decode_pg_string", 0); /* "asyncpg/protocol/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 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_is_encoding_utf8(__pyx_v_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 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(10, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/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(10, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/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/protocol/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) * */ /*else*/ { __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_data, __pyx_v_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/text.pyx":43 * else: * bytes = cpython.PyBytes_FromStringAndSize(data, len) * return settings.get_text_codec().decode(bytes) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec(__pyx_v_settings, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_bytes}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 43, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_bytes}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 43, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_bytes); __Pyx_GIVEREF(__pyx_v_bytes); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_bytes); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "asyncpg/protocol/codecs/text.pyx":35 * * * cdef inline decode_pg_string(ConnectionSettings 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_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.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/protocol/codecs/text.pyx":46 * * * cdef text_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef ssize_t buf_len = buf.len * return decode_pg_string(settings, buf.read_all(), buf_len) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { Py_ssize_t __pyx_v_buf_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("text_decode", 0); /* "asyncpg/protocol/codecs/text.pyx":47 * * cdef text_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef ssize_t buf_len = buf.len # <<<<<<<<<<<<<< * return decode_pg_string(settings, buf.read_all(), buf_len) * */ __pyx_t_1 = __pyx_v_buf->len; __pyx_v_buf_len = __pyx_t_1; /* "asyncpg/protocol/codecs/text.pyx":48 * cdef text_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef ssize_t buf_len = buf.len * return decode_pg_string(settings, buf.read_all(), buf_len) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_decode_pg_string(__pyx_v_settings, __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read_all(__pyx_v_buf), __pyx_v_buf_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/text.pyx":46 * * * cdef text_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef ssize_t buf_len = buf.len * return decode_pg_string(settings, buf.read_all(), buf_len) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.text_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/text.pyx":51 * * * 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; __Pyx_RefNannySetupContext("init_text_codecs", 0); /* "asyncpg/protocol/codecs/text.pyx":52 * * cdef init_text_codecs(): * textoids = [ # <<<<<<<<<<<<<< * NAMEOID, * BPCHAROID, */ __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_19); __Pyx_GIVEREF(__pyx_int_19); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_19); __Pyx_INCREF(__pyx_int_1042); __Pyx_GIVEREF(__pyx_int_1042); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_1042); __Pyx_INCREF(__pyx_int_1043); __Pyx_GIVEREF(__pyx_int_1043); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_1043); __Pyx_INCREF(__pyx_int_25); __Pyx_GIVEREF(__pyx_int_25); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_25); __Pyx_INCREF(__pyx_int_142); __Pyx_GIVEREF(__pyx_int_142); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_142); __pyx_v_textoids = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/text.pyx":60 * ] * * for oid in textoids: # <<<<<<<<<<<<<< * register_core_codec(oid, * &text_encode, */ __pyx_t_1 = __pyx_v_textoids; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(10, 60, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/text.pyx":61 * * for oid in textoids: * register_core_codec(oid, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(10, 61, __pyx_L1_error) /* "asyncpg/protocol/codecs/text.pyx":64 * &text_encode, * &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_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/text.pyx":66 * PG_FORMAT_BINARY) * * register_core_codec(oid, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(10, 66, __pyx_L1_error) /* "asyncpg/protocol/codecs/text.pyx":69 * &text_encode, * &text_decode, * PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * * init_text_codecs() */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/text.pyx":60 * ] * * for oid in textoids: # <<<<<<<<<<<<<< * register_core_codec(oid, * &text_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/text.pyx":51 * * * 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/bits.pyx":11 * * * cdef bits_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * Py_buffer pybuf */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bits_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; __Pyx_RefNannySetupContext("bits_encode", 0); /* "asyncpg/protocol/codecs/bits.pyx":14 * cdef: * Py_buffer pybuf * bint pybuf_used = False # <<<<<<<<<<<<<< * char *buf * ssize_t len */ __pyx_v_pybuf_used = 0; /* "asyncpg/protocol/codecs/bits.pyx":19 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/bits.pyx":20 * * 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/protocol/codecs/bits.pyx":21 * if cpython.PyBytes_CheckExact(obj): * buf = cpython.PyBytes_AS_STRING(obj) * len = cpython.Py_SIZE(obj) # <<<<<<<<<<<<<< * bitlen = len * 8 * elif isinstance(obj, BitString): */ __pyx_v_len = Py_SIZE(__pyx_v_obj); /* "asyncpg/protocol/codecs/bits.pyx":22 * buf = cpython.PyBytes_AS_STRING(obj) * len = cpython.Py_SIZE(obj) * bitlen = len * 8 # <<<<<<<<<<<<<< * elif isinstance(obj, BitString): * cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) */ __pyx_v_bitlen = (__pyx_v_len * 8); /* "asyncpg/protocol/codecs/bits.pyx":19 * ssize_t bitlen * * if cpython.PyBytes_CheckExact(obj): # <<<<<<<<<<<<<< * buf = cpython.PyBytes_AS_STRING(obj) * len = cpython.Py_SIZE(obj) */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/bits.pyx":23 * len = cpython.Py_SIZE(obj) * bitlen = len * 8 * elif isinstance(obj, BitString): # <<<<<<<<<<<<<< * cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) * bitlen = obj.__len__() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_BitString); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/bits.pyx":24 * bitlen = len * 8 * elif isinstance(obj, BitString): * cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) # <<<<<<<<<<<<<< * bitlen = obj.__len__() * else: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyBytes_AsStringAndSize(__pyx_t_2, (&__pyx_v_buf), ((Py_ssize_t *)(&__pyx_v_len))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(11, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/bits.pyx":25 * elif isinstance(obj, BitString): * cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) * bitlen = obj.__len__() # <<<<<<<<<<<<<< * else: * cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_len); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 25, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = PyInt_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(11, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_bitlen = __pyx_t_7; /* "asyncpg/protocol/codecs/bits.pyx":23 * len = cpython.Py_SIZE(obj) * bitlen = len * 8 * elif isinstance(obj, BitString): # <<<<<<<<<<<<<< * cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) * bitlen = obj.__len__() */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/bits.pyx":27 * 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(11, 27, __pyx_L1_error) /* "asyncpg/protocol/codecs/bits.pyx":28 * else: * cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) * pybuf_used = True # <<<<<<<<<<<<<< * buf = pybuf.buf * len = pybuf.len */ __pyx_v_pybuf_used = 1; /* "asyncpg/protocol/codecs/bits.pyx":29 * 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/protocol/codecs/bits.pyx":30 * pybuf_used = True * buf = pybuf.buf * len = pybuf.len # <<<<<<<<<<<<<< * bitlen = len * 8 * */ __pyx_t_8 = __pyx_v_pybuf.len; __pyx_v_len = __pyx_t_8; /* "asyncpg/protocol/codecs/bits.pyx":31 * buf = pybuf.buf * len = pybuf.len * bitlen = len * 8 # <<<<<<<<<<<<<< * * try: */ __pyx_v_bitlen = (__pyx_v_len * 8); } __pyx_L3:; /* "asyncpg/protocol/codecs/bits.pyx":33 * bitlen = len * 8 * * try: # <<<<<<<<<<<<<< * if bitlen > _MAXINT32: * raise ValueError('bit value too long') */ /*try:*/ { /* "asyncpg/protocol/codecs/bits.pyx":34 * * try: * if bitlen > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('bit value too long') * wbuf.write_int32(4 + len) */ __pyx_t_3 = ((__pyx_v_bitlen > 0x7FFFFFFF) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/bits.pyx":35 * try: * if bitlen > _MAXINT32: * raise ValueError('bit value too long') # <<<<<<<<<<<<<< * wbuf.write_int32(4 + len) * wbuf.write_int32(bitlen) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 35, __pyx_L5_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, 35, __pyx_L5_error) /* "asyncpg/protocol/codecs/bits.pyx":34 * * try: * if bitlen > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('bit value too long') * wbuf.write_int32(4 + len) */ } /* "asyncpg/protocol/codecs/bits.pyx":36 * 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_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, (4 + ((int32_t)__pyx_v_len))); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 36, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/bits.pyx":37 * raise ValueError('bit value too long') * wbuf.write_int32(4 + len) * wbuf.write_int32(bitlen) # <<<<<<<<<<<<<< * wbuf.write_cstr(buf, len) * finally: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_bitlen)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 37, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/bits.pyx":38 * wbuf.write_int32(4 + len) * wbuf.write_int32(bitlen) * wbuf.write_cstr(buf, len) # <<<<<<<<<<<<<< * finally: * if pybuf_used: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_wbuf, __pyx_v_buf, __pyx_v_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 38, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "asyncpg/protocol/codecs/bits.pyx":40 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_3 = (__pyx_v_pybuf_used != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/bits.pyx":41 * finally: * if pybuf_used: * cpython.PyBuffer_Release(&pybuf) # <<<<<<<<<<<<<< * * */ PyBuffer_Release((&__pyx_v_pybuf)); /* "asyncpg/protocol/codecs/bits.pyx":40 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ } goto __pyx_L6; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L5_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_4 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { __pyx_t_3 = (__pyx_v_pybuf_used != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/bits.pyx":41 * finally: * if pybuf_used: * cpython.PyBuffer_Release(&pybuf) # <<<<<<<<<<<<<< * * */ PyBuffer_Release((&__pyx_v_pybuf)); /* "asyncpg/protocol/codecs/bits.pyx":40 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; } __pyx_L6:; } /* "asyncpg/protocol/codecs/bits.pyx":11 * * * cdef bits_encode(ConnectionSettings 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_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.bits_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/bits.pyx":44 * * * cdef bits_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t bitlen = hton.unpack_int32(buf.read(4)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bits_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; 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; __Pyx_RefNannySetupContext("bits_decode", 0); /* "asyncpg/protocol/codecs/bits.pyx":46 * cdef bits_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * int32_t bitlen = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * ssize_t buf_len = buf.len * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(11, 46, __pyx_L1_error) __pyx_v_bitlen = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/bits.pyx":47 * cdef: * int32_t bitlen = hton.unpack_int32(buf.read(4)) * ssize_t buf_len = buf.len # <<<<<<<<<<<<<< * * bytes_ = cpython.PyBytes_FromStringAndSize(buf.read_all(), buf_len) */ __pyx_t_2 = __pyx_v_buf->len; __pyx_v_buf_len = __pyx_t_2; /* "asyncpg/protocol/codecs/bits.pyx":49 * ssize_t buf_len = buf.len * * bytes_ = cpython.PyBytes_FromStringAndSize(buf.read_all(), buf_len) # <<<<<<<<<<<<<< * return BitString.frombytes(bytes_, bitlen) * */ __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read_all(__pyx_v_buf), __pyx_v_buf_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_bytes_ = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/bits.pyx":50 * * bytes_ = cpython.PyBytes_FromStringAndSize(buf.read_all(), buf_len) * return BitString.frombytes(bytes_, bitlen) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_BitString); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_bitlen); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_bytes_, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 50, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_bytes_, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 50, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_bytes_); __Pyx_GIVEREF(__pyx_v_bytes_); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_bytes_); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/bits.pyx":44 * * * cdef bits_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t bitlen = hton.unpack_int32(buf.read(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_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.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/protocol/codecs/bits.pyx":53 * * * cdef init_bits_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BITOID, * &bits_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bits_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_bits_codecs", 0); /* "asyncpg/protocol/codecs/bits.pyx":54 * * cdef init_bits_codecs(): * register_core_codec(BITOID, # <<<<<<<<<<<<<< * &bits_encode, * &bits_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x618, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_bits_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_bits_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/bits.pyx":59 * PG_FORMAT_BINARY) * * register_core_codec(VARBITOID, # <<<<<<<<<<<<<< * &bits_encode, * &bits_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x61A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_bits_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_bits_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/bits.pyx":53 * * * cdef init_bits_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BITOID, * &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/datetime.pyx":59 * * * 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_8protocol_8protocol__encode_time(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("_encode_time", 0); /* "asyncpg/protocol/codecs/datetime.pyx":63 * # 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/protocol/codecs/datetime.pyx":65 * 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_8protocol_8protocol_infinity_datetime_ts) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/datetime.pyx":66 * * 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_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_7asyncpg_8protocol_8protocol_pg_time64_infinity); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":65 * 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/protocol/codecs/datetime.pyx":67 * 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_8protocol_8protocol_negative_infinity_datetime_ts) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/datetime.pyx":68 * 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_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_7asyncpg_8protocol_8protocol_pg_time64_negative_infinity); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":67 * 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/protocol/codecs/datetime.pyx":70 * buf.write_int64(pg_time64_negative_infinity) * else: * buf.write_int64(ts) # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/datetime.pyx":59 * * * 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.protocol.protocol._encode_time", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":73 * * * cdef inline int32_t _decode_time(FastReadBuffer buf, int64_t *seconds, # <<<<<<<<<<<<<< * uint32_t *microseconds): * # XXX: add support for double timestamps */ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_8protocol__decode_time(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf, int64_t *__pyx_v_seconds, uint32_t *__pyx_v_microseconds) { int64_t __pyx_v_ts; int32_t __pyx_r; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("_decode_time", 0); /* "asyncpg/protocol/codecs/datetime.pyx":77 * # XXX: add support for double timestamps * # int64 timestamps, * cdef int64_t ts = hton.unpack_int64(buf.read(8)) # <<<<<<<<<<<<<< * * if ts == pg_time64_infinity: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 77, __pyx_L1_error) __pyx_v_ts = __pyx_f_7asyncpg_8protocol_4hton_unpack_int64(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":79 * cdef int64_t ts = hton.unpack_int64(buf.read(8)) * * if ts == pg_time64_infinity: # <<<<<<<<<<<<<< * return 1 * elif ts == pg_time64_negative_infinity: */ __pyx_t_2 = ((__pyx_v_ts == __pyx_v_7asyncpg_8protocol_8protocol_pg_time64_infinity) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/datetime.pyx":80 * * if ts == pg_time64_infinity: * return 1 # <<<<<<<<<<<<<< * elif ts == pg_time64_negative_infinity: * return -1 */ __pyx_r = 1; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":79 * cdef int64_t ts = hton.unpack_int64(buf.read(8)) * * if ts == pg_time64_infinity: # <<<<<<<<<<<<<< * return 1 * elif ts == pg_time64_negative_infinity: */ } /* "asyncpg/protocol/codecs/datetime.pyx":81 * if ts == pg_time64_infinity: * return 1 * elif ts == pg_time64_negative_infinity: # <<<<<<<<<<<<<< * return -1 * */ __pyx_t_2 = ((__pyx_v_ts == __pyx_v_7asyncpg_8protocol_8protocol_pg_time64_negative_infinity) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/datetime.pyx":82 * return 1 * elif ts == pg_time64_negative_infinity: * return -1 # <<<<<<<<<<<<<< * * seconds[0] = (ts / 1000000) */ __pyx_r = -1; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":81 * if ts == pg_time64_infinity: * return 1 * elif ts == pg_time64_negative_infinity: # <<<<<<<<<<<<<< * return -1 * */ } /* "asyncpg/protocol/codecs/datetime.pyx":84 * return -1 * * seconds[0] = (ts / 1000000) # <<<<<<<<<<<<<< * microseconds[0] = (ts % 1000000) * */ (__pyx_v_seconds[0]) = ((int64_t)(((double)__pyx_v_ts) / 1000000.0)); /* "asyncpg/protocol/codecs/datetime.pyx":85 * * seconds[0] = (ts / 1000000) * microseconds[0] = (ts % 1000000) # <<<<<<<<<<<<<< * * return 0 */ (__pyx_v_microseconds[0]) = ((uint32_t)__Pyx_mod_int64_t(__pyx_v_ts, 0xF4240)); /* "asyncpg/protocol/codecs/datetime.pyx":87 * microseconds[0] = (ts % 1000000) * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":73 * * * cdef inline int32_t _decode_time(FastReadBuffer buf, int64_t *seconds, # <<<<<<<<<<<<<< * uint32_t *microseconds): * # XXX: add support for double timestamps */ /* function exit code */ __pyx_L1_error:; __Pyx_WriteUnraisable("asyncpg.protocol.protocol._decode_time", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":90 * * * cdef date_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int32_t ordinal = cpython.PyLong_AsLong(obj.toordinal()) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_date_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int32_t __pyx_v_ordinal; int32_t __pyx_v_pg_ordinal; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; long __pyx_t_4; int __pyx_t_5; __Pyx_RefNannySetupContext("date_encode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":92 * cdef date_encode(ConnectionSettings settings, WriteBuffer buf, obj): * cdef: * int32_t ordinal = cpython.PyLong_AsLong(obj.toordinal()) # <<<<<<<<<<<<<< * int32_t pg_ordinal * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 92, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_4 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ordinal = ((int32_t)__pyx_t_4); /* "asyncpg/protocol/codecs/datetime.pyx":95 * 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_8protocol_8protocol_infinity_date_ord) != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/datetime.pyx":96 * * 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_8protocol_8protocol_pg_date_infinity; /* "asyncpg/protocol/codecs/datetime.pyx":95 * int32_t pg_ordinal * * if ordinal == infinity_date_ord: # <<<<<<<<<<<<<< * pg_ordinal = pg_date_infinity * elif ordinal == negative_infinity_date_ord: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/datetime.pyx":97 * 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_8protocol_8protocol_negative_infinity_date_ord) != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/datetime.pyx":98 * 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_8protocol_8protocol_pg_date_negative_infinity; /* "asyncpg/protocol/codecs/datetime.pyx":97 * 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/protocol/codecs/datetime.pyx":100 * 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_8protocol_8protocol_pg_date_offset_ord); } __pyx_L3:; /* "asyncpg/protocol/codecs/datetime.pyx":102 * pg_ordinal = ordinal - pg_date_offset_ord * * buf.write_int32(4) # <<<<<<<<<<<<<< * buf.write_int32(pg_ordinal) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":103 * * buf.write_int32(4) * buf.write_int32(pg_ordinal) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_pg_ordinal); 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/datetime.pyx":90 * * * cdef date_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int32_t ordinal = cpython.PyLong_AsLong(obj.toordinal()) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.date_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":106 * * * cdef date_encode_tuple(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int32_t pg_ordinal */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_date_encode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; int32_t __pyx_t_8; __Pyx_RefNannySetupContext("date_encode_tuple", 0); /* "asyncpg/protocol/codecs/datetime.pyx":110 * 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, 110, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 != 1) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/datetime.pyx":113 * raise ValueError( * 'date tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) # <<<<<<<<<<<<<< * * pg_ordinal = obj[0] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_date_tuple_encoder_expecting_1_e, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 113, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 113, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 113, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":111 * * if len(obj) != 1: * raise ValueError( # <<<<<<<<<<<<<< * 'date tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(12, 111, __pyx_L1_error) /* "asyncpg/protocol/codecs/datetime.pyx":110 * int32_t pg_ordinal * * if len(obj) != 1: # <<<<<<<<<<<<<< * raise ValueError( * 'date tuple encoder: expecting 1 element ' */ } /* "asyncpg/protocol/codecs/datetime.pyx":115 * '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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_pg_ordinal = __pyx_t_8; /* "asyncpg/protocol/codecs/datetime.pyx":116 * * pg_ordinal = obj[0] * buf.write_int32(4) # <<<<<<<<<<<<<< * buf.write_int32(pg_ordinal) * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":117 * pg_ordinal = obj[0] * buf.write_int32(4) * buf.write_int32(pg_ordinal) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_pg_ordinal); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":106 * * * cdef date_encode_tuple(ConnectionSettings 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.protocol.protocol.date_encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":120 * * * cdef date_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(4)) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_date_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("date_decode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":121 * * cdef date_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * * if pg_ordinal == pg_date_infinity: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 121, __pyx_L1_error) __pyx_v_pg_ordinal = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":123 * cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(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_8protocol_8protocol_pg_date_infinity) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/datetime.pyx":124 * * 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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_infinity_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":123 * cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(4)) * * if pg_ordinal == pg_date_infinity: # <<<<<<<<<<<<<< * return infinity_date * elif pg_ordinal == pg_date_negative_infinity: */ } /* "asyncpg/protocol/codecs/datetime.pyx":125 * 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_8protocol_8protocol_pg_date_negative_infinity) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/datetime.pyx":126 * 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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_negative_infinity_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":125 * if pg_ordinal == pg_date_infinity: * return infinity_date * elif pg_ordinal == pg_date_negative_infinity: # <<<<<<<<<<<<<< * return negative_infinity_date * else: */ } /* "asyncpg/protocol/codecs/datetime.pyx":128 * return negative_infinity_date * else: * return date_from_ordinal(pg_ordinal + pg_date_offset_ord) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_date_from_ordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int32_t((__pyx_v_pg_ordinal + __pyx_v_7asyncpg_8protocol_8protocol_pg_date_offset_ord)); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 128, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 128, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "asyncpg/protocol/codecs/datetime.pyx":120 * * * cdef date_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(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_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.protocol.protocol.date_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":131 * * * cdef date_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(4)) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_date_decode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; __Pyx_RefNannySetupContext("date_decode_tuple", 0); /* "asyncpg/protocol/codecs/datetime.pyx":132 * * cdef date_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): * cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * * return (pg_ordinal,) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 132, __pyx_L1_error) __pyx_v_pg_ordinal = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":134 * cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(4)) * * return (pg_ordinal,) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_pg_ordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":131 * * * cdef date_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef int32_t pg_ordinal = hton.unpack_int32(buf.read(4)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.date_decode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":137 * * * cdef timestamp_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * delta = obj - pg_epoch_datetime * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamp_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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 PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PY_LONG_LONG __pyx_t_3; long __pyx_t_4; __Pyx_RefNannySetupContext("timestamp_encode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":138 * * cdef timestamp_encode(ConnectionSettings settings, WriteBuffer buf, obj): * delta = obj - pg_epoch_datetime # <<<<<<<<<<<<<< * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pg_epoch_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Subtract(__pyx_v_obj, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_delta = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":140 * delta = obj - pg_epoch_datetime * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_days); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyLong_AsLongLong(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(12, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":141 * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ * cpython.PyLong_AsLong(delta.seconds) # <<<<<<<<<<<<<< * int32_t microseconds = cpython.PyLong_AsLong( * delta.microseconds) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_seconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_4 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":140 * 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_3 * 0x15180) + __pyx_t_4); /* "asyncpg/protocol/codecs/datetime.pyx":143 * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( * delta.microseconds) # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/datetime.pyx":142 * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * delta.microseconds) * */ __pyx_t_4 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_4 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_4); /* "asyncpg/protocol/codecs/datetime.pyx":145 * delta.microseconds) * * buf.write_int32(8) # <<<<<<<<<<<<<< * _encode_time(buf, seconds, microseconds) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":146 * * buf.write_int32(8) * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":137 * * * cdef timestamp_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * delta = obj - pg_epoch_datetime * 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_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.timestamp_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_delta); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":149 * * * cdef timestamp_encode_tuple(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamp_encode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; int64_t __pyx_t_8; __Pyx_RefNannySetupContext("timestamp_encode_tuple", 0); /* "asyncpg/protocol/codecs/datetime.pyx":153 * 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, 153, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 != 1) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/datetime.pyx":156 * raise ValueError( * 'timestamp tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) # <<<<<<<<<<<<<< * * microseconds = obj[0] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_timestamp_tuple_encoder_expectin, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 156, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 156, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 156, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":154 * * if len(obj) != 1: * raise ValueError( # <<<<<<<<<<<<<< * 'timestamp tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(12, 154, __pyx_L1_error) /* "asyncpg/protocol/codecs/datetime.pyx":153 * int64_t microseconds * * if len(obj) != 1: # <<<<<<<<<<<<<< * raise ValueError( * 'timestamp tuple encoder: expecting 1 element ' */ } /* "asyncpg/protocol/codecs/datetime.pyx":158 * '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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_microseconds = __pyx_t_8; /* "asyncpg/protocol/codecs/datetime.pyx":160 * microseconds = obj[0] * * buf.write_int32(8) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":161 * * buf.write_int32(8) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":149 * * * cdef timestamp_encode_tuple(ConnectionSettings 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.protocol.protocol.timestamp_encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":164 * * * cdef timestamp_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = 0 */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamp_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { int64_t __pyx_v_seconds; uint32_t __pyx_v_microseconds; int32_t __pyx_v_inf; 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; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("timestamp_decode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":166 * cdef timestamp_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * int64_t seconds = 0 # <<<<<<<<<<<<<< * uint32_t microseconds = 0 * int32_t inf = _decode_time(buf, &seconds, µseconds) */ __pyx_v_seconds = 0; /* "asyncpg/protocol/codecs/datetime.pyx":167 * cdef: * int64_t seconds = 0 * uint32_t microseconds = 0 # <<<<<<<<<<<<<< * int32_t inf = _decode_time(buf, &seconds, µseconds) * */ __pyx_v_microseconds = 0; /* "asyncpg/protocol/codecs/datetime.pyx":168 * int64_t seconds = 0 * uint32_t microseconds = 0 * int32_t inf = _decode_time(buf, &seconds, µseconds) # <<<<<<<<<<<<<< * * if inf > 0: */ __pyx_v_inf = __pyx_f_7asyncpg_8protocol_8protocol__decode_time(__pyx_v_buf, (&__pyx_v_seconds), (&__pyx_v_microseconds)); /* "asyncpg/protocol/codecs/datetime.pyx":170 * int32_t inf = _decode_time(buf, &seconds, µseconds) * * if inf > 0: # <<<<<<<<<<<<<< * # positive infinity * return infinity_datetime */ __pyx_t_1 = ((__pyx_v_inf > 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/datetime.pyx":172 * if inf > 0: * # positive infinity * return infinity_datetime # <<<<<<<<<<<<<< * elif inf < 0: * # negative infinity */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_infinity_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":170 * int32_t inf = _decode_time(buf, &seconds, µseconds) * * if inf > 0: # <<<<<<<<<<<<<< * # positive infinity * return infinity_datetime */ } /* "asyncpg/protocol/codecs/datetime.pyx":173 * # positive infinity * return infinity_datetime * elif inf < 0: # <<<<<<<<<<<<<< * # negative infinity * return negative_infinity_datetime */ __pyx_t_1 = ((__pyx_v_inf < 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/datetime.pyx":175 * elif inf < 0: * # negative infinity * return negative_infinity_datetime # <<<<<<<<<<<<<< * else: * return pg_epoch_datetime.__add__( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_negative_infinity_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":173 * # positive infinity * return infinity_datetime * elif inf < 0: # <<<<<<<<<<<<<< * # negative infinity * return negative_infinity_datetime */ } /* "asyncpg/protocol/codecs/datetime.pyx":177 * return negative_infinity_datetime * else: * return pg_epoch_datetime.__add__( # <<<<<<<<<<<<<< * timedelta(0, seconds, microseconds)) * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pg_epoch_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":178 * else: * return pg_epoch_datetime.__add__( * timedelta(0, seconds, microseconds)) # <<<<<<<<<<<<<< * * */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_seconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_int_0, __pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 178, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_int_0, __pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 178, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 177, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 177, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "asyncpg/protocol/codecs/datetime.pyx":164 * * * cdef timestamp_decode(ConnectionSettings settings, FastReadBuffer 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_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.protocol.protocol.timestamp_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":181 * * * cdef timestamp_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int64_t ts = hton.unpack_int64(buf.read(8)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamp_decode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; __Pyx_RefNannySetupContext("timestamp_decode_tuple", 0); /* "asyncpg/protocol/codecs/datetime.pyx":183 * cdef timestamp_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): * cdef: * int64_t ts = hton.unpack_int64(buf.read(8)) # <<<<<<<<<<<<<< * * return (ts,) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 183, __pyx_L1_error) __pyx_v_ts = __pyx_f_7asyncpg_8protocol_4hton_unpack_int64(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":185 * int64_t ts = hton.unpack_int64(buf.read(8)) * * return (ts,) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":181 * * * cdef timestamp_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int64_t ts = hton.unpack_int64(buf.read(8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.timestamp_decode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":188 * * * cdef timestamptz_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * buf.write_int32(8) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamptz_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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 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; PY_LONG_LONG __pyx_t_7; long __pyx_t_8; __Pyx_RefNannySetupContext("timestamptz_encode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":189 * * cdef timestamptz_encode(ConnectionSettings settings, WriteBuffer buf, obj): * buf.write_int32(8) # <<<<<<<<<<<<<< * * if obj == infinity_datetime: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":191 * buf.write_int32(8) * * if obj == infinity_datetime: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_infinity) * return */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_infinity_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_obj, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 191, __pyx_L1_error) __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(12, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "asyncpg/protocol/codecs/datetime.pyx":192 * * if obj == infinity_datetime: * buf.write_int64(pg_time64_infinity) # <<<<<<<<<<<<<< * return * elif obj == negative_infinity_datetime: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_7asyncpg_8protocol_8protocol_pg_time64_infinity); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":193 * 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/protocol/codecs/datetime.pyx":191 * buf.write_int32(8) * * if obj == infinity_datetime: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_infinity) * return */ } /* "asyncpg/protocol/codecs/datetime.pyx":194 * buf.write_int64(pg_time64_infinity) * return * elif obj == negative_infinity_datetime: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_negative_infinity) * return */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_negative_infinity_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_RichCompare(__pyx_v_obj, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(12, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "asyncpg/protocol/codecs/datetime.pyx":195 * return * elif obj == negative_infinity_datetime: * buf.write_int64(pg_time64_negative_infinity) # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_7asyncpg_8protocol_8protocol_pg_time64_negative_infinity); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":196 * elif obj == negative_infinity_datetime: * buf.write_int64(pg_time64_negative_infinity) * return # <<<<<<<<<<<<<< * * delta = obj.astimezone(utc) - pg_epoch_datetime_utc */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":194 * buf.write_int64(pg_time64_infinity) * return * elif obj == negative_infinity_datetime: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_negative_infinity) * return */ } /* "asyncpg/protocol/codecs/datetime.pyx":198 * return * * delta = obj.astimezone(utc) - pg_epoch_datetime_utc # <<<<<<<<<<<<<< * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_astimezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 198, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 198, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pg_epoch_datetime_utc); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_delta = __pyx_t_6; __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":200 * delta = obj.astimezone(utc) - 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_days); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyLong_AsLongLong(__pyx_t_6); if (unlikely(__pyx_t_7 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(12, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":201 * 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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_seconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyLong_AsLong(__pyx_t_6); if (unlikely(__pyx_t_8 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":200 * delta = obj.astimezone(utc) - 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_7 * 0x15180) + __pyx_t_8); /* "asyncpg/protocol/codecs/datetime.pyx":203 * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( * delta.microseconds) # <<<<<<<<<<<<<< * * _encode_time(buf, seconds, microseconds) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/codecs/datetime.pyx":202 * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * delta.microseconds) * */ __pyx_t_8 = PyLong_AsLong(__pyx_t_6); if (unlikely(__pyx_t_8 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_8); /* "asyncpg/protocol/codecs/datetime.pyx":205 * delta.microseconds) * * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":188 * * * cdef timestamptz_encode(ConnectionSettings settings, WriteBuffer buf, 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_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.timestamptz_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_delta); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":208 * * * cdef timestamptz_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = 0 */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timestamptz_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { int64_t __pyx_v_seconds; uint32_t __pyx_v_microseconds; int32_t __pyx_v_inf; 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; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("timestamptz_decode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":210 * cdef timestamptz_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * int64_t seconds = 0 # <<<<<<<<<<<<<< * uint32_t microseconds = 0 * int32_t inf = _decode_time(buf, &seconds, µseconds) */ __pyx_v_seconds = 0; /* "asyncpg/protocol/codecs/datetime.pyx":211 * cdef: * int64_t seconds = 0 * uint32_t microseconds = 0 # <<<<<<<<<<<<<< * int32_t inf = _decode_time(buf, &seconds, µseconds) * */ __pyx_v_microseconds = 0; /* "asyncpg/protocol/codecs/datetime.pyx":212 * int64_t seconds = 0 * uint32_t microseconds = 0 * int32_t inf = _decode_time(buf, &seconds, µseconds) # <<<<<<<<<<<<<< * * if inf > 0: */ __pyx_v_inf = __pyx_f_7asyncpg_8protocol_8protocol__decode_time(__pyx_v_buf, (&__pyx_v_seconds), (&__pyx_v_microseconds)); /* "asyncpg/protocol/codecs/datetime.pyx":214 * int32_t inf = _decode_time(buf, &seconds, µseconds) * * if inf > 0: # <<<<<<<<<<<<<< * # positive infinity * return infinity_datetime */ __pyx_t_1 = ((__pyx_v_inf > 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/datetime.pyx":216 * if inf > 0: * # positive infinity * return infinity_datetime # <<<<<<<<<<<<<< * elif inf < 0: * # negative infinity */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_infinity_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":214 * int32_t inf = _decode_time(buf, &seconds, µseconds) * * if inf > 0: # <<<<<<<<<<<<<< * # positive infinity * return infinity_datetime */ } /* "asyncpg/protocol/codecs/datetime.pyx":217 * # positive infinity * return infinity_datetime * elif inf < 0: # <<<<<<<<<<<<<< * # negative infinity * return negative_infinity_datetime */ __pyx_t_1 = ((__pyx_v_inf < 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/datetime.pyx":219 * elif inf < 0: * # negative infinity * return negative_infinity_datetime # <<<<<<<<<<<<<< * else: * return pg_epoch_datetime_utc.__add__( */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_negative_infinity_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":217 * # positive infinity * return infinity_datetime * elif inf < 0: # <<<<<<<<<<<<<< * # negative infinity * return negative_infinity_datetime */ } /* "asyncpg/protocol/codecs/datetime.pyx":221 * return negative_infinity_datetime * else: * return pg_epoch_datetime_utc.__add__( # <<<<<<<<<<<<<< * timedelta(0, seconds, microseconds)) * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pg_epoch_datetime_utc); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_add); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":222 * else: * return pg_epoch_datetime_utc.__add__( * timedelta(0, seconds, microseconds)) # <<<<<<<<<<<<<< * * */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_seconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_int_0, __pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 222, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_int_0, __pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 222, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 221, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 221, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "asyncpg/protocol/codecs/datetime.pyx":208 * * * cdef timestamptz_decode(ConnectionSettings settings, FastReadBuffer 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_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.protocol.protocol.timestamptz_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":225 * * * cdef time_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_time_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("time_encode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":227 * cdef time_encode(ConnectionSettings settings, WriteBuffer buf, obj): * cdef: * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(obj.minute) * 60 + \ * cpython.PyLong_AsLong(obj.second) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 227, __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, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":228 * cdef: * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ * cpython.PyLong_AsLong(obj.minute) * 60 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(obj.second) * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 228, __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, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":229 * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ * cpython.PyLong_AsLong(obj.minute) * 60 + \ * cpython.PyLong_AsLong(obj.second) # <<<<<<<<<<<<<< * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 229, __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, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":228 * 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/protocol/codecs/datetime.pyx":230 * cpython.PyLong_AsLong(obj.minute) * 60 + \ * cpython.PyLong_AsLong(obj.second) * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 230, __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, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_4); /* "asyncpg/protocol/codecs/datetime.pyx":232 * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) * * buf.write_int32(8) # <<<<<<<<<<<<<< * _encode_time(buf, seconds, microseconds) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":233 * * buf.write_int32(8) * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":225 * * * cdef time_encode(ConnectionSettings 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.protocol.protocol.time_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":236 * * * cdef time_encode_tuple(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_time_encode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; int64_t __pyx_t_8; __Pyx_RefNannySetupContext("time_encode_tuple", 0); /* "asyncpg/protocol/codecs/datetime.pyx":240 * 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, 240, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 != 1) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/datetime.pyx":243 * raise ValueError( * 'time tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) # <<<<<<<<<<<<<< * * microseconds = obj[0] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_time_tuple_encoder_expecting_1_e, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 243, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 243, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 243, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":241 * * if len(obj) != 1: * raise ValueError( # <<<<<<<<<<<<<< * 'time tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(12, 241, __pyx_L1_error) /* "asyncpg/protocol/codecs/datetime.pyx":240 * int64_t microseconds * * if len(obj) != 1: # <<<<<<<<<<<<<< * raise ValueError( * 'time tuple encoder: expecting 1 element ' */ } /* "asyncpg/protocol/codecs/datetime.pyx":245 * '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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_microseconds = __pyx_t_8; /* "asyncpg/protocol/codecs/datetime.pyx":247 * microseconds = obj[0] * * buf.write_int32(8) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":248 * * buf.write_int32(8) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":236 * * * cdef time_encode_tuple(ConnectionSettings 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.protocol.protocol.time_encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":251 * * * cdef time_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = 0 */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_time_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { int64_t __pyx_v_seconds; uint32_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 PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("time_decode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":253 * cdef time_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * int64_t seconds = 0 # <<<<<<<<<<<<<< * uint32_t microseconds = 0 * */ __pyx_v_seconds = 0; /* "asyncpg/protocol/codecs/datetime.pyx":254 * cdef: * int64_t seconds = 0 * uint32_t microseconds = 0 # <<<<<<<<<<<<<< * * _decode_time(buf, &seconds, µseconds) */ __pyx_v_microseconds = 0; /* "asyncpg/protocol/codecs/datetime.pyx":256 * uint32_t microseconds = 0 * * _decode_time(buf, &seconds, µseconds) # <<<<<<<<<<<<<< * * cdef: */ __pyx_f_7asyncpg_8protocol_8protocol__decode_time(__pyx_v_buf, (&__pyx_v_seconds), (&__pyx_v_microseconds)); /* "asyncpg/protocol/codecs/datetime.pyx":259 * * 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/protocol/codecs/datetime.pyx":260 * cdef: * int64_t minutes = (seconds / 60) * int64_t sec = seconds % 60 # <<<<<<<<<<<<<< * int64_t hours = (minutes / 60) * int64_t min = minutes % 60 */ __pyx_v_sec = __Pyx_mod_int64_t(__pyx_v_seconds, 60); /* "asyncpg/protocol/codecs/datetime.pyx":261 * 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/protocol/codecs/datetime.pyx":262 * int64_t sec = seconds % 60 * int64_t hours = (minutes / 60) * int64_t min = minutes % 60 # <<<<<<<<<<<<<< * * return datetime.time(hours, min, sec, microseconds) */ __pyx_v_min = __Pyx_mod_int64_t(__pyx_v_minutes, 60); /* "asyncpg/protocol/codecs/datetime.pyx":264 * int64_t min = minutes % 60 * * return datetime.time(hours, min, sec, microseconds) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_hours); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_min); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_sec); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_2, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 264, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_2, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 264, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_6); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":251 * * * cdef time_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = 0 */ /* 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_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.time_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":267 * * * cdef time_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int64_t ts = hton.unpack_int64(buf.read(8)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_time_decode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; __Pyx_RefNannySetupContext("time_decode_tuple", 0); /* "asyncpg/protocol/codecs/datetime.pyx":269 * cdef time_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): * cdef: * int64_t ts = hton.unpack_int64(buf.read(8)) # <<<<<<<<<<<<<< * * return (ts,) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 269, __pyx_L1_error) __pyx_v_ts = __pyx_f_7asyncpg_8protocol_4hton_unpack_int64(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":271 * int64_t ts = hton.unpack_int64(buf.read(8)) * * return (ts,) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":267 * * * cdef time_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int64_t ts = hton.unpack_int64(buf.read(8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.time_decode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":274 * * * cdef timetz_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * offset = obj.tzinfo.utcoffset(None) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timetz_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; long __pyx_t_3; long __pyx_t_4; long __pyx_t_5; __Pyx_RefNannySetupContext("timetz_encode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":275 * * cdef timetz_encode(ConnectionSettings settings, WriteBuffer buf, obj): * offset = obj.tzinfo.utcoffset(None) # <<<<<<<<<<<<<< * * cdef: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_offset = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":279 * cdef: * int32_t offset_sec = \ * cpython.PyLong_AsLong(offset.days) * 24 * 60 * 60 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(offset.seconds) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_offset, __pyx_n_s_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 279, __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, 279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":280 * int32_t offset_sec = \ * cpython.PyLong_AsLong(offset.days) * 24 * 60 * 60 + \ * cpython.PyLong_AsLong(offset.seconds) # <<<<<<<<<<<<<< * * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_offset, __pyx_n_s_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 280, __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, 280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":279 * 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_3) * 24) * 60) * 60) + ((int32_t)__pyx_t_4)); /* "asyncpg/protocol/codecs/datetime.pyx":282 * cpython.PyLong_AsLong(offset.seconds) * * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(obj.minute) * 60 + \ * cpython.PyLong_AsLong(obj.second) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 282, __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, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":283 * * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ * cpython.PyLong_AsLong(obj.minute) * 60 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(obj.second) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 283, __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, 283, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":284 * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ * cpython.PyLong_AsLong(obj.minute) * 60 + \ * cpython.PyLong_AsLong(obj.second) # <<<<<<<<<<<<<< * * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 284, __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, 284, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":283 * * 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_4 * 0xE10) + (__pyx_t_3 * 60)) + __pyx_t_5); /* "asyncpg/protocol/codecs/datetime.pyx":286 * cpython.PyLong_AsLong(obj.second) * * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) # <<<<<<<<<<<<<< * * buf.write_int32(12) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 286, __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, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_5); /* "asyncpg/protocol/codecs/datetime.pyx":288 * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) * * buf.write_int32(12) # <<<<<<<<<<<<<< * _encode_time(buf, seconds, microseconds) * buf.write_int32(offset_sec) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 12); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":289 * * buf.write_int32(12) * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * buf.write_int32(offset_sec) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":290 * buf.write_int32(12) * _encode_time(buf, seconds, microseconds) * buf.write_int32(offset_sec) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_offset_sec); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":274 * * * cdef timetz_encode(ConnectionSettings 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_AddTraceback("asyncpg.protocol.protocol.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/protocol/codecs/datetime.pyx":293 * * * cdef timetz_encode_tuple(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timetz_encode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; int64_t __pyx_t_8; int32_t __pyx_t_9; __Pyx_RefNannySetupContext("timetz_encode_tuple", 0); /* "asyncpg/protocol/codecs/datetime.pyx":298 * 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, 298, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 != 2) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/datetime.pyx":301 * raise ValueError( * 'time tuple encoder: expecting 2 elements2 ' * 'in tuple, got {}'.format(len(obj))) # <<<<<<<<<<<<<< * * microseconds = obj[0] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_time_tuple_encoder_expecting_2_e, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 301, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":299 * * if len(obj) != 2: * raise ValueError( # <<<<<<<<<<<<<< * 'time tuple encoder: expecting 2 elements2 ' * 'in tuple, got {}'.format(len(obj))) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(12, 299, __pyx_L1_error) /* "asyncpg/protocol/codecs/datetime.pyx":298 * int32_t offset_sec * * if len(obj) != 2: # <<<<<<<<<<<<<< * raise ValueError( * 'time tuple encoder: expecting 2 elements2 ' */ } /* "asyncpg/protocol/codecs/datetime.pyx":303 * '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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_microseconds = __pyx_t_8; /* "asyncpg/protocol/codecs/datetime.pyx":304 * * microseconds = obj[0] * offset_sec = obj[1] # <<<<<<<<<<<<<< * * buf.write_int32(12) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_offset_sec = __pyx_t_9; /* "asyncpg/protocol/codecs/datetime.pyx":306 * offset_sec = obj[1] * * buf.write_int32(12) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * buf.write_int32(offset_sec) */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 12); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":307 * * buf.write_int32(12) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * buf.write_int32(offset_sec) * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":308 * buf.write_int32(12) * buf.write_int64(microseconds) * buf.write_int32(offset_sec) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_offset_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":293 * * * cdef timetz_encode_tuple(ConnectionSettings 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.protocol.protocol.timetz_encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":311 * * * cdef timetz_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * time = time_decode(settings, buf) * cdef int32_t offset = (hton.unpack_int32(buf.read(4)) / 60) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timetz_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; __Pyx_RefNannySetupContext("timetz_decode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":312 * * cdef timetz_decode(ConnectionSettings settings, FastReadBuffer buf): * time = time_decode(settings, buf) # <<<<<<<<<<<<<< * cdef int32_t offset = (hton.unpack_int32(buf.read(4)) / 60) * return time.replace(tzinfo=datetime.timezone(timedelta(minutes=offset))) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_time_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_time = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":313 * cdef timetz_decode(ConnectionSettings settings, FastReadBuffer buf): * time = time_decode(settings, buf) * cdef int32_t offset = (hton.unpack_int32(buf.read(4)) / 60) # <<<<<<<<<<<<<< * return time.replace(tzinfo=datetime.timezone(timedelta(minutes=offset))) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(12, 313, __pyx_L1_error) __pyx_v_offset = ((int32_t)(((double)__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2)) / 60.0)); /* "asyncpg/protocol/codecs/datetime.pyx":314 * time = time_decode(settings, buf) * cdef int32_t offset = (hton.unpack_int32(buf.read(4)) / 60) * return time.replace(tzinfo=datetime.timezone(timedelta(minutes=offset))) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_timezone); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_offset); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_minutes, __pyx_t_8) < 0) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tzinfo, __pyx_t_4) < 0) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":311 * * * cdef timetz_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * time = time_decode(settings, buf) * cdef int32_t offset = (hton.unpack_int32(buf.read(4)) / 60) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.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/protocol/codecs/datetime.pyx":317 * * * cdef timetz_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds = hton.unpack_int64(buf.read(8)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_timetz_decode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; __Pyx_RefNannySetupContext("timetz_decode_tuple", 0); /* "asyncpg/protocol/codecs/datetime.pyx":319 * cdef timetz_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): * cdef: * int64_t microseconds = hton.unpack_int64(buf.read(8)) # <<<<<<<<<<<<<< * int32_t offset_sec = hton.unpack_int32(buf.read(4)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 319, __pyx_L1_error) __pyx_v_microseconds = __pyx_f_7asyncpg_8protocol_4hton_unpack_int64(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":320 * cdef: * int64_t microseconds = hton.unpack_int64(buf.read(8)) * int32_t offset_sec = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * * return (microseconds, offset_sec) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 320, __pyx_L1_error) __pyx_v_offset_sec = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":322 * int32_t offset_sec = hton.unpack_int32(buf.read(4)) * * return (microseconds, offset_sec) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_offset_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":317 * * * cdef timetz_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds = hton.unpack_int64(buf.read(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.protocol.protocol.timetz_decode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":325 * * * cdef interval_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int32_t days = cpython.PyLong_AsLong(obj.days) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_interval_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("interval_encode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":327 * cdef interval_encode(ConnectionSettings settings, WriteBuffer buf, obj): * cdef: * int32_t days = cpython.PyLong_AsLong(obj.days) # <<<<<<<<<<<<<< * int64_t seconds = cpython.PyLong_AsLongLong(obj.seconds) * int32_t microseconds = cpython.PyLong_AsLong(obj.microseconds) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 327, __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, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_days = ((int32_t)__pyx_t_2); /* "asyncpg/protocol/codecs/datetime.pyx":328 * cdef: * int32_t days = cpython.PyLong_AsLong(obj.days) * int64_t seconds = cpython.PyLong_AsLongLong(obj.seconds) # <<<<<<<<<<<<<< * int32_t microseconds = cpython.PyLong_AsLong(obj.microseconds) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 328, __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, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_seconds = __pyx_t_3; /* "asyncpg/protocol/codecs/datetime.pyx":329 * int32_t days = cpython.PyLong_AsLong(obj.days) * int64_t seconds = cpython.PyLong_AsLongLong(obj.seconds) * int32_t microseconds = cpython.PyLong_AsLong(obj.microseconds) # <<<<<<<<<<<<<< * * buf.write_int32(16) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 329, __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, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_2); /* "asyncpg/protocol/codecs/datetime.pyx":331 * 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_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 16); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":332 * * buf.write_int32(16) * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * buf.write_int32(days) * buf.write_int32(0) # Months */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":333 * buf.write_int32(16) * _encode_time(buf, seconds, microseconds) * buf.write_int32(days) # <<<<<<<<<<<<<< * buf.write_int32(0) # Months * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":334 * _encode_time(buf, seconds, microseconds) * buf.write_int32(days) * buf.write_int32(0) # Months # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":325 * * * cdef interval_encode(ConnectionSettings 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.protocol.protocol.interval_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":337 * * * cdef interval_encode_tuple(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * tuple obj): * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_interval_encode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; int32_t __pyx_t_8; int64_t __pyx_t_9; __Pyx_RefNannySetupContext("interval_encode_tuple", 0); /* "asyncpg/protocol/codecs/datetime.pyx":344 * 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, 344, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 344, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 != 3) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/datetime.pyx":347 * raise ValueError( * 'interval tuple encoder: expecting 3 elements ' * 'in tuple, got {}'.format(len(obj))) # <<<<<<<<<<<<<< * * months = obj[0] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_interval_tuple_encoder_expecting, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__pyx_v_obj == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(12, 347, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(12, 347, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 347, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 347, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":345 * * if len(obj) != 3: * raise ValueError( # <<<<<<<<<<<<<< * 'interval tuple encoder: expecting 3 elements ' * 'in tuple, got {}'.format(len(obj))) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(12, 345, __pyx_L1_error) /* "asyncpg/protocol/codecs/datetime.pyx":344 * int64_t microseconds * * if len(obj) != 3: # <<<<<<<<<<<<<< * raise ValueError( * 'interval tuple encoder: expecting 3 elements ' */ } /* "asyncpg/protocol/codecs/datetime.pyx":349 * '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, 349, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_months = __pyx_t_8; /* "asyncpg/protocol/codecs/datetime.pyx":350 * * 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, 350, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_days = __pyx_t_8; /* "asyncpg/protocol/codecs/datetime.pyx":351 * 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, 351, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_obj, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_microseconds = __pyx_t_9; /* "asyncpg/protocol/codecs/datetime.pyx":353 * microseconds = obj[2] * * buf.write_int32(16) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * buf.write_int32(days) */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 16); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":354 * * buf.write_int32(16) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * buf.write_int32(days) * buf.write_int32(months) */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":355 * buf.write_int32(16) * buf.write_int64(microseconds) * buf.write_int32(days) # <<<<<<<<<<<<<< * buf.write_int32(months) * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_days); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":356 * buf.write_int64(microseconds) * buf.write_int32(days) * buf.write_int32(months) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_months); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":337 * * * cdef interval_encode_tuple(ConnectionSettings 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.protocol.protocol.interval_encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":359 * * * cdef interval_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t days */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_interval_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { int32_t __pyx_v_days; int32_t __pyx_v_months; int32_t __pyx_v_years; int64_t __pyx_v_seconds; uint32_t __pyx_v_microseconds; 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; __Pyx_RefNannySetupContext("interval_decode", 0); /* "asyncpg/protocol/codecs/datetime.pyx":364 * int32_t months * int32_t years * int64_t seconds = 0 # <<<<<<<<<<<<<< * uint32_t microseconds = 0 * */ __pyx_v_seconds = 0; /* "asyncpg/protocol/codecs/datetime.pyx":365 * int32_t years * int64_t seconds = 0 * uint32_t microseconds = 0 # <<<<<<<<<<<<<< * * _decode_time(buf, &seconds, µseconds) */ __pyx_v_microseconds = 0; /* "asyncpg/protocol/codecs/datetime.pyx":367 * uint32_t microseconds = 0 * * _decode_time(buf, &seconds, µseconds) # <<<<<<<<<<<<<< * days = hton.unpack_int32(buf.read(4)) * months = hton.unpack_int32(buf.read(4)) */ __pyx_f_7asyncpg_8protocol_8protocol__decode_time(__pyx_v_buf, (&__pyx_v_seconds), (&__pyx_v_microseconds)); /* "asyncpg/protocol/codecs/datetime.pyx":368 * * _decode_time(buf, &seconds, µseconds) * days = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * months = hton.unpack_int32(buf.read(4)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 368, __pyx_L1_error) __pyx_v_days = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":369 * _decode_time(buf, &seconds, µseconds) * days = hton.unpack_int32(buf.read(4)) * months = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * * if months < 0: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 369, __pyx_L1_error) __pyx_v_months = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":371 * months = hton.unpack_int32(buf.read(4)) * * if months < 0: # <<<<<<<<<<<<<< * years = -(-months // 12) * months = -(-months % 12) */ __pyx_t_2 = ((__pyx_v_months < 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/datetime.pyx":372 * * if months < 0: * years = -(-months // 12) # <<<<<<<<<<<<<< * months = -(-months % 12) * else: */ __pyx_v_years = (-((int32_t)__Pyx_div_long((-__pyx_v_months), 12))); /* "asyncpg/protocol/codecs/datetime.pyx":373 * if months < 0: * years = -(-months // 12) * months = -(-months % 12) # <<<<<<<<<<<<<< * else: * years = (months // 12) */ __pyx_v_months = (-((int32_t)__Pyx_mod_long((-__pyx_v_months), 12))); /* "asyncpg/protocol/codecs/datetime.pyx":371 * months = hton.unpack_int32(buf.read(4)) * * if months < 0: # <<<<<<<<<<<<<< * years = -(-months // 12) * months = -(-months % 12) */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/datetime.pyx":375 * months = -(-months % 12) * else: * years = (months // 12) # <<<<<<<<<<<<<< * months = (months % 12) * */ /*else*/ { __pyx_v_years = ((int32_t)__Pyx_div_long(__pyx_v_months, 12)); /* "asyncpg/protocol/codecs/datetime.pyx":376 * else: * years = (months // 12) * months = (months % 12) # <<<<<<<<<<<<<< * * return datetime.timedelta(days=days + months * 30 + years * 365, */ __pyx_v_months = ((int32_t)__Pyx_mod_long(__pyx_v_months, 12)); } __pyx_L3:; /* "asyncpg/protocol/codecs/datetime.pyx":378 * months = (months % 12) * * return datetime.timedelta(days=days + months * 30 + years * 365, # <<<<<<<<<<<<<< * seconds=seconds, microseconds=microseconds) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_long(((__pyx_v_days + (__pyx_v_months * 30)) + (__pyx_v_years * 0x16D))); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_days, __pyx_t_5) < 0) __PYX_ERR(12, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":379 * * return datetime.timedelta(days=days + months * 30 + years * 365, * seconds=seconds, microseconds=microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_seconds); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_seconds, __pyx_t_5) < 0) __PYX_ERR(12, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_microseconds, __pyx_t_5) < 0) __PYX_ERR(12, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":378 * months = (months % 12) * * return datetime.timedelta(days=days + months * 30 + years * 365, # <<<<<<<<<<<<<< * seconds=seconds, microseconds=microseconds) * */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/datetime.pyx":359 * * * cdef interval_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t days */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.interval_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":382 * * * cdef interval_decode_tuple(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t days */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_interval_decode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; __Pyx_RefNannySetupContext("interval_decode_tuple", 0); /* "asyncpg/protocol/codecs/datetime.pyx":388 * int64_t microseconds * * microseconds = hton.unpack_int64(buf.read(8)) # <<<<<<<<<<<<<< * days = hton.unpack_int32(buf.read(4)) * months = hton.unpack_int32(buf.read(4)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 388, __pyx_L1_error) __pyx_v_microseconds = __pyx_f_7asyncpg_8protocol_4hton_unpack_int64(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":389 * * microseconds = hton.unpack_int64(buf.read(8)) * days = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * months = hton.unpack_int32(buf.read(4)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 389, __pyx_L1_error) __pyx_v_days = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":390 * microseconds = hton.unpack_int64(buf.read(8)) * days = hton.unpack_int32(buf.read(4)) * months = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * * return (months, days, microseconds) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(12, 390, __pyx_L1_error) __pyx_v_months = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/datetime.pyx":392 * months = hton.unpack_int32(buf.read(4)) * * return (months, days, microseconds) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_months); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_days); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __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/protocol/codecs/datetime.pyx":382 * * * cdef interval_decode_tuple(ConnectionSettings settings, FastReadBuffer 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.protocol.protocol.interval_decode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/datetime.pyx":395 * * * cdef init_datetime_codecs(): # <<<<<<<<<<<<<< * register_core_codec(DATEOID, * &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; __Pyx_RefNannySetupContext("init_datetime_codecs", 0); /* "asyncpg/protocol/codecs/datetime.pyx":396 * * cdef init_datetime_codecs(): * register_core_codec(DATEOID, # <<<<<<<<<<<<<< * &date_encode, * &date_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x43A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_date_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_date_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":401 * PG_FORMAT_BINARY) * * register_core_codec(DATEOID, # <<<<<<<<<<<<<< * &date_encode_tuple, * &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_8protocol_8protocol_date_encode_tuple)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_date_decode_tuple)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":407 * PG_XFORMAT_TUPLE) * * register_core_codec(TIMEOID, # <<<<<<<<<<<<<< * &time_encode, * &time_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x43B, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_time_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_time_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":412 * PG_FORMAT_BINARY) * * register_core_codec(TIMEOID, # <<<<<<<<<<<<<< * &time_encode_tuple, * &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_8protocol_8protocol_time_encode_tuple)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_time_decode_tuple)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":418 * PG_XFORMAT_TUPLE) * * register_core_codec(TIMETZOID, # <<<<<<<<<<<<<< * &timetz_encode, * &timetz_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4F2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_timetz_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_timetz_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":423 * PG_FORMAT_BINARY) * * register_core_codec(TIMETZOID, # <<<<<<<<<<<<<< * &timetz_encode_tuple, * &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_8protocol_8protocol_timetz_encode_tuple)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_timetz_decode_tuple)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":429 * PG_XFORMAT_TUPLE) * * register_core_codec(TIMESTAMPOID, # <<<<<<<<<<<<<< * ×tamp_encode, * ×tamp_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x45A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_timestamp_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_timestamp_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":434 * PG_FORMAT_BINARY) * * register_core_codec(TIMESTAMPOID, # <<<<<<<<<<<<<< * ×tamp_encode_tuple, * ×tamp_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_8protocol_8protocol_timestamp_encode_tuple)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_timestamp_decode_tuple)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":440 * PG_XFORMAT_TUPLE) * * register_core_codec(TIMESTAMPTZOID, # <<<<<<<<<<<<<< * ×tamptz_encode, * ×tamptz_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4A0, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_timestamptz_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_timestamptz_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":445 * PG_FORMAT_BINARY) * * register_core_codec(TIMESTAMPTZOID, # <<<<<<<<<<<<<< * ×tamp_encode_tuple, * ×tamp_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_8protocol_8protocol_timestamp_encode_tuple)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_timestamp_decode_tuple)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":451 * PG_XFORMAT_TUPLE) * * register_core_codec(INTERVALOID, # <<<<<<<<<<<<<< * &interval_encode, * &interval_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4A2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_interval_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_interval_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":456 * PG_FORMAT_BINARY) * * register_core_codec(INTERVALOID, # <<<<<<<<<<<<<< * &interval_encode_tuple, * &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_8protocol_8protocol_interval_encode_tuple)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_interval_decode_tuple)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":465 * # interpret the value, and simply return and pass it as text. * # * register_core_codec(ABSTIMEOID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BE, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":470 * PG_FORMAT_TEXT) * * register_core_codec(RELTIMEOID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BF, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":475 * PG_FORMAT_TEXT) * * register_core_codec(TINTERVALOID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2C0, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":395 * * * cdef init_datetime_codecs(): # <<<<<<<<<<<<<< * register_core_codec(DATEOID, * &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/float.pyx":11 * * * cdef float4_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef double dval = cpython.PyFloat_AsDouble(obj) * cdef float fval = dval */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_float4_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("float4_encode", 0); /* "asyncpg/protocol/codecs/float.pyx":12 * * cdef float4_encode(ConnectionSettings 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/protocol/codecs/float.pyx":13 * cdef float4_encode(ConnectionSettings 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('float value too large to be encoded as FLOAT4') */ __pyx_v_fval = ((float)__pyx_v_dval); /* "asyncpg/protocol/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('float value too large to be encoded as FLOAT4') * */ __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)) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/codecs/float.pyx":15 * cdef float fval = dval * if math.isinf(fval) and not math.isinf(dval): * raise ValueError('float value too large to be encoded as FLOAT4') # <<<<<<<<<<<<<< * * buf.write_int32(4) */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); 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/protocol/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('float value too large to be encoded as FLOAT4') * */ } /* "asyncpg/protocol/codecs/float.pyx":17 * raise ValueError('float value too large to be encoded as FLOAT4') * * buf.write_int32(4) # <<<<<<<<<<<<<< * buf.write_float(fval) * */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_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/protocol/codecs/float.pyx":18 * * buf.write_int32(4) * buf.write_float(fval) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_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/protocol/codecs/float.pyx":11 * * * cdef float4_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef double dval = cpython.PyFloat_AsDouble(obj) * cdef float fval = dval */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.float4_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/float.pyx":21 * * * cdef float4_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef float f = hton.unpack_float(buf.read(4)) * return cpython.PyFloat_FromDouble(f) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_float4_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { float __pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("float4_decode", 0); /* "asyncpg/protocol/codecs/float.pyx":22 * * cdef float4_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef float f = hton.unpack_float(buf.read(4)) # <<<<<<<<<<<<<< * return cpython.PyFloat_FromDouble(f) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 22, __pyx_L1_error) __pyx_v_f = __pyx_f_7asyncpg_8protocol_4hton_unpack_float(__pyx_t_1); /* "asyncpg/protocol/codecs/float.pyx":23 * cdef float4_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef float f = hton.unpack_float(buf.read(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/protocol/codecs/float.pyx":21 * * * cdef float4_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef float f = hton.unpack_float(buf.read(4)) * return cpython.PyFloat_FromDouble(f) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.float4_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/float.pyx":26 * * * cdef float8_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef double dval = cpython.PyFloat_AsDouble(obj) * buf.write_int32(8) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_float8_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("float8_encode", 0); /* "asyncpg/protocol/codecs/float.pyx":27 * * cdef float8_encode(ConnectionSettings 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/protocol/codecs/float.pyx":28 * cdef float8_encode(ConnectionSettings 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_8protocol_8protocol_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/protocol/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_8protocol_8protocol_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/protocol/codecs/float.pyx":26 * * * cdef float8_encode(ConnectionSettings 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.protocol.protocol.float8_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/float.pyx":32 * * * cdef float8_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef double f = hton.unpack_double(buf.read(8)) * return cpython.PyFloat_FromDouble(f) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_float8_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { double __pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("float8_decode", 0); /* "asyncpg/protocol/codecs/float.pyx":33 * * cdef float8_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef double f = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * return cpython.PyFloat_FromDouble(f) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 33, __pyx_L1_error) __pyx_v_f = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/float.pyx":34 * cdef float8_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef double f = hton.unpack_double(buf.read(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/protocol/codecs/float.pyx":32 * * * cdef float8_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef double f = hton.unpack_double(buf.read(8)) * return cpython.PyFloat_FromDouble(f) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.float8_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/float.pyx":37 * * * cdef init_float_codecs(): # <<<<<<<<<<<<<< * register_core_codec(FLOAT4OID, * &float4_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_float_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_float_codecs", 0); /* "asyncpg/protocol/codecs/float.pyx":38 * * cdef init_float_codecs(): * register_core_codec(FLOAT4OID, # <<<<<<<<<<<<<< * &float4_encode, * &float4_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BC, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_float4_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_float4_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/float.pyx":43 * PG_FORMAT_BINARY) * * register_core_codec(FLOAT8OID, # <<<<<<<<<<<<<< * &float8_encode, * &float8_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BD, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_float8_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_float8_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/float.pyx":37 * * * cdef init_float_codecs(): # <<<<<<<<<<<<<< * register_core_codec(FLOAT4OID, * &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/geometry.pyx":11 * * * cdef inline _encode_points(WriteBuffer wbuf, object points): # <<<<<<<<<<<<<< * cdef object point * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__encode_points(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("_encode_points", 0); /* "asyncpg/protocol/codecs/geometry.pyx":14 * 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(14, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 14, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(14, 14, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(14, 14, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(14, 14, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_point, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":15 * * for point in points: * wbuf.write_double(point[0]) # <<<<<<<<<<<<<< * wbuf.write_double(point[1]) * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 15, __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(14, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":16 * for point in points: * wbuf.write_double(point[0]) * wbuf.write_double(point[1]) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 16, __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(14, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":14 * 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/protocol/codecs/geometry.pyx":11 * * * 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.protocol.protocol._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/protocol/codecs/geometry.pyx":19 * * * cdef inline _decode_points(FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t npts = hton.unpack_int32(buf.read(4)) */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__decode_points(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; 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; __Pyx_RefNannySetupContext("_decode_points", 0); /* "asyncpg/protocol/codecs/geometry.pyx":21 * cdef inline _decode_points(FastReadBuffer buf): * cdef: * int32_t npts = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * pts = cpython.PyTuple_New(npts) * int32_t i */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 21, __pyx_L1_error) __pyx_v_npts = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":22 * cdef: * int32_t npts = hton.unpack_int32(buf.read(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(14, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_pts = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":28 * double y * * for i in range(npts): # <<<<<<<<<<<<<< * x = hton.unpack_double(buf.read(8)) * y = hton.unpack_double(buf.read(8)) */ __pyx_t_3 = __pyx_v_npts; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "asyncpg/protocol/codecs/geometry.pyx":29 * * for i in range(npts): * x = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * y = hton.unpack_double(buf.read(8)) * point = Point(x, y) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 29, __pyx_L1_error) __pyx_v_x = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":30 * for i in range(npts): * x = hton.unpack_double(buf.read(8)) * y = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * point = Point(x, y) * cpython.Py_INCREF(point) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 30, __pyx_L1_error) __pyx_v_y = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":31 * x = hton.unpack_double(buf.read(8)) * y = hton.unpack_double(buf.read(8)) * point = Point(x, y) # <<<<<<<<<<<<<< * cpython.Py_INCREF(point) * cpython.PyTuple_SET_ITEM(pts, i, point) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 31, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 31, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(14, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_point, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":32 * y = hton.unpack_double(buf.read(8)) * point = Point(x, y) * cpython.Py_INCREF(point) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(pts, i, point) * */ Py_INCREF(__pyx_v_point); /* "asyncpg/protocol/codecs/geometry.pyx":33 * point = 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/protocol/codecs/geometry.pyx":35 * 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/protocol/codecs/geometry.pyx":19 * * * cdef inline _decode_points(FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t npts = hton.unpack_int32(buf.read(4)) */ /* 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_10); __Pyx_AddTraceback("asyncpg.protocol.protocol._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/protocol/codecs/geometry.pyx":38 * * * cdef box_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(32) * _encode_points(wbuf, (obj[0], obj[1])) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_box_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("box_encode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":39 * * cdef box_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * wbuf.write_int32(32) # <<<<<<<<<<<<<< * _encode_points(wbuf, (obj[0], obj[1])) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, 32); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":40 * cdef box_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * wbuf.write_int32(32) * _encode_points(wbuf, (obj[0], obj[1])) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__encode_points(__pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":38 * * * cdef box_encode(ConnectionSettings 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.protocol.protocol.box_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":43 * * * cdef box_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * double high_x = hton.unpack_double(buf.read(8)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_box_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("box_decode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":45 * cdef box_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * double high_x = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double high_y = hton.unpack_double(buf.read(8)) * double low_x = hton.unpack_double(buf.read(8)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 45, __pyx_L1_error) __pyx_v_high_x = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":46 * cdef: * double high_x = hton.unpack_double(buf.read(8)) * double high_y = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double low_x = hton.unpack_double(buf.read(8)) * double low_y = hton.unpack_double(buf.read(8)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 46, __pyx_L1_error) __pyx_v_high_y = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":47 * double high_x = hton.unpack_double(buf.read(8)) * double high_y = hton.unpack_double(buf.read(8)) * double low_x = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double low_y = hton.unpack_double(buf.read(8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 47, __pyx_L1_error) __pyx_v_low_x = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":48 * double high_y = hton.unpack_double(buf.read(8)) * double low_x = hton.unpack_double(buf.read(8)) * double low_y = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * * return Box(Point(high_x, high_y), Point(low_x, low_y)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 48, __pyx_L1_error) __pyx_v_low_y = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":50 * double low_y = hton.unpack_double(buf.read(8)) * * return Box(Point(high_x, high_y), Point(low_x, low_y)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Box); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_high_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_high_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_low_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_low_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_t_6}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_t_6}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_9, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_9, __pyx_t_6); __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_9, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_9, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/geometry.pyx":43 * * * cdef box_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * double high_x = hton.unpack_double(buf.read(8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.box_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":53 * * * cdef line_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(24) * wbuf.write_double(obj[0]) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_line_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; double __pyx_t_2; __Pyx_RefNannySetupContext("line_encode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":54 * * cdef line_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * wbuf.write_int32(24) # <<<<<<<<<<<<<< * wbuf.write_double(obj[0]) * wbuf.write_double(obj[1]) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, 24); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":55 * cdef line_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * wbuf.write_int32(24) * wbuf.write_double(obj[0]) # <<<<<<<<<<<<<< * wbuf.write_double(obj[1]) * wbuf.write_double(obj[2]) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 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(14, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":56 * wbuf.write_int32(24) * wbuf.write_double(obj[0]) * wbuf.write_double(obj[1]) # <<<<<<<<<<<<<< * wbuf.write_double(obj[2]) * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 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(14, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":57 * wbuf.write_double(obj[0]) * wbuf.write_double(obj[1]) * wbuf.write_double(obj[2]) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 57, __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(14, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":53 * * * cdef line_encode(ConnectionSettings 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.protocol.protocol.line_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":60 * * * cdef line_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * double A = hton.unpack_double(buf.read(8)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_line_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("line_decode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":62 * cdef line_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * double A = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double B = hton.unpack_double(buf.read(8)) * double C = hton.unpack_double(buf.read(8)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 62, __pyx_L1_error) __pyx_v_A = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":63 * cdef: * double A = hton.unpack_double(buf.read(8)) * double B = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double C = hton.unpack_double(buf.read(8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 63, __pyx_L1_error) __pyx_v_B = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":64 * double A = hton.unpack_double(buf.read(8)) * double B = hton.unpack_double(buf.read(8)) * double C = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * * return Line(A, B, C) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 64, __pyx_L1_error) __pyx_v_C = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":66 * double C = hton.unpack_double(buf.read(8)) * * return Line(A, B, C) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyFloat_FromDouble(__pyx_v_A); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_B); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_C); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 66, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 66, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/geometry.pyx":60 * * * cdef line_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * double A = hton.unpack_double(buf.read(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_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.line_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":69 * * * cdef lseg_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(32) * _encode_points(wbuf, (obj[0], obj[1])) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_lseg_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("lseg_encode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":70 * * cdef lseg_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * wbuf.write_int32(32) # <<<<<<<<<<<<<< * _encode_points(wbuf, (obj[0], obj[1])) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, 32); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":71 * cdef lseg_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * wbuf.write_int32(32) * _encode_points(wbuf, (obj[0], obj[1])) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__encode_points(__pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":69 * * * cdef lseg_encode(ConnectionSettings 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.protocol.protocol.lseg_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":74 * * * cdef lseg_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * double p1_x = hton.unpack_double(buf.read(8)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_lseg_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; int __pyx_t_8; __Pyx_RefNannySetupContext("lseg_decode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":76 * cdef lseg_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * double p1_x = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double p1_y = hton.unpack_double(buf.read(8)) * double p2_x = hton.unpack_double(buf.read(8)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 76, __pyx_L1_error) __pyx_v_p1_x = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":77 * cdef: * double p1_x = hton.unpack_double(buf.read(8)) * double p1_y = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double p2_x = hton.unpack_double(buf.read(8)) * double p2_y = hton.unpack_double(buf.read(8)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 77, __pyx_L1_error) __pyx_v_p1_y = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":78 * double p1_x = hton.unpack_double(buf.read(8)) * double p1_y = hton.unpack_double(buf.read(8)) * double p2_x = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double p2_y = hton.unpack_double(buf.read(8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 78, __pyx_L1_error) __pyx_v_p2_x = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":79 * double p1_y = hton.unpack_double(buf.read(8)) * double p2_x = hton.unpack_double(buf.read(8)) * double p2_y = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * * return LineSegment((p1_x, p1_y), (p2_x, p2_y)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 79, __pyx_L1_error) __pyx_v_p2_y = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":81 * double p2_y = hton.unpack_double(buf.read(8)) * * return LineSegment((p1_x, p1_y), (p2_x, p2_y)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LineSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyFloat_FromDouble(__pyx_v_p1_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_p1_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyFloat_FromDouble(__pyx_v_p2_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyFloat_FromDouble(__pyx_v_p2_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/geometry.pyx":74 * * * cdef lseg_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * double p1_x = hton.unpack_double(buf.read(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.protocol.protocol.lseg_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":84 * * * cdef point_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(16) * wbuf.write_double(obj[0]) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_point_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; double __pyx_t_2; __Pyx_RefNannySetupContext("point_encode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":85 * * cdef point_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * wbuf.write_int32(16) # <<<<<<<<<<<<<< * wbuf.write_double(obj[0]) * wbuf.write_double(obj[1]) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, 16); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":86 * cdef point_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * wbuf.write_int32(16) * wbuf.write_double(obj[0]) # <<<<<<<<<<<<<< * wbuf.write_double(obj[1]) * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 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(14, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":87 * wbuf.write_int32(16) * wbuf.write_double(obj[0]) * wbuf.write_double(obj[1]) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 87, __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(14, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":84 * * * cdef point_encode(ConnectionSettings 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.protocol.protocol.point_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":90 * * * cdef point_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * double x = hton.unpack_double(buf.read(8)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_point_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("point_decode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":92 * cdef point_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * double x = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double y = hton.unpack_double(buf.read(8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 92, __pyx_L1_error) __pyx_v_x = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":93 * cdef: * double x = hton.unpack_double(buf.read(8)) * double y = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * * return Point(x, y) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 93, __pyx_L1_error) __pyx_v_y = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":95 * double y = hton.unpack_double(buf.read(8)) * * return Point(x, y) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 95, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 95, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/geometry.pyx":90 * * * cdef point_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * double x = hton.unpack_double(buf.read(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_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.point_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":98 * * * cdef path_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * int8_t is_closed = 0 */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_path_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; int __pyx_t_3; int8_t __pyx_t_4; Py_ssize_t __pyx_t_5; __Pyx_RefNannySetupContext("path_encode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":100 * cdef path_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * cdef: * int8_t is_closed = 0 # <<<<<<<<<<<<<< * ssize_t npts * ssize_t encoded_len */ __pyx_v_is_closed = 0; /* "asyncpg/protocol/codecs/geometry.pyx":105 * int32_t i * * if cpython.PyTuple_Check(obj): # <<<<<<<<<<<<<< * is_closed = 1 * elif cpython.PyList_Check(obj): */ __pyx_t_1 = (PyTuple_Check(__pyx_v_obj) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/geometry.pyx":106 * * if cpython.PyTuple_Check(obj): * is_closed = 1 # <<<<<<<<<<<<<< * elif cpython.PyList_Check(obj): * is_closed = 0 */ __pyx_v_is_closed = 1; /* "asyncpg/protocol/codecs/geometry.pyx":105 * int32_t i * * if cpython.PyTuple_Check(obj): # <<<<<<<<<<<<<< * is_closed = 1 * elif cpython.PyList_Check(obj): */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/geometry.pyx":107 * if cpython.PyTuple_Check(obj): * is_closed = 1 * elif cpython.PyList_Check(obj): # <<<<<<<<<<<<<< * is_closed = 0 * elif isinstance(obj, Path): */ __pyx_t_1 = (PyList_Check(__pyx_v_obj) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/geometry.pyx":108 * is_closed = 1 * elif cpython.PyList_Check(obj): * is_closed = 0 # <<<<<<<<<<<<<< * elif isinstance(obj, Path): * is_closed = obj.is_closed */ __pyx_v_is_closed = 0; /* "asyncpg/protocol/codecs/geometry.pyx":107 * if cpython.PyTuple_Check(obj): * is_closed = 1 * elif cpython.PyList_Check(obj): # <<<<<<<<<<<<<< * is_closed = 0 * elif isinstance(obj, Path): */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/geometry.pyx":109 * elif cpython.PyList_Check(obj): * is_closed = 0 * elif isinstance(obj, Path): # <<<<<<<<<<<<<< * is_closed = obj.is_closed * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Path); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(14, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/geometry.pyx":110 * is_closed = 0 * elif isinstance(obj, Path): * is_closed = obj.is_closed # <<<<<<<<<<<<<< * * npts = len(obj) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_is_closed); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_As_int8_t(__pyx_t_2); if (unlikely((__pyx_t_4 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(14, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_is_closed = __pyx_t_4; /* "asyncpg/protocol/codecs/geometry.pyx":109 * elif cpython.PyList_Check(obj): * is_closed = 0 * elif isinstance(obj, Path): # <<<<<<<<<<<<<< * is_closed = obj.is_closed * */ } __pyx_L3:; /* "asyncpg/protocol/codecs/geometry.pyx":112 * 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(14, 112, __pyx_L1_error) __pyx_v_npts = __pyx_t_5; /* "asyncpg/protocol/codecs/geometry.pyx":113 * * npts = len(obj) * encoded_len = 1 + 4 + 16 * npts # <<<<<<<<<<<<<< * if encoded_len > _MAXINT32: * raise ValueError('path value too long') */ __pyx_v_encoded_len = (5 + (16 * __pyx_v_npts)); /* "asyncpg/protocol/codecs/geometry.pyx":114 * npts = len(obj) * encoded_len = 1 + 4 + 16 * npts * if encoded_len > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('path value too long') * */ __pyx_t_3 = ((__pyx_v_encoded_len > 0x7FFFFFFF) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/geometry.pyx":115 * encoded_len = 1 + 4 + 16 * npts * if encoded_len > _MAXINT32: * raise ValueError('path value too long') # <<<<<<<<<<<<<< * * wbuf.write_int32(encoded_len) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 115, __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, 115, __pyx_L1_error) /* "asyncpg/protocol/codecs/geometry.pyx":114 * npts = len(obj) * encoded_len = 1 + 4 + 16 * npts * if encoded_len > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('path value too long') * */ } /* "asyncpg/protocol/codecs/geometry.pyx":117 * raise ValueError('path value too long') * * wbuf.write_int32(encoded_len) # <<<<<<<<<<<<<< * wbuf.write_byte(is_closed) * wbuf.write_int32(npts) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_encoded_len)); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":118 * * wbuf.write_int32(encoded_len) * wbuf.write_byte(is_closed) # <<<<<<<<<<<<<< * wbuf.write_int32(npts) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_wbuf, __pyx_v_is_closed); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":119 * wbuf.write_int32(encoded_len) * wbuf.write_byte(is_closed) * wbuf.write_int32(npts) # <<<<<<<<<<<<<< * * _encode_points(wbuf, obj) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_npts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":121 * wbuf.write_int32(npts) * * _encode_points(wbuf, obj) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__encode_points(__pyx_v_wbuf, __pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":98 * * * cdef path_encode(ConnectionSettings 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_AddTraceback("asyncpg.protocol.protocol.path_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":124 * * * cdef path_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int8_t is_closed = buf.read(1)[0] */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_path_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; __Pyx_RefNannySetupContext("path_decode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":126 * cdef path_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * int8_t is_closed = buf.read(1)[0] # <<<<<<<<<<<<<< * * return Path(*_decode_points(buf), is_closed=is_closed == 1) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 126, __pyx_L1_error) __pyx_v_is_closed = ((int8_t)(__pyx_t_1[0])); /* "asyncpg/protocol/codecs/geometry.pyx":128 * int8_t is_closed = buf.read(1)[0] * * return Path(*_decode_points(buf), is_closed=is_closed == 1) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Path); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__decode_points(__pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_is_closed == 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_closed, __pyx_t_5) < 0) __PYX_ERR(14, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/geometry.pyx":124 * * * cdef path_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int8_t is_closed = buf.read(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.protocol.protocol.path_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":131 * * * cdef poly_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * bint is_closed */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_poly_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("poly_encode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":138 * 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(14, 138, __pyx_L1_error) __pyx_v_npts = __pyx_t_1; /* "asyncpg/protocol/codecs/geometry.pyx":139 * * 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/protocol/codecs/geometry.pyx":140 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/geometry.pyx":141 * encoded_len = 4 + 16 * npts * if encoded_len > _MAXINT32: * raise ValueError('polygon value too long') # <<<<<<<<<<<<<< * * wbuf.write_int32(encoded_len) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 141, __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(14, 141, __pyx_L1_error) /* "asyncpg/protocol/codecs/geometry.pyx":140 * npts = len(obj) * encoded_len = 4 + 16 * npts * if encoded_len > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('polygon value too long') * */ } /* "asyncpg/protocol/codecs/geometry.pyx":143 * 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_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_encoded_len)); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":144 * * wbuf.write_int32(encoded_len) * wbuf.write_int32(npts) # <<<<<<<<<<<<<< * _encode_points(wbuf, obj) * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_npts)); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":145 * wbuf.write_int32(encoded_len) * wbuf.write_int32(npts) * _encode_points(wbuf, obj) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__encode_points(__pyx_v_wbuf, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":131 * * * cdef poly_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * bint is_closed */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.poly_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":148 * * * cdef poly_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return Polygon(*_decode_points(buf)) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_poly_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("poly_decode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":149 * * cdef poly_decode(ConnectionSettings settings, FastReadBuffer buf): * return Polygon(*_decode_points(buf)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Polygon); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__decode_points(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 149, __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; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/geometry.pyx":148 * * * cdef poly_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return 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.protocol.protocol.poly_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":152 * * * cdef circle_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(24) * wbuf.write_double(obj[0][0]) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_circle_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("circle_encode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":153 * * cdef circle_encode(ConnectionSettings 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_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_wbuf, 24); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":154 * cdef circle_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * wbuf.write_int32(24) * wbuf.write_double(obj[0][0]) # <<<<<<<<<<<<<< * wbuf.write_double(obj[0][1]) * wbuf.write_double(obj[1]) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 154, __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(14, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":155 * wbuf.write_int32(24) * wbuf.write_double(obj[0][0]) * wbuf.write_double(obj[0][1]) # <<<<<<<<<<<<<< * wbuf.write_double(obj[1]) * */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 155, __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(14, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":156 * wbuf.write_double(obj[0][0]) * wbuf.write_double(obj[0][1]) * wbuf.write_double(obj[1]) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 156, __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(14, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":152 * * * cdef circle_encode(ConnectionSettings 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.protocol.protocol.circle_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":159 * * * cdef circle_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * double center_x = hton.unpack_double(buf.read(8)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_circle_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("circle_decode", 0); /* "asyncpg/protocol/codecs/geometry.pyx":161 * cdef circle_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * double center_x = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double center_y = hton.unpack_double(buf.read(8)) * double radius = hton.unpack_double(buf.read(8)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 161, __pyx_L1_error) __pyx_v_center_x = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":162 * cdef: * double center_x = hton.unpack_double(buf.read(8)) * double center_y = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * double radius = hton.unpack_double(buf.read(8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 162, __pyx_L1_error) __pyx_v_center_y = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":163 * double center_x = hton.unpack_double(buf.read(8)) * double center_y = hton.unpack_double(buf.read(8)) * double radius = hton.unpack_double(buf.read(8)) # <<<<<<<<<<<<<< * * return Circle((center_x, center_y), radius) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 163, __pyx_L1_error) __pyx_v_radius = __pyx_f_7asyncpg_8protocol_4hton_unpack_double(__pyx_t_1); /* "asyncpg/protocol/codecs/geometry.pyx":165 * double radius = hton.unpack_double(buf.read(8)) * * return Circle((center_x, center_y), radius) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyFloat_FromDouble(__pyx_v_center_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_center_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyFloat_FromDouble(__pyx_v_radius); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 165, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 165, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/geometry.pyx":159 * * * cdef circle_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * double center_x = hton.unpack_double(buf.read(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_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.circle_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/geometry.pyx":168 * * * cdef init_geometry_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BOXOID, * &box_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_geometry_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_geometry_codecs", 0); /* "asyncpg/protocol/codecs/geometry.pyx":169 * * cdef init_geometry_codecs(): * register_core_codec(BOXOID, # <<<<<<<<<<<<<< * &box_encode, * &box_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x25B, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_box_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_box_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":174 * PG_FORMAT_BINARY) * * register_core_codec(LINEOID, # <<<<<<<<<<<<<< * &line_encode, * &line_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x274, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_line_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_line_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":179 * PG_FORMAT_BINARY) * * register_core_codec(LSEGOID, # <<<<<<<<<<<<<< * &lseg_encode, * &lseg_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x259, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_lseg_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_lseg_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":184 * PG_FORMAT_BINARY) * * register_core_codec(POINTOID, # <<<<<<<<<<<<<< * &point_encode, * &point_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x258, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_point_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_point_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":189 * PG_FORMAT_BINARY) * * register_core_codec(PATHOID, # <<<<<<<<<<<<<< * &path_encode, * &path_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x25A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_path_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_path_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":194 * PG_FORMAT_BINARY) * * register_core_codec(POLYGONOID, # <<<<<<<<<<<<<< * &poly_encode, * &poly_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x25C, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_poly_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_poly_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":199 * PG_FORMAT_BINARY) * * register_core_codec(CIRCLEOID, # <<<<<<<<<<<<<< * &circle_encode, * &circle_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2CE, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_circle_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_circle_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":168 * * * cdef init_geometry_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BOXOID, * &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/int.pyx":8 * * * cdef bool_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * if not cpython.PyBool_Check(obj): * raise TypeError('a boolean is required (got type {})'.format( */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bool_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; char __pyx_t_7; __Pyx_RefNannySetupContext("bool_encode", 0); /* "asyncpg/protocol/codecs/int.pyx":9 * * cdef bool_encode(ConnectionSettings 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) != 0)) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/int.pyx":10 * cdef bool_encode(ConnectionSettings settings, WriteBuffer buf, obj): * if not cpython.PyBool_Check(obj): * raise TypeError('a boolean is required (got type {})'.format( # <<<<<<<<<<<<<< * type(obj).__name__)) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_boolean_is_required_got_type, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/int.pyx":11 * if not cpython.PyBool_Check(obj): * raise TypeError('a boolean is required (got type {})'.format( * type(obj).__name__)) # <<<<<<<<<<<<<< * * buf.write_int32(1) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 10, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 10, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/int.pyx":10 * cdef bool_encode(ConnectionSettings 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 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(5, 10, __pyx_L1_error) /* "asyncpg/protocol/codecs/int.pyx":9 * * cdef bool_encode(ConnectionSettings settings, WriteBuffer buf, obj): * if not cpython.PyBool_Check(obj): # <<<<<<<<<<<<<< * raise TypeError('a boolean is required (got type {})'.format( * type(obj).__name__)) */ } /* "asyncpg/protocol/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_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/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 != 0)) { __pyx_t_7 = '\x01'; } else { __pyx_t_7 = '\x00'; } __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_buf, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/int.pyx":8 * * * cdef bool_encode(ConnectionSettings 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.protocol.protocol.bool_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/int.pyx":17 * * * cdef bool_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return buf.read(1)[0] is b'\x01' * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_bool_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("bool_decode", 0); /* "asyncpg/protocol/codecs/int.pyx":18 * * cdef bool_decode(ConnectionSettings settings, FastReadBuffer buf): * return buf.read(1)[0] is b'\x01' # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 18, __pyx_L1_error) __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_t_1[0]) == '\x01')); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/int.pyx":17 * * * cdef bool_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return buf.read(1)[0] is b'\x01' * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.bool_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/int.pyx":21 * * * cdef int2_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef long val */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int2_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; long __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("int2_encode", 0); /* "asyncpg/protocol/codecs/int.pyx":22 * * cdef int2_encode(ConnectionSettings settings, WriteBuffer buf, obj): * cdef int overflow = 0 # <<<<<<<<<<<<<< * cdef long val * */ __pyx_v_overflow = 0; /* "asyncpg/protocol/codecs/int.pyx":25 * cdef long val * * try: # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLong(obj) * 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/int.pyx":26 * * try: * val = cpython.PyLong_AsLong(obj) # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_t_4 = PyLong_AsLong(__pyx_v_obj); if (unlikely(__pyx_t_4 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(5, 26, __pyx_L3_error) __pyx_v_val = __pyx_t_4; /* "asyncpg/protocol/codecs/int.pyx":25 * cdef long val * * try: # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLong(obj) * 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/int.pyx":27 * try: * val = cpython.PyLong_AsLong(obj) * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_5) { __Pyx_AddTraceback("asyncpg.protocol.protocol.int2_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(5, 27, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/int.pyx":28 * val = cpython.PyLong_AsLong(obj) * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * if overflow or val < -32768 or val > 32767: */ __pyx_v_overflow = 1; __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; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "asyncpg/protocol/codecs/int.pyx":25 * cdef long val * * try: # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLong(obj) * except OverflowError: */ __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/int.pyx":30 * overflow = 1 * * if overflow or val < -32768 or val > 32767: # <<<<<<<<<<<<<< * raise OverflowError( * 'int too big to be encoded as INT2: {!r}'.format(obj)) */ __pyx_t_10 = (__pyx_v_overflow != 0); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_10 = ((__pyx_v_val < -32768L) != 0); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_10 = ((__pyx_v_val > 0x7FFF) != 0); __pyx_t_9 = __pyx_t_10; __pyx_L12_bool_binop_done:; if (__pyx_t_9) { /* "asyncpg/protocol/codecs/int.pyx":32 * if overflow or val < -32768 or val > 32767: * raise OverflowError( * 'int too big to be encoded as INT2: {!r}'.format(obj)) # <<<<<<<<<<<<<< * * buf.write_int32(2) */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_int_too_big_to_be_encoded_as_INT, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_6) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_obj); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_obj}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 32, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_obj}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 32, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_obj); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/int.pyx":31 * * if overflow or val < -32768 or val > 32767: * raise OverflowError( # <<<<<<<<<<<<<< * 'int too big to be encoded as INT2: {!r}'.format(obj)) * */ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(5, 31, __pyx_L1_error) /* "asyncpg/protocol/codecs/int.pyx":30 * overflow = 1 * * if overflow or val < -32768 or val > 32767: # <<<<<<<<<<<<<< * raise OverflowError( * 'int too big to be encoded as INT2: {!r}'.format(obj)) */ } /* "asyncpg/protocol/codecs/int.pyx":34 * 'int too big to be encoded as INT2: {!r}'.format(obj)) * * buf.write_int32(2) # <<<<<<<<<<<<<< * buf.write_int16(val) * */ __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/int.pyx":35 * * buf.write_int32(2) * buf.write_int16(val) # <<<<<<<<<<<<<< * * */ __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_val)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/int.pyx":21 * * * cdef int2_encode(ConnectionSettings 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_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.int2_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/int.pyx":38 * * * cdef int2_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLong(hton.unpack_int16(buf.read(2))) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int2_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("int2_decode", 0); /* "asyncpg/protocol/codecs/int.pyx":39 * * cdef int2_decode(ConnectionSettings settings, FastReadBuffer buf): * return cpython.PyLong_FromLong(hton.unpack_int16(buf.read(2))) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 39, __pyx_L1_error) __pyx_t_2 = PyLong_FromLong(__pyx_f_7asyncpg_8protocol_4hton_unpack_int16(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/int.pyx":38 * * * cdef int2_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLong(hton.unpack_int16(buf.read(2))) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.int2_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/int.pyx":42 * * * cdef int4_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef long val = 0 */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int4_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; long __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("int4_encode", 0); /* "asyncpg/protocol/codecs/int.pyx":43 * * cdef int4_encode(ConnectionSettings settings, WriteBuffer buf, obj): * cdef int overflow = 0 # <<<<<<<<<<<<<< * cdef long val = 0 * */ __pyx_v_overflow = 0; /* "asyncpg/protocol/codecs/int.pyx":44 * cdef int4_encode(ConnectionSettings settings, WriteBuffer buf, obj): * cdef int overflow = 0 * cdef long val = 0 # <<<<<<<<<<<<<< * * try: */ __pyx_v_val = 0; /* "asyncpg/protocol/codecs/int.pyx":46 * cdef long val = 0 * * try: # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLong(obj) * 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/int.pyx":47 * * try: * val = cpython.PyLong_AsLong(obj) # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_t_4 = PyLong_AsLong(__pyx_v_obj); if (unlikely(__pyx_t_4 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(5, 47, __pyx_L3_error) __pyx_v_val = __pyx_t_4; /* "asyncpg/protocol/codecs/int.pyx":46 * cdef long val = 0 * * try: # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLong(obj) * 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/int.pyx":48 * try: * val = cpython.PyLong_AsLong(obj) * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_5) { __Pyx_AddTraceback("asyncpg.protocol.protocol.int4_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(5, 48, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/int.pyx":49 * val = cpython.PyLong_AsLong(obj) * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * # "long" and "long long" have the same size for x86_64, need an extra check */ __pyx_v_overflow = 1; __Pyx_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; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "asyncpg/protocol/codecs/int.pyx":46 * cdef long val = 0 * * try: # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLong(obj) * except OverflowError: */ __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/int.pyx":52 * * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and (val < -2147483648 or # <<<<<<<<<<<<<< * val > 2147483647)): * raise OverflowError( */ __pyx_t_10 = (__pyx_v_overflow != 0); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_10 = (((sizeof(__pyx_v_val)) > 4) != 0); if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_10 = ((__pyx_v_val < -2147483648L) != 0); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } /* "asyncpg/protocol/codecs/int.pyx":53 * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and (val < -2147483648 or * val > 2147483647)): # <<<<<<<<<<<<<< * raise OverflowError( * 'int too big to be encoded as INT4: {!r}'.format(obj)) */ __pyx_t_10 = ((__pyx_v_val > 0x7FFFFFFF) != 0); __pyx_t_9 = __pyx_t_10; __pyx_L12_bool_binop_done:; /* "asyncpg/protocol/codecs/int.pyx":52 * * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and (val < -2147483648 or # <<<<<<<<<<<<<< * val > 2147483647)): * raise OverflowError( */ if (__pyx_t_9) { /* "asyncpg/protocol/codecs/int.pyx":55 * val > 2147483647)): * raise OverflowError( * 'int too big to be encoded as INT4: {!r}'.format(obj)) # <<<<<<<<<<<<<< * * buf.write_int32(4) */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_int_too_big_to_be_encoded_as_INT_2, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_6) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_obj); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_obj}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 55, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_obj}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 55, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_obj); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/int.pyx":54 * if overflow or (sizeof(val) > 4 and (val < -2147483648 or * val > 2147483647)): * raise OverflowError( # <<<<<<<<<<<<<< * 'int too big to be encoded as INT4: {!r}'.format(obj)) * */ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(5, 54, __pyx_L1_error) /* "asyncpg/protocol/codecs/int.pyx":52 * * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and (val < -2147483648 or # <<<<<<<<<<<<<< * val > 2147483647)): * raise OverflowError( */ } /* "asyncpg/protocol/codecs/int.pyx":57 * 'int too big to be encoded as INT4: {!r}'.format(obj)) * * buf.write_int32(4) # <<<<<<<<<<<<<< * buf.write_int32(val) * */ __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/int.pyx":58 * * buf.write_int32(4) * buf.write_int32(val) # <<<<<<<<<<<<<< * * */ __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_val)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/int.pyx":42 * * * cdef int4_encode(ConnectionSettings 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_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.int4_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/int.pyx":61 * * * cdef int4_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLong(hton.unpack_int32(buf.read(4))) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int4_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("int4_decode", 0); /* "asyncpg/protocol/codecs/int.pyx":62 * * cdef int4_decode(ConnectionSettings settings, FastReadBuffer buf): * return cpython.PyLong_FromLong(hton.unpack_int32(buf.read(4))) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 62, __pyx_L1_error) __pyx_t_2 = PyLong_FromLong(__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/int.pyx":61 * * * cdef int4_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLong(hton.unpack_int32(buf.read(4))) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.int4_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/int.pyx":65 * * * cdef int8_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef long long val */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int8_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; PY_LONG_LONG __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("int8_encode", 0); /* "asyncpg/protocol/codecs/int.pyx":66 * * cdef int8_encode(ConnectionSettings settings, WriteBuffer buf, obj): * cdef int overflow = 0 # <<<<<<<<<<<<<< * cdef long long val * */ __pyx_v_overflow = 0; /* "asyncpg/protocol/codecs/int.pyx":69 * cdef long long val * * try: # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLongLong(obj) * 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/int.pyx":70 * * try: * val = cpython.PyLong_AsLongLong(obj) # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_t_4 = PyLong_AsLongLong(__pyx_v_obj); if (unlikely(__pyx_t_4 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(5, 70, __pyx_L3_error) __pyx_v_val = __pyx_t_4; /* "asyncpg/protocol/codecs/int.pyx":69 * cdef long long val * * try: # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLongLong(obj) * 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/int.pyx":71 * try: * val = cpython.PyLong_AsLongLong(obj) * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_5) { __Pyx_AddTraceback("asyncpg.protocol.protocol.int8_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(5, 71, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/int.pyx":72 * val = cpython.PyLong_AsLongLong(obj) * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * # Just in case for systems with "long long" bigger than 8 bytes */ __pyx_v_overflow = 1; __Pyx_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; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "asyncpg/protocol/codecs/int.pyx":69 * cdef long long val * * try: # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLongLong(obj) * except OverflowError: */ __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/int.pyx":75 * * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and (val < -9223372036854775808 or # <<<<<<<<<<<<<< * val > 9223372036854775807)): * raise OverflowError( */ __pyx_t_10 = (__pyx_v_overflow != 0); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_10 = (((sizeof(__pyx_v_val)) > 8) != 0); if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_8 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_val); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_int_neg_9223372036854775808, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(5, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } /* "asyncpg/protocol/codecs/int.pyx":76 * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and (val < -9223372036854775808 or * val > 9223372036854775807)): # <<<<<<<<<<<<<< * raise OverflowError( * 'int too big to be encoded as INT8: {!r}'.format(obj)) */ __pyx_t_7 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_val); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_int_9223372036854775807, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(5, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = __pyx_t_10; __pyx_L12_bool_binop_done:; /* "asyncpg/protocol/codecs/int.pyx":75 * * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and (val < -9223372036854775808 or # <<<<<<<<<<<<<< * val > 9223372036854775807)): * raise OverflowError( */ if (__pyx_t_9) { /* "asyncpg/protocol/codecs/int.pyx":78 * val > 9223372036854775807)): * raise OverflowError( * 'int too big to be encoded as INT8: {!r}'.format(obj)) # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_int_too_big_to_be_encoded_as_INT_3, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_6) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_obj); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_obj}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 78, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_obj}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 78, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_obj); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/int.pyx":77 * if overflow or (sizeof(val) > 8 and (val < -9223372036854775808 or * val > 9223372036854775807)): * raise OverflowError( # <<<<<<<<<<<<<< * 'int too big to be encoded as INT8: {!r}'.format(obj)) * */ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(5, 77, __pyx_L1_error) /* "asyncpg/protocol/codecs/int.pyx":75 * * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and (val < -9223372036854775808 or # <<<<<<<<<<<<<< * val > 9223372036854775807)): * raise OverflowError( */ } /* "asyncpg/protocol/codecs/int.pyx":80 * 'int too big to be encoded as INT8: {!r}'.format(obj)) * * buf.write_int32(8) # <<<<<<<<<<<<<< * buf.write_int64(val) * */ __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/int.pyx":81 * * buf.write_int32(8) * buf.write_int64(val) # <<<<<<<<<<<<<< * * */ __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, ((int64_t)__pyx_v_val)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/int.pyx":65 * * * cdef int8_encode(ConnectionSettings 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_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.int8_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/int.pyx":84 * * * cdef int8_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLongLong(hton.unpack_int64(buf.read(8))) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int8_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("int8_decode", 0); /* "asyncpg/protocol/codecs/int.pyx":85 * * cdef int8_decode(ConnectionSettings settings, FastReadBuffer buf): * return cpython.PyLong_FromLongLong(hton.unpack_int64(buf.read(8))) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 85, __pyx_L1_error) __pyx_t_2 = PyLong_FromLongLong(__pyx_f_7asyncpg_8protocol_4hton_unpack_int64(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/int.pyx":84 * * * cdef int8_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLongLong(hton.unpack_int64(buf.read(8))) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.int8_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/int.pyx":88 * * * 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; __Pyx_RefNannySetupContext("init_int_codecs", 0); /* "asyncpg/protocol/codecs/int.pyx":90 * cdef init_int_codecs(): * * register_core_codec(BOOLOID, # <<<<<<<<<<<<<< * &bool_encode, * &bool_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(16, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_bool_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_bool_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/int.pyx":95 * PG_FORMAT_BINARY) * * register_core_codec(INT2OID, # <<<<<<<<<<<<<< * &int2_encode, * &int2_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(21, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_int2_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_int2_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/int.pyx":100 * PG_FORMAT_BINARY) * * register_core_codec(INT4OID, # <<<<<<<<<<<<<< * &int4_encode, * &int4_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(23, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_int4_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_int4_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/int.pyx":105 * PG_FORMAT_BINARY) * * register_core_codec(INT8OID, # <<<<<<<<<<<<<< * &int8_encode, * &int8_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(20, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_int8_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_int8_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/int.pyx":88 * * * 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/json.pyx":8 * * * cdef jsonb_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_jsonb_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("jsonb_encode", 0); /* "asyncpg/protocol/codecs/json.pyx":13 * ssize_t size * * as_pg_string_and_size(settings, obj, &str, &size) # <<<<<<<<<<<<<< * * if size > 0x7fffffff - 1: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_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, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/json.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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/json.pyx":16 * * if size > 0x7fffffff - 1: * raise ValueError('string too long') # <<<<<<<<<<<<<< * * buf.write_int32(size + 1) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 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(15, 16, __pyx_L1_error) /* "asyncpg/protocol/codecs/json.pyx":15 * as_pg_string_and_size(settings, obj, &str, &size) * * if size > 0x7fffffff - 1: # <<<<<<<<<<<<<< * raise ValueError('string too long') * */ } /* "asyncpg/protocol/codecs/json.pyx":18 * 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_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, (((int32_t)__pyx_v_size) + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/json.pyx":19 * * buf.write_int32(size + 1) * buf.write_byte(1) # JSONB format version # <<<<<<<<<<<<<< * buf.write_cstr(str, size) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_buf, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/json.pyx":20 * buf.write_int32(size + 1) * buf.write_byte(1) # JSONB format version * buf.write_cstr(str, size) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_buf, __pyx_v_str, __pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/json.pyx":8 * * * cdef jsonb_encode(ConnectionSettings 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.protocol.protocol.jsonb_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/json.pyx":23 * * * cdef jsonb_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef uint8_t format = buf.read(1)[0] * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_jsonb_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; __Pyx_RefNannySetupContext("jsonb_decode", 0); /* "asyncpg/protocol/codecs/json.pyx":24 * * cdef jsonb_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef uint8_t format = buf.read(1)[0] # <<<<<<<<<<<<<< * * if format != 1: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 24, __pyx_L1_error) __pyx_v_format = ((uint8_t)(__pyx_t_1[0])); /* "asyncpg/protocol/codecs/json.pyx":26 * cdef uint8_t format = buf.read(1)[0] * * if format != 1: # <<<<<<<<<<<<<< * raise ValueError('unexpected JSONB format: {}'.format(format)) * */ __pyx_t_2 = ((__pyx_v_format != 1) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/json.pyx":27 * * if format != 1: * raise ValueError('unexpected JSONB format: {}'.format(format)) # <<<<<<<<<<<<<< * * return text_decode(settings, buf) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_JSONB_format, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 27, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 27, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(15, 27, __pyx_L1_error) /* "asyncpg/protocol/codecs/json.pyx":26 * cdef uint8_t format = buf.read(1)[0] * * if format != 1: # <<<<<<<<<<<<<< * raise ValueError('unexpected JSONB format: {}'.format(format)) * */ } /* "asyncpg/protocol/codecs/json.pyx":29 * raise ValueError('unexpected JSONB format: {}'.format(format)) * * return text_decode(settings, buf) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/json.pyx":23 * * * cdef jsonb_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef uint8_t format = buf.read(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.protocol.protocol.jsonb_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/json.pyx":32 * * * cdef init_json_codecs(): # <<<<<<<<<<<<<< * register_core_codec(JSONOID, * &text_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_json_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_json_codecs", 0); /* "asyncpg/protocol/codecs/json.pyx":33 * * cdef init_json_codecs(): * register_core_codec(JSONOID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x72, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/json.pyx":37 * &text_decode, * PG_FORMAT_BINARY) * register_core_codec(JSONBOID, # <<<<<<<<<<<<<< * &jsonb_encode, * &jsonb_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xEDA, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_jsonb_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_jsonb_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/json.pyx":32 * * * cdef init_json_codecs(): # <<<<<<<<<<<<<< * register_core_codec(JSONOID, * &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/money.pyx":8 * * * 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; __Pyx_RefNannySetupContext("init_monetary_codecs", 0); /* "asyncpg/protocol/codecs/money.pyx":9 * * cdef init_monetary_codecs(): * moneyoids = [ # <<<<<<<<<<<<<< * MONEYOID, * ] */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_790); __Pyx_GIVEREF(__pyx_int_790); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_790); __pyx_v_moneyoids = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/money.pyx":13 * ] * * for oid in moneyoids: # <<<<<<<<<<<<<< * register_core_codec(oid, * &text_encode, */ __pyx_t_1 = __pyx_v_moneyoids; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(16, 13, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/money.pyx":14 * * for oid in moneyoids: * register_core_codec(oid, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(16, 14, __pyx_L1_error) /* "asyncpg/protocol/codecs/money.pyx":17 * &text_encode, * &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_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/money.pyx":13 * ] * * for oid in moneyoids: # <<<<<<<<<<<<<< * register_core_codec(oid, * &text_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/money.pyx":8 * * * 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/network.pyx":21 * * * 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_8protocol_8protocol__ip_max_prefix_len(int32_t __pyx_v_family) { uint8_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_ip_max_prefix_len", 0); /* "asyncpg/protocol/codecs/network.pyx":24 * # 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/network.pyx":25 * # IP protocol version. * if family == PGSQL_AF_INET: * return 32 # <<<<<<<<<<<<<< * else: * return 128 */ __pyx_r = 32; goto __pyx_L0; /* "asyncpg/protocol/codecs/network.pyx":24 * # Maximum number of bits in the network prefix of the specified * # IP protocol version. * if family == PGSQL_AF_INET: # <<<<<<<<<<<<<< * return 32 * else: */ } /* "asyncpg/protocol/codecs/network.pyx":27 * return 32 * else: * return 128 # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_r = 0x80; goto __pyx_L0; } /* "asyncpg/protocol/codecs/network.pyx":21 * * * 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:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/network.pyx":30 * * * 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_8protocol_8protocol__ip_addr_len(int32_t __pyx_v_family) { int32_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_ip_addr_len", 0); /* "asyncpg/protocol/codecs/network.pyx":32 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/network.pyx":33 * # 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/protocol/codecs/network.pyx":32 * 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/protocol/codecs/network.pyx":35 * return 4 * else: * return 16 # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_r = 16; goto __pyx_L0; } /* "asyncpg/protocol/codecs/network.pyx":30 * * * 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:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/network.pyx":38 * * * 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_8protocol_8protocol__ver_to_family(int32_t __pyx_v_version) { int8_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_ver_to_family", 0); /* "asyncpg/protocol/codecs/network.pyx":39 * * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/network.pyx":40 * 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/protocol/codecs/network.pyx":39 * * cdef inline int8_t _ver_to_family(int32_t version): * if version == 4: # <<<<<<<<<<<<<< * return PGSQL_AF_INET * else: */ } /* "asyncpg/protocol/codecs/network.pyx":42 * return PGSQL_AF_INET * else: * return PGSQL_AF_INET6 # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_r = 3; goto __pyx_L0; } /* "asyncpg/protocol/codecs/network.pyx":38 * * * cdef inline int8_t _ver_to_family(int32_t version): # <<<<<<<<<<<<<< * if version == 4: * return PGSQL_AF_INET */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/network.pyx":45 * * * 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_8protocol_8protocol__net_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("_net_encode", 0); /* "asyncpg/protocol/codecs/network.pyx":52 * 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(17, 52, __pyx_L1_error) /* "asyncpg/protocol/codecs/network.pyx":54 * 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_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, (4 + ((int32_t)__pyx_v_addrlen))); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/network.pyx":55 * * buf.write_int32(4 + addrlen) * buf.write_byte(family) # <<<<<<<<<<<<<< * buf.write_byte(bits) * buf.write_byte(is_cidr) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_buf, __pyx_v_family); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/network.pyx":56 * 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_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_buf, ((int8_t)__pyx_v_bits)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/network.pyx":57 * 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_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_buf, __pyx_v_is_cidr); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/network.pyx":58 * buf.write_byte(bits) * buf.write_byte(is_cidr) * buf.write_byte(addrlen) # <<<<<<<<<<<<<< * buf.write_cstr(addrbytes, addrlen) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_buf, ((int8_t)__pyx_v_addrlen)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/network.pyx":59 * buf.write_byte(is_cidr) * buf.write_byte(addrlen) * buf.write_cstr(addrbytes, addrlen) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_buf, __pyx_v_addrbytes, __pyx_v_addrlen); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/network.pyx":45 * * * 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.protocol.protocol._net_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/network.pyx":62 * * * cdef net_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t family = buf.read(1)[0] */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_net_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { int32_t __pyx_v_family; uint8_t __pyx_v_bits; 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; 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; int __pyx_t_8; __Pyx_RefNannySetupContext("net_decode", 0); /* "asyncpg/protocol/codecs/network.pyx":64 * cdef net_decode(ConnectionSettings settings, FastReadBuffer buf): * cdef: * int32_t family = buf.read(1)[0] # <<<<<<<<<<<<<< * uint8_t bits = buf.read(1)[0] * int32_t is_cidr = buf.read(1)[0] */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(17, 64, __pyx_L1_error) __pyx_v_family = ((int32_t)(__pyx_t_1[0])); /* "asyncpg/protocol/codecs/network.pyx":65 * cdef: * int32_t family = buf.read(1)[0] * uint8_t bits = buf.read(1)[0] # <<<<<<<<<<<<<< * int32_t is_cidr = buf.read(1)[0] * int32_t addrlen = buf.read(1)[0] */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(17, 65, __pyx_L1_error) __pyx_v_bits = ((uint8_t)(__pyx_t_1[0])); /* "asyncpg/protocol/codecs/network.pyx":66 * int32_t family = buf.read(1)[0] * uint8_t bits = buf.read(1)[0] * int32_t is_cidr = buf.read(1)[0] # <<<<<<<<<<<<<< * int32_t addrlen = buf.read(1)[0] * bytes addr */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(17, 66, __pyx_L1_error) __pyx_v_is_cidr = ((int32_t)(__pyx_t_1[0])); /* "asyncpg/protocol/codecs/network.pyx":67 * uint8_t bits = buf.read(1)[0] * int32_t is_cidr = buf.read(1)[0] * int32_t addrlen = buf.read(1)[0] # <<<<<<<<<<<<<< * bytes addr * uint8_t max_prefix_len = _ip_max_prefix_len(family) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(17, 67, __pyx_L1_error) __pyx_v_addrlen = ((int32_t)(__pyx_t_1[0])); /* "asyncpg/protocol/codecs/network.pyx":69 * int32_t addrlen = buf.read(1)[0] * bytes addr * uint8_t max_prefix_len = _ip_max_prefix_len(family) # <<<<<<<<<<<<<< * * if family != PGSQL_AF_INET and family != PGSQL_AF_INET6: */ __pyx_v_max_prefix_len = __pyx_f_7asyncpg_8protocol_8protocol__ip_max_prefix_len(__pyx_v_family); /* "asyncpg/protocol/codecs/network.pyx":71 * uint8_t max_prefix_len = _ip_max_prefix_len(family) * * 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_2 = 0; break; default: __pyx_t_2 = 1; break; } if (__pyx_t_2) { /* "asyncpg/protocol/codecs/network.pyx":72 * * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_address_family_in_value, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/network.pyx":73 * if family != PGSQL_AF_INET and family != PGSQL_AF_INET6: * raise ValueError('invalid address family in "{}" value'.format( * 'cidr' if is_cidr else 'inet' # <<<<<<<<<<<<<< * )) * */ if ((__pyx_v_is_cidr != 0)) { __Pyx_INCREF(__pyx_n_u_cidr); __pyx_t_5 = __pyx_n_u_cidr; } else { __Pyx_INCREF(__pyx_n_u_inet); __pyx_t_5 = __pyx_n_u_inet; } __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 72, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 72, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/network.pyx":72 * * 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(17, 72, __pyx_L1_error) /* "asyncpg/protocol/codecs/network.pyx":71 * uint8_t max_prefix_len = _ip_max_prefix_len(family) * * 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/protocol/codecs/network.pyx":76 * )) * * max_prefix_len = _ip_max_prefix_len(family) # <<<<<<<<<<<<<< * * if bits > max_prefix_len: */ __pyx_v_max_prefix_len = __pyx_f_7asyncpg_8protocol_8protocol__ip_max_prefix_len(__pyx_v_family); /* "asyncpg/protocol/codecs/network.pyx":78 * 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_2 = ((__pyx_v_bits > __pyx_v_max_prefix_len) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/network.pyx":79 * * if bits > max_prefix_len: * raise ValueError('invalid network prefix length in "{}" value'.format( # <<<<<<<<<<<<<< * 'cidr' if is_cidr else 'inet' * )) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_network_prefix_length_in, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/network.pyx":80 * if bits > max_prefix_len: * raise ValueError('invalid network prefix length in "{}" value'.format( * 'cidr' if is_cidr else 'inet' # <<<<<<<<<<<<<< * )) * */ if ((__pyx_v_is_cidr != 0)) { __Pyx_INCREF(__pyx_n_u_cidr); __pyx_t_7 = __pyx_n_u_cidr; } else { __Pyx_INCREF(__pyx_n_u_inet); __pyx_t_7 = __pyx_n_u_inet; } __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/network.pyx":79 * * if bits > max_prefix_len: * raise ValueError('invalid network prefix length in "{}" value'.format( # <<<<<<<<<<<<<< * 'cidr' if is_cidr else 'inet' * )) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(17, 79, __pyx_L1_error) /* "asyncpg/protocol/codecs/network.pyx":78 * 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/protocol/codecs/network.pyx":83 * )) * * if addrlen != _ip_addr_len(family): # <<<<<<<<<<<<<< * raise ValueError('invalid address length in "{}" value'.format( * 'cidr' if is_cidr else 'inet' */ __pyx_t_2 = ((__pyx_v_addrlen != __pyx_f_7asyncpg_8protocol_8protocol__ip_addr_len(__pyx_v_family)) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/network.pyx":84 * * if addrlen != _ip_addr_len(family): * raise ValueError('invalid address length in "{}" value'.format( # <<<<<<<<<<<<<< * 'cidr' if is_cidr else 'inet' * )) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_address_length_in_value, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/network.pyx":85 * if addrlen != _ip_addr_len(family): * raise ValueError('invalid address length in "{}" value'.format( * 'cidr' if is_cidr else 'inet' # <<<<<<<<<<<<<< * )) * */ if ((__pyx_v_is_cidr != 0)) { __Pyx_INCREF(__pyx_n_u_cidr); __pyx_t_6 = __pyx_n_u_cidr; } else { __Pyx_INCREF(__pyx_n_u_inet); __pyx_t_6 = __pyx_n_u_inet; } __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_7) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 84, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 84, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/network.pyx":84 * * if addrlen != _ip_addr_len(family): * raise ValueError('invalid address length in "{}" value'.format( # <<<<<<<<<<<<<< * 'cidr' if is_cidr else 'inet' * )) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(17, 84, __pyx_L1_error) /* "asyncpg/protocol/codecs/network.pyx":83 * )) * * if addrlen != _ip_addr_len(family): # <<<<<<<<<<<<<< * raise ValueError('invalid address length in "{}" value'.format( * 'cidr' if is_cidr else 'inet' */ } /* "asyncpg/protocol/codecs/network.pyx":88 * )) * * addr = cpython.PyBytes_FromStringAndSize(buf.read(addrlen), addrlen) # <<<<<<<<<<<<<< * * if is_cidr or bits != max_prefix_len: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, __pyx_v_addrlen); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(17, 88, __pyx_L1_error) __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_t_1, __pyx_v_addrlen); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_addr = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/network.pyx":90 * addr = cpython.PyBytes_FromStringAndSize(buf.read(addrlen), addrlen) * * if is_cidr or bits != max_prefix_len: # <<<<<<<<<<<<<< * return _ipnet(addr).supernet(new_prefix=cpython.PyLong_FromLong(bits)) * else: */ __pyx_t_8 = (__pyx_v_is_cidr != 0); if (!__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L7_bool_binop_done; } __pyx_t_8 = ((__pyx_v_bits != __pyx_v_max_prefix_len) != 0); __pyx_t_2 = __pyx_t_8; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/codecs/network.pyx":91 * * if is_cidr or bits != max_prefix_len: * return _ipnet(addr).supernet(new_prefix=cpython.PyLong_FromLong(bits)) # <<<<<<<<<<<<<< * else: * return _ipaddr(addr) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipnet); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_addr); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_addr}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_addr}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_addr); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_supernet); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyLong_FromLong(__pyx_v_bits); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new_prefix, __pyx_t_6) < 0) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/network.pyx":90 * addr = cpython.PyBytes_FromStringAndSize(buf.read(addrlen), addrlen) * * if is_cidr or bits != max_prefix_len: # <<<<<<<<<<<<<< * return _ipnet(addr).supernet(new_prefix=cpython.PyLong_FromLong(bits)) * else: */ } /* "asyncpg/protocol/codecs/network.pyx":93 * return _ipnet(addr).supernet(new_prefix=cpython.PyLong_FromLong(bits)) * else: * return _ipaddr(addr) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddr); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_addr); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_addr}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 93, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_addr}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 93, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_addr); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } /* "asyncpg/protocol/codecs/network.pyx":62 * * * cdef net_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t family = buf.read(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.protocol.protocol.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/protocol/codecs/network.pyx":96 * * * cdef cidr_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * object ipnet */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_cidr_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; PyObject *__pyx_t_4 = NULL; int32_t __pyx_t_5; uint32_t __pyx_t_6; __Pyx_RefNannySetupContext("cidr_encode", 0); /* "asyncpg/protocol/codecs/network.pyx":101 * 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 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipnet); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 101, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 101, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ipnet = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/network.pyx":102 * * ipnet = _ipnet(obj) * family = _ver_to_family(ipnet.version) # <<<<<<<<<<<<<< * _net_encode(buf, family, ipnet.prefixlen, 1, ipnet.network_address.packed) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipnet, __pyx_n_s_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_family = __pyx_f_7asyncpg_8protocol_8protocol__ver_to_family(__pyx_t_5); /* "asyncpg/protocol/codecs/network.pyx":103 * ipnet = _ipnet(obj) * family = _ver_to_family(ipnet.version) * _net_encode(buf, family, ipnet.prefixlen, 1, ipnet.network_address.packed) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipnet, __pyx_n_s_prefixlen); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_t_1); if (unlikely((__pyx_t_6 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipnet, __pyx_n_s_network_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_packed); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 103, __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)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(17, 103, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__net_encode(__pyx_v_buf, __pyx_v_family, __pyx_t_6, 1, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/network.pyx":96 * * * cdef cidr_encode(ConnectionSettings 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_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.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/protocol/codecs/network.pyx":106 * * * cdef inet_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * object ipaddr */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_inet_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; PyObject *__pyx_t_7 = NULL; int32_t __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("inet_encode", 0); /* "asyncpg/protocol/codecs/network.pyx":111 * 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/protocol/codecs/network.pyx":112 * * try: * ipaddr = _ipaddr(obj) # <<<<<<<<<<<<<< * except ValueError: * # PostgreSQL accepts *both* CIDR and host values */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddr); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 112, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 112, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_obj}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 112, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_obj}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 112, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 112, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 112, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_ipaddr = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/network.pyx":111 * int8_t family * * try: # <<<<<<<<<<<<<< * ipaddr = _ipaddr(obj) * except ValueError: */ } /* "asyncpg/protocol/codecs/network.pyx":118 * cidr_encode(settings, buf, obj) * else: * family = _ver_to_family(ipaddr.version) # <<<<<<<<<<<<<< * _net_encode(buf, family, _ip_max_prefix_len(family), 0, ipaddr.packed) * */ /*else:*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipaddr, __pyx_n_s_version); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 118, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 118, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_family = __pyx_f_7asyncpg_8protocol_8protocol__ver_to_family(__pyx_t_8); /* "asyncpg/protocol/codecs/network.pyx":119 * else: * family = _ver_to_family(ipaddr.version) * _net_encode(buf, family, _ip_max_prefix_len(family), 0, ipaddr.packed) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipaddr, __pyx_n_s_packed); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 119, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(17, 119, __pyx_L5_except_error) __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol__net_encode(__pyx_v_buf, __pyx_v_family, __pyx_f_7asyncpg_8protocol_8protocol__ip_max_prefix_len(__pyx_v_family), 0, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 119, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/network.pyx":113 * try: * ipaddr = _ipaddr(obj) * except ValueError: # <<<<<<<<<<<<<< * # PostgreSQL accepts *both* CIDR and host values * # for the host datatype. */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.inet_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(17, 113, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/codecs/network.pyx":116 * # PostgreSQL accepts *both* CIDR and host values * # for the host datatype. * cidr_encode(settings, buf, obj) # <<<<<<<<<<<<<< * else: * family = _ver_to_family(ipaddr.version) */ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_cidr_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 116, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __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; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "asyncpg/protocol/codecs/network.pyx":111 * int8_t family * * try: # <<<<<<<<<<<<<< * ipaddr = _ipaddr(obj) * except ValueError: */ __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/network.pyx":106 * * * cdef inet_encode(ConnectionSettings 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_7); __Pyx_AddTraceback("asyncpg.protocol.protocol.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/protocol/codecs/network.pyx":122 * * * cdef init_network_codecs(): # <<<<<<<<<<<<<< * register_core_codec(CIDROID, * &cidr_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_network_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_network_codecs", 0); /* "asyncpg/protocol/codecs/network.pyx":123 * * cdef init_network_codecs(): * register_core_codec(CIDROID, # <<<<<<<<<<<<<< * &cidr_encode, * &net_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x28A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_cidr_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_net_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/network.pyx":128 * PG_FORMAT_BINARY) * * register_core_codec(INETOID, # <<<<<<<<<<<<<< * &inet_encode, * &net_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x365, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_inet_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_net_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/network.pyx":133 * PG_FORMAT_BINARY) * * register_core_codec(MACADDROID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x33D, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/network.pyx":138 * PG_FORMAT_TEXT) * * register_core_codec(MACADDR8OID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x306, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/network.pyx":122 * * * cdef init_network_codecs(): # <<<<<<<<<<<<<< * register_core_codec(CIDROID, * &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/numeric.pyx":25 * * * cdef numeric_encode_text(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * text_encode(settings, buf, str(obj)) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_numeric_encode_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("numeric_encode_text", 0); /* "asyncpg/protocol/codecs/numeric.pyx":26 * * cdef numeric_encode_text(ConnectionSettings settings, WriteBuffer buf, obj): * text_encode(settings, buf, str(obj)) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_1, NULL); 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_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_text_encode(__pyx_v_settings, __pyx_v_buf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":25 * * * cdef numeric_encode_text(ConnectionSettings 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.protocol.protocol.numeric_encode_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/numeric.pyx":29 * * * cdef numeric_decode_text(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return _Dec(text_decode(settings, buf)) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_numeric_decode_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("numeric_decode_text", 0); /* "asyncpg/protocol/codecs/numeric.pyx":30 * * cdef numeric_decode_text(ConnectionSettings settings, FastReadBuffer buf): * return _Dec(text_decode(settings, buf)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Dec); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/numeric.pyx":29 * * * cdef numeric_decode_text(ConnectionSettings settings, FastReadBuffer 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_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.numeric_decode_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/numeric.pyx":33 * * * cdef numeric_encode_binary(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * object dec */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_numeric_encode_binary(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int64_t __pyx_t_7; Py_ssize_t __pyx_t_8; int64_t __pyx_t_9; int64_t __pyx_t_10; int16_t __pyx_t_11; __Pyx_RefNannySetupContext("numeric_encode_binary", 0); /* "asyncpg/protocol/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/protocol/codecs/numeric.pyx":50 * int64_t padding_size = 0 * * if isinstance(obj, _Dec): # <<<<<<<<<<<<<< * dec = obj * else: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Dec); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(18, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/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/protocol/codecs/numeric.pyx":50 * int64_t padding_size = 0 * * if isinstance(obj, _Dec): # <<<<<<<<<<<<<< * dec = obj * else: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/numeric.pyx":53 * dec = obj * else: * dec = _Dec(obj) # <<<<<<<<<<<<<< * * dt = dec.as_tuple() */ /*else*/ { __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Dec); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 53, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 53, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_obj); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_dec = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/numeric.pyx":55 * dec = _Dec(obj) * * dt = dec.as_tuple() # <<<<<<<<<<<<<< * if dt.exponent == 'F': * raise ValueError('numeric type does not support infinite values') */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dec, __pyx_n_s_as_tuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 55, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_dt = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":56 * * dt = dec.as_tuple() * if dt.exponent == 'F': # <<<<<<<<<<<<<< * raise ValueError('numeric type does not support infinite values') * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_exponent); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_F, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(18, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "asyncpg/protocol/codecs/numeric.pyx":57 * dt = dec.as_tuple() * if dt.exponent == 'F': * raise ValueError('numeric type does not support infinite values') # <<<<<<<<<<<<<< * * if dt.exponent == 'n' or dt.exponent == 'N': */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 57, __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, 57, __pyx_L1_error) /* "asyncpg/protocol/codecs/numeric.pyx":56 * * dt = dec.as_tuple() * if dt.exponent == 'F': # <<<<<<<<<<<<<< * raise ValueError('numeric type does not support infinite values') * */ } /* "asyncpg/protocol/codecs/numeric.pyx":59 * raise ValueError('numeric type does not support infinite values') * * if dt.exponent == 'n' or dt.exponent == 'N': # <<<<<<<<<<<<<< * # NaN * sign = NUMERIC_NAN */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_exponent); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_n, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(18, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_exponent); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_N, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(18, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (__pyx_t_3) { /* "asyncpg/protocol/codecs/numeric.pyx":61 * if dt.exponent == 'n' or dt.exponent == 'N': * # NaN * sign = NUMERIC_NAN # <<<<<<<<<<<<<< * num_pgdigits = 0 * weight = 0 */ __pyx_v_sign = 0xC000; /* "asyncpg/protocol/codecs/numeric.pyx":62 * # NaN * sign = NUMERIC_NAN * num_pgdigits = 0 # <<<<<<<<<<<<<< * weight = 0 * dscale = 0 */ __pyx_v_num_pgdigits = 0; /* "asyncpg/protocol/codecs/numeric.pyx":63 * sign = NUMERIC_NAN * num_pgdigits = 0 * weight = 0 # <<<<<<<<<<<<<< * dscale = 0 * else: */ __pyx_v_weight = 0; /* "asyncpg/protocol/codecs/numeric.pyx":64 * num_pgdigits = 0 * weight = 0 * dscale = 0 # <<<<<<<<<<<<<< * else: * exponent = dt.exponent */ __pyx_v_dscale = 0; /* "asyncpg/protocol/codecs/numeric.pyx":59 * raise ValueError('numeric type does not support infinite values') * * if dt.exponent == 'n' or dt.exponent == 'N': # <<<<<<<<<<<<<< * # NaN * sign = NUMERIC_NAN */ goto __pyx_L5; } /* "asyncpg/protocol/codecs/numeric.pyx":66 * dscale = 0 * else: * exponent = dt.exponent # <<<<<<<<<<<<<< * if exponent < 0 and -exponent > MAX_DSCALE: * raise ValueError( */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_exponent); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(18, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_exponent = __pyx_t_7; /* "asyncpg/protocol/codecs/numeric.pyx":67 * else: * exponent = dt.exponent * if exponent < 0 and -exponent > MAX_DSCALE: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ __pyx_t_2 = ((__pyx_v_exponent < 0) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = (((-__pyx_v_exponent) > 0x3FFF) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L9_bool_binop_done:; if (__pyx_t_3) { /* "asyncpg/protocol/codecs/numeric.pyx":68 * exponent = dt.exponent * if exponent < 0 and -exponent > MAX_DSCALE: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too small') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 68, __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, 68, __pyx_L1_error) /* "asyncpg/protocol/codecs/numeric.pyx":67 * else: * exponent = dt.exponent * if exponent < 0 and -exponent > MAX_DSCALE: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ } /* "asyncpg/protocol/codecs/numeric.pyx":72 * 'exponent is too small') * * if dt.sign: # <<<<<<<<<<<<<< * sign = NUMERIC_NEG * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_sign); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 72, __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(18, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "asyncpg/protocol/codecs/numeric.pyx":73 * * if dt.sign: * sign = NUMERIC_NEG # <<<<<<<<<<<<<< * else: * sign = NUMERIC_POS */ __pyx_v_sign = 0x4000; /* "asyncpg/protocol/codecs/numeric.pyx":72 * 'exponent is too small') * * if dt.sign: # <<<<<<<<<<<<<< * sign = NUMERIC_NEG * else: */ goto __pyx_L11; } /* "asyncpg/protocol/codecs/numeric.pyx":75 * sign = NUMERIC_NEG * else: * sign = NUMERIC_POS # <<<<<<<<<<<<<< * * pydigits = dt.digits */ /*else*/ { __pyx_v_sign = 0; } __pyx_L11:; /* "asyncpg/protocol/codecs/numeric.pyx":77 * sign = NUMERIC_POS * * pydigits = dt.digits # <<<<<<<<<<<<<< * num_pydigits = len(pydigits) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_digits); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(18, 77, __pyx_L1_error) __pyx_v_pydigits = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":78 * * 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, 78, __pyx_L1_error) } __pyx_t_8 = PyTuple_GET_SIZE(__pyx_v_pydigits); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(18, 78, __pyx_L1_error) __pyx_v_num_pydigits = __pyx_t_8; /* "asyncpg/protocol/codecs/numeric.pyx":80 * 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/protocol/codecs/numeric.pyx":81 * * dweight = num_pydigits + exponent - 1 * if dweight >= 0: # <<<<<<<<<<<<<< * weight = (dweight + DEC_DIGITS) // DEC_DIGITS - 1 * else: */ __pyx_t_3 = ((__pyx_v_dweight >= 0) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/numeric.pyx":82 * dweight = num_pydigits + exponent - 1 * if dweight >= 0: * weight = (dweight + DEC_DIGITS) // DEC_DIGITS - 1 # <<<<<<<<<<<<<< * else: * weight = -((-dweight - 1) // DEC_DIGITS + 1) */ __pyx_v_weight = (__Pyx_div_int64_t((__pyx_v_dweight + 4), 4) - 1); /* "asyncpg/protocol/codecs/numeric.pyx":81 * * dweight = num_pydigits + exponent - 1 * if dweight >= 0: # <<<<<<<<<<<<<< * weight = (dweight + DEC_DIGITS) // DEC_DIGITS - 1 * else: */ goto __pyx_L12; } /* "asyncpg/protocol/codecs/numeric.pyx":84 * weight = (dweight + DEC_DIGITS) // DEC_DIGITS - 1 * else: * weight = -((-dweight - 1) // DEC_DIGITS + 1) # <<<<<<<<<<<<<< * * if weight > 2 ** 16 - 1: */ /*else*/ { __pyx_v_weight = (-(__Pyx_div_int64_t(((-__pyx_v_dweight) - 1), 4) + 1)); } __pyx_L12:; /* "asyncpg/protocol/codecs/numeric.pyx":86 * weight = -((-dweight - 1) // DEC_DIGITS + 1) * * if weight > 2 ** 16 - 1: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ __pyx_t_3 = ((__pyx_v_weight > 0xFFFF) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/numeric.pyx":87 * * if weight > 2 ** 16 - 1: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too large') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 87, __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, 87, __pyx_L1_error) /* "asyncpg/protocol/codecs/numeric.pyx":86 * weight = -((-dweight - 1) // DEC_DIGITS + 1) * * if weight > 2 ** 16 - 1: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ } /* "asyncpg/protocol/codecs/numeric.pyx":92 * * 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/protocol/codecs/numeric.pyx":94 * (weight + 1) * DEC_DIGITS - (dweight + 1) * num_pgdigits = \ * (num_pydigits + padding_size + DEC_DIGITS - 1) // DEC_DIGITS # <<<<<<<<<<<<<< * * if num_pgdigits > 2 ** 16 - 1: */ __pyx_v_num_pgdigits = __Pyx_div_int64_t((((__pyx_v_num_pydigits + __pyx_v_padding_size) + 4) - 1), 4); /* "asyncpg/protocol/codecs/numeric.pyx":96 * (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_3 = ((__pyx_v_num_pgdigits > 0xFFFF) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/numeric.pyx":97 * * if num_pgdigits > 2 ** 16 - 1: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'number of digits is too large') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 97, __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, 97, __pyx_L1_error) /* "asyncpg/protocol/codecs/numeric.pyx":96 * (num_pydigits + padding_size + DEC_DIGITS - 1) // DEC_DIGITS * * if num_pgdigits > 2 ** 16 - 1: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ } /* "asyncpg/protocol/codecs/numeric.pyx":103 * # Pad decimal digits to provide room for correct Postgres * # digit alignment in the digit computation loop. * pydigits = (0,) * DEC_DIGITS + pydigits + (0,) * DEC_DIGITS # <<<<<<<<<<<<<< * * if exponent < 0: */ __pyx_t_1 = PyNumber_Add(__pyx_tuple__54, __pyx_v_pydigits); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_tuple__55); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 103, __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/protocol/codecs/numeric.pyx":105 * pydigits = (0,) * DEC_DIGITS + pydigits + (0,) * DEC_DIGITS * * if exponent < 0: # <<<<<<<<<<<<<< * if -exponent > MAX_DSCALE: * raise ValueError( */ __pyx_t_3 = ((__pyx_v_exponent < 0) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/numeric.pyx":106 * * if exponent < 0: * if -exponent > MAX_DSCALE: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ __pyx_t_3 = (((-__pyx_v_exponent) > 0x3FFF) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/numeric.pyx":107 * if exponent < 0: * if -exponent > MAX_DSCALE: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too small') */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 107, __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, 107, __pyx_L1_error) /* "asyncpg/protocol/codecs/numeric.pyx":106 * * if exponent < 0: * if -exponent > MAX_DSCALE: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ } /* "asyncpg/protocol/codecs/numeric.pyx":110 * 'cannot encode Decimal value into numeric: ' * 'exponent is too small') * dscale = -exponent # <<<<<<<<<<<<<< * else: * dscale = 0 */ __pyx_v_dscale = ((int16_t)(-__pyx_v_exponent)); /* "asyncpg/protocol/codecs/numeric.pyx":105 * pydigits = (0,) * DEC_DIGITS + pydigits + (0,) * DEC_DIGITS * * if exponent < 0: # <<<<<<<<<<<<<< * if -exponent > MAX_DSCALE: * raise ValueError( */ goto __pyx_L15; } /* "asyncpg/protocol/codecs/numeric.pyx":112 * dscale = -exponent * else: * dscale = 0 # <<<<<<<<<<<<<< * * buf.write_int32(2 + 2 + 2 + 2 + 2 * num_pgdigits) */ /*else*/ { __pyx_v_dscale = 0; } __pyx_L15:; } __pyx_L5:; /* "asyncpg/protocol/codecs/numeric.pyx":114 * 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_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, (8 + (2 * ((uint16_t)__pyx_v_num_pgdigits)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":115 * * 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_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_num_pgdigits)); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":116 * 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_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_weight)); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":117 * buf.write_int16(num_pgdigits) * buf.write_int16(weight) * buf.write_int16(sign) # <<<<<<<<<<<<<< * buf.write_int16(dscale) * */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_sign)); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":118 * buf.write_int16(weight) * buf.write_int16(sign) * buf.write_int16(dscale) # <<<<<<<<<<<<<< * * j = DEC_DIGITS - padding_size */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_buf, __pyx_v_dscale); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":120 * buf.write_int16(dscale) * * j = DEC_DIGITS - padding_size # <<<<<<<<<<<<<< * * for i in range(num_pgdigits): */ __pyx_v_j = (4 - __pyx_v_padding_size); /* "asyncpg/protocol/codecs/numeric.pyx":122 * 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; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_7; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; /* "asyncpg/protocol/codecs/numeric.pyx":123 * * 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, 123, __pyx_L1_error) } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_v_j, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 123, __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, 123, __pyx_L1_error) } __pyx_t_10 = (__pyx_v_j + 1); __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_t_10, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_int_100); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":124 * 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, 124, __pyx_L1_error) } __pyx_t_10 = (__pyx_v_j + 2); __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_t_10, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Multiply(__pyx_t_6, __pyx_int_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":123 * * 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_6 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":124 * 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, 124, __pyx_L1_error) } __pyx_t_10 = (__pyx_v_j + 3); __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_t_10, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_t_4); if (unlikely((__pyx_t_11 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(18, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_pgdigit = __pyx_t_11; /* "asyncpg/protocol/codecs/numeric.pyx":125 * 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/protocol/codecs/numeric.pyx":126 * pydigits[j + 2] * 10 + pydigits[j + 3]) * j += DEC_DIGITS * buf.write_int16(pgdigit) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_buf, __pyx_v_pgdigit); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/codecs/numeric.pyx":33 * * * cdef numeric_encode_binary(ConnectionSettings 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_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.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/protocol/codecs/numeric.pyx":134 * # than the simple text decoder above. That said, we need the binary * # decoder to support binary COPY with numeric values. * cdef numeric_decode_binary(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * uint16_t num_pgdigits = hton.unpack_int16(buf.read(2)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_numeric_decode_binary(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { 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_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; CYTHON_UNUSED Py_ssize_t __pyx_v_trailing_padding; Py_ssize_t __pyx_v_num_fract_digits; Py_ssize_t __pyx_v_dscale_left; char __pyx_v_smallbuf[0x100]; char *__pyx_v_charbuf; char *__pyx_v_bufptr; int __pyx_v_buf_allocated; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int64_t __pyx_t_6; uint16_t __pyx_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; char const *__pyx_t_13; 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; PyObject *__pyx_t_19 = NULL; __Pyx_RefNannySetupContext("numeric_decode_binary", 0); /* "asyncpg/protocol/codecs/numeric.pyx":136 * cdef numeric_decode_binary(ConnectionSettings settings, FastReadBuffer buf): * cdef: * uint16_t num_pgdigits = hton.unpack_int16(buf.read(2)) # <<<<<<<<<<<<<< * int16_t weight = hton.unpack_int16(buf.read(2)) * uint16_t sign = hton.unpack_int16(buf.read(2)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 136, __pyx_L1_error) __pyx_v_num_pgdigits = ((uint16_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int16(__pyx_t_1)); /* "asyncpg/protocol/codecs/numeric.pyx":137 * cdef: * uint16_t num_pgdigits = hton.unpack_int16(buf.read(2)) * int16_t weight = hton.unpack_int16(buf.read(2)) # <<<<<<<<<<<<<< * uint16_t sign = hton.unpack_int16(buf.read(2)) * uint16_t dscale = hton.unpack_int16(buf.read(2)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 137, __pyx_L1_error) __pyx_v_weight = __pyx_f_7asyncpg_8protocol_4hton_unpack_int16(__pyx_t_1); /* "asyncpg/protocol/codecs/numeric.pyx":138 * uint16_t num_pgdigits = hton.unpack_int16(buf.read(2)) * int16_t weight = hton.unpack_int16(buf.read(2)) * uint16_t sign = hton.unpack_int16(buf.read(2)) # <<<<<<<<<<<<<< * uint16_t dscale = hton.unpack_int16(buf.read(2)) * int16_t pgdigit0 */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 138, __pyx_L1_error) __pyx_v_sign = ((uint16_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int16(__pyx_t_1)); /* "asyncpg/protocol/codecs/numeric.pyx":139 * int16_t weight = hton.unpack_int16(buf.read(2)) * uint16_t sign = hton.unpack_int16(buf.read(2)) * uint16_t dscale = hton.unpack_int16(buf.read(2)) # <<<<<<<<<<<<<< * int16_t pgdigit0 * ssize_t i */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 139, __pyx_L1_error) __pyx_v_dscale = ((uint16_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int16(__pyx_t_1)); /* "asyncpg/protocol/codecs/numeric.pyx":149 * int64_t abs_exponent * ssize_t exponent_chars * ssize_t front_padding = 0 # <<<<<<<<<<<<<< * ssize_t trailing_padding = 0 * ssize_t num_fract_digits */ __pyx_v_front_padding = 0; /* "asyncpg/protocol/codecs/numeric.pyx":150 * ssize_t exponent_chars * ssize_t front_padding = 0 * ssize_t trailing_padding = 0 # <<<<<<<<<<<<<< * ssize_t num_fract_digits * ssize_t dscale_left */ __pyx_v_trailing_padding = 0; /* "asyncpg/protocol/codecs/numeric.pyx":156 * char *charbuf * char *bufptr * bint buf_allocated = False # <<<<<<<<<<<<<< * * if sign == NUMERIC_NAN: */ __pyx_v_buf_allocated = 0; /* "asyncpg/protocol/codecs/numeric.pyx":158 * bint buf_allocated = False * * if sign == NUMERIC_NAN: # <<<<<<<<<<<<<< * # Not-a-number * return _Dec('NaN') */ __pyx_t_2 = ((__pyx_v_sign == 0xC000) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":160 * if sign == NUMERIC_NAN: * # Not-a-number * return _Dec('NaN') # <<<<<<<<<<<<<< * * if num_pgdigits == 0: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Dec); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/numeric.pyx":158 * bint buf_allocated = False * * if sign == NUMERIC_NAN: # <<<<<<<<<<<<<< * # Not-a-number * return _Dec('NaN') */ } /* "asyncpg/protocol/codecs/numeric.pyx":162 * return _Dec('NaN') * * if num_pgdigits == 0: # <<<<<<<<<<<<<< * # Zero * return _Dec() */ __pyx_t_2 = ((__pyx_v_num_pgdigits == 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":164 * if num_pgdigits == 0: * # Zero * return _Dec() # <<<<<<<<<<<<<< * * pgdigit0 = hton.unpack_int16(buf.read(2)) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Dec); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 164, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/numeric.pyx":162 * return _Dec('NaN') * * if num_pgdigits == 0: # <<<<<<<<<<<<<< * # Zero * return _Dec() */ } /* "asyncpg/protocol/codecs/numeric.pyx":166 * return _Dec() * * pgdigit0 = hton.unpack_int16(buf.read(2)) # <<<<<<<<<<<<<< * if weight >= 0: * if pgdigit0 < 10: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 166, __pyx_L1_error) __pyx_v_pgdigit0 = __pyx_f_7asyncpg_8protocol_4hton_unpack_int16(__pyx_t_1); /* "asyncpg/protocol/codecs/numeric.pyx":167 * * pgdigit0 = hton.unpack_int16(buf.read(2)) * if weight >= 0: # <<<<<<<<<<<<<< * if pgdigit0 < 10: * front_padding = 3 */ __pyx_t_2 = ((__pyx_v_weight >= 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":168 * pgdigit0 = hton.unpack_int16(buf.read(2)) * if weight >= 0: * if pgdigit0 < 10: # <<<<<<<<<<<<<< * front_padding = 3 * elif pgdigit0 < 100: */ __pyx_t_2 = ((__pyx_v_pgdigit0 < 10) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":169 * if weight >= 0: * if pgdigit0 < 10: * front_padding = 3 # <<<<<<<<<<<<<< * elif pgdigit0 < 100: * front_padding = 2 */ __pyx_v_front_padding = 3; /* "asyncpg/protocol/codecs/numeric.pyx":168 * pgdigit0 = hton.unpack_int16(buf.read(2)) * if weight >= 0: * if pgdigit0 < 10: # <<<<<<<<<<<<<< * front_padding = 3 * elif pgdigit0 < 100: */ goto __pyx_L6; } /* "asyncpg/protocol/codecs/numeric.pyx":170 * if pgdigit0 < 10: * front_padding = 3 * elif pgdigit0 < 100: # <<<<<<<<<<<<<< * front_padding = 2 * elif pgdigit0 < 1000: */ __pyx_t_2 = ((__pyx_v_pgdigit0 < 0x64) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":171 * front_padding = 3 * elif pgdigit0 < 100: * front_padding = 2 # <<<<<<<<<<<<<< * elif pgdigit0 < 1000: * front_padding = 1 */ __pyx_v_front_padding = 2; /* "asyncpg/protocol/codecs/numeric.pyx":170 * if pgdigit0 < 10: * front_padding = 3 * elif pgdigit0 < 100: # <<<<<<<<<<<<<< * front_padding = 2 * elif pgdigit0 < 1000: */ goto __pyx_L6; } /* "asyncpg/protocol/codecs/numeric.pyx":172 * elif pgdigit0 < 100: * front_padding = 2 * elif pgdigit0 < 1000: # <<<<<<<<<<<<<< * front_padding = 1 * */ __pyx_t_2 = ((__pyx_v_pgdigit0 < 0x3E8) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":173 * front_padding = 2 * elif pgdigit0 < 1000: * front_padding = 1 # <<<<<<<<<<<<<< * * # Maximum possible number of decimal digits in base 10. */ __pyx_v_front_padding = 1; /* "asyncpg/protocol/codecs/numeric.pyx":172 * elif pgdigit0 < 100: * front_padding = 2 * elif pgdigit0 < 1000: # <<<<<<<<<<<<<< * front_padding = 1 * */ } __pyx_L6:; /* "asyncpg/protocol/codecs/numeric.pyx":167 * * pgdigit0 = hton.unpack_int16(buf.read(2)) * if weight >= 0: # <<<<<<<<<<<<<< * if pgdigit0 < 10: * front_padding = 3 */ } /* "asyncpg/protocol/codecs/numeric.pyx":176 * * # Maximum possible number of decimal digits in base 10. * num_pydigits = num_pgdigits * DEC_DIGITS + dscale # <<<<<<<<<<<<<< * # Exponent. * exponent = (weight + 1) * DEC_DIGITS - front_padding */ __pyx_v_num_pydigits = ((__pyx_v_num_pgdigits * 4) + __pyx_v_dscale); /* "asyncpg/protocol/codecs/numeric.pyx":178 * num_pydigits = num_pgdigits * DEC_DIGITS + dscale * # Exponent. * exponent = (weight + 1) * DEC_DIGITS - front_padding # <<<<<<<<<<<<<< * abs_exponent = abs(exponent) * # Number of characters required to render absolute exponent value. */ __pyx_v_exponent = (((__pyx_v_weight + 1) * 4) - __pyx_v_front_padding); /* "asyncpg/protocol/codecs/numeric.pyx":179 * # Exponent. * exponent = (weight + 1) * DEC_DIGITS - front_padding * abs_exponent = abs(exponent) # <<<<<<<<<<<<<< * # Number of characters required to render absolute exponent value. * exponent_chars = log10(abs_exponent) + 1 */ __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_exponent); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(18, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_abs_exponent = __pyx_t_6; /* "asyncpg/protocol/codecs/numeric.pyx":181 * abs_exponent = abs(exponent) * # Number of characters required to render absolute exponent value. * exponent_chars = log10(abs_exponent) + 1 # <<<<<<<<<<<<<< * * buf_size = ( */ __pyx_v_exponent_chars = (((Py_ssize_t)log10(((double)__pyx_v_abs_exponent))) + 1); /* "asyncpg/protocol/codecs/numeric.pyx":189 * num_pydigits + # digits * 2 + # exponent indicator (E-,E+) * exponent_chars + # exponent # <<<<<<<<<<<<<< * 1 # null terminator char * ) */ __pyx_v_buf_size = ((((3 + __pyx_v_num_pydigits) + 2) + __pyx_v_exponent_chars) + 1); /* "asyncpg/protocol/codecs/numeric.pyx":193 * ) * * if buf_size > _NUMERIC_DECODER_SMALLBUF_SIZE: # <<<<<<<<<<<<<< * charbuf = PyMem_Malloc(buf_size) * buf_allocated = True */ __pyx_t_2 = ((__pyx_v_buf_size > 0x100) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":194 * * if buf_size > _NUMERIC_DECODER_SMALLBUF_SIZE: * charbuf = PyMem_Malloc(buf_size) # <<<<<<<<<<<<<< * buf_allocated = True * else: */ __pyx_v_charbuf = ((char *)PyMem_Malloc(((size_t)__pyx_v_buf_size))); /* "asyncpg/protocol/codecs/numeric.pyx":195 * if buf_size > _NUMERIC_DECODER_SMALLBUF_SIZE: * charbuf = PyMem_Malloc(buf_size) * buf_allocated = True # <<<<<<<<<<<<<< * else: * charbuf = smallbuf */ __pyx_v_buf_allocated = 1; /* "asyncpg/protocol/codecs/numeric.pyx":193 * ) * * if buf_size > _NUMERIC_DECODER_SMALLBUF_SIZE: # <<<<<<<<<<<<<< * charbuf = PyMem_Malloc(buf_size) * buf_allocated = True */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/numeric.pyx":197 * buf_allocated = True * else: * charbuf = smallbuf # <<<<<<<<<<<<<< * * try: */ /*else*/ { __pyx_v_charbuf = __pyx_v_smallbuf; } __pyx_L7:; /* "asyncpg/protocol/codecs/numeric.pyx":199 * charbuf = smallbuf * * try: # <<<<<<<<<<<<<< * bufptr = charbuf * */ /*try:*/ { /* "asyncpg/protocol/codecs/numeric.pyx":200 * * try: * bufptr = charbuf # <<<<<<<<<<<<<< * * if sign == NUMERIC_NEG: */ __pyx_v_bufptr = __pyx_v_charbuf; /* "asyncpg/protocol/codecs/numeric.pyx":202 * bufptr = charbuf * * if sign == NUMERIC_NEG: # <<<<<<<<<<<<<< * bufptr[0] = b'-' * bufptr += 1 */ __pyx_t_2 = ((__pyx_v_sign == 0x4000) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":203 * * if sign == NUMERIC_NEG: * bufptr[0] = b'-' # <<<<<<<<<<<<<< * bufptr += 1 * */ (__pyx_v_bufptr[0]) = '-'; /* "asyncpg/protocol/codecs/numeric.pyx":204 * if sign == NUMERIC_NEG: * bufptr[0] = b'-' * bufptr += 1 # <<<<<<<<<<<<<< * * bufptr[0] = b'0' */ __pyx_v_bufptr = (__pyx_v_bufptr + 1); /* "asyncpg/protocol/codecs/numeric.pyx":202 * bufptr = charbuf * * if sign == NUMERIC_NEG: # <<<<<<<<<<<<<< * bufptr[0] = b'-' * bufptr += 1 */ } /* "asyncpg/protocol/codecs/numeric.pyx":206 * bufptr += 1 * * bufptr[0] = b'0' # <<<<<<<<<<<<<< * bufptr[1] = b'.' * bufptr += 2 */ (__pyx_v_bufptr[0]) = '0'; /* "asyncpg/protocol/codecs/numeric.pyx":207 * * bufptr[0] = b'0' * bufptr[1] = b'.' # <<<<<<<<<<<<<< * bufptr += 2 * */ (__pyx_v_bufptr[1]) = '.'; /* "asyncpg/protocol/codecs/numeric.pyx":208 * bufptr[0] = b'0' * bufptr[1] = b'.' * bufptr += 2 # <<<<<<<<<<<<<< * * if weight >= 0: */ __pyx_v_bufptr = (__pyx_v_bufptr + 2); /* "asyncpg/protocol/codecs/numeric.pyx":210 * bufptr += 2 * * if weight >= 0: # <<<<<<<<<<<<<< * bufptr = _unpack_digit_stripping_lzeros(bufptr, pgdigit0) * else: */ __pyx_t_2 = ((__pyx_v_weight >= 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":211 * * if weight >= 0: * bufptr = _unpack_digit_stripping_lzeros(bufptr, pgdigit0) # <<<<<<<<<<<<<< * else: * bufptr = _unpack_digit(bufptr, pgdigit0) */ __pyx_v_bufptr = __pyx_f_7asyncpg_8protocol_8protocol__unpack_digit_stripping_lzeros(__pyx_v_bufptr, __pyx_v_pgdigit0); /* "asyncpg/protocol/codecs/numeric.pyx":210 * bufptr += 2 * * if weight >= 0: # <<<<<<<<<<<<<< * bufptr = _unpack_digit_stripping_lzeros(bufptr, pgdigit0) * else: */ goto __pyx_L12; } /* "asyncpg/protocol/codecs/numeric.pyx":213 * bufptr = _unpack_digit_stripping_lzeros(bufptr, pgdigit0) * else: * bufptr = _unpack_digit(bufptr, pgdigit0) # <<<<<<<<<<<<<< * * for i in range(1, num_pgdigits): */ /*else*/ { __pyx_v_bufptr = __pyx_f_7asyncpg_8protocol_8protocol__unpack_digit(__pyx_v_bufptr, __pyx_v_pgdigit0); } __pyx_L12:; /* "asyncpg/protocol/codecs/numeric.pyx":215 * bufptr = _unpack_digit(bufptr, pgdigit0) * * for i in range(1, num_pgdigits): # <<<<<<<<<<<<<< * pgdigit = hton.unpack_int16(buf.read(2)) * bufptr = _unpack_digit(bufptr, pgdigit) */ __pyx_t_7 = __pyx_v_num_pgdigits; for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "asyncpg/protocol/codecs/numeric.pyx":216 * * for i in range(1, num_pgdigits): * pgdigit = hton.unpack_int16(buf.read(2)) # <<<<<<<<<<<<<< * bufptr = _unpack_digit(bufptr, pgdigit) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 216, __pyx_L9_error) __pyx_v_pgdigit = __pyx_f_7asyncpg_8protocol_4hton_unpack_int16(__pyx_t_1); /* "asyncpg/protocol/codecs/numeric.pyx":217 * for i in range(1, num_pgdigits): * pgdigit = hton.unpack_int16(buf.read(2)) * bufptr = _unpack_digit(bufptr, pgdigit) # <<<<<<<<<<<<<< * * if dscale: */ __pyx_v_bufptr = __pyx_f_7asyncpg_8protocol_8protocol__unpack_digit(__pyx_v_bufptr, __pyx_v_pgdigit); } /* "asyncpg/protocol/codecs/numeric.pyx":219 * bufptr = _unpack_digit(bufptr, pgdigit) * * if dscale: # <<<<<<<<<<<<<< * if weight >= 0: * num_fract_digits = num_pgdigits - weight - 1 */ __pyx_t_2 = (__pyx_v_dscale != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":220 * * if dscale: * if weight >= 0: # <<<<<<<<<<<<<< * num_fract_digits = num_pgdigits - weight - 1 * else: */ __pyx_t_2 = ((__pyx_v_weight >= 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":221 * if dscale: * if weight >= 0: * num_fract_digits = num_pgdigits - weight - 1 # <<<<<<<<<<<<<< * else: * num_fract_digits = num_pgdigits */ __pyx_v_num_fract_digits = ((__pyx_v_num_pgdigits - __pyx_v_weight) - 1); /* "asyncpg/protocol/codecs/numeric.pyx":220 * * if dscale: * if weight >= 0: # <<<<<<<<<<<<<< * num_fract_digits = num_pgdigits - weight - 1 * else: */ goto __pyx_L16; } /* "asyncpg/protocol/codecs/numeric.pyx":223 * num_fract_digits = num_pgdigits - weight - 1 * else: * num_fract_digits = num_pgdigits # <<<<<<<<<<<<<< * * # Check how much dscale is left to render (trailing zeros). */ /*else*/ { __pyx_v_num_fract_digits = __pyx_v_num_pgdigits; } __pyx_L16:; /* "asyncpg/protocol/codecs/numeric.pyx":226 * * # Check how much dscale is left to render (trailing zeros). * dscale_left = dscale - num_fract_digits * DEC_DIGITS # <<<<<<<<<<<<<< * if dscale_left > 0: * for i in range(dscale_left): */ __pyx_v_dscale_left = (__pyx_v_dscale - (__pyx_v_num_fract_digits * 4)); /* "asyncpg/protocol/codecs/numeric.pyx":227 * # Check how much dscale is left to render (trailing zeros). * dscale_left = dscale - num_fract_digits * DEC_DIGITS * if dscale_left > 0: # <<<<<<<<<<<<<< * for i in range(dscale_left): * bufptr[i] = b'0' */ __pyx_t_2 = ((__pyx_v_dscale_left > 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":228 * dscale_left = dscale - num_fract_digits * DEC_DIGITS * if dscale_left > 0: * for i in range(dscale_left): # <<<<<<<<<<<<<< * bufptr[i] = b'0' * */ __pyx_t_8 = __pyx_v_dscale_left; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; /* "asyncpg/protocol/codecs/numeric.pyx":229 * if dscale_left > 0: * for i in range(dscale_left): * bufptr[i] = b'0' # <<<<<<<<<<<<<< * * # If display scale is _less_ than the number of rendered digits, */ (__pyx_v_bufptr[__pyx_v_i]) = ((char)'0'); } /* "asyncpg/protocol/codecs/numeric.pyx":227 * # Check how much dscale is left to render (trailing zeros). * dscale_left = dscale - num_fract_digits * DEC_DIGITS * if dscale_left > 0: # <<<<<<<<<<<<<< * for i in range(dscale_left): * bufptr[i] = b'0' */ } /* "asyncpg/protocol/codecs/numeric.pyx":234 * # dscale_left will be negative and this will strip the excess * # trailing zeros. * bufptr += dscale_left # <<<<<<<<<<<<<< * * if exponent != 0: */ __pyx_v_bufptr = (__pyx_v_bufptr + __pyx_v_dscale_left); /* "asyncpg/protocol/codecs/numeric.pyx":219 * bufptr = _unpack_digit(bufptr, pgdigit) * * if dscale: # <<<<<<<<<<<<<< * if weight >= 0: * num_fract_digits = num_pgdigits - weight - 1 */ } /* "asyncpg/protocol/codecs/numeric.pyx":236 * bufptr += dscale_left * * if exponent != 0: # <<<<<<<<<<<<<< * bufptr[0] = b'E' * if exponent < 0: */ __pyx_t_2 = ((__pyx_v_exponent != 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":237 * * if exponent != 0: * bufptr[0] = b'E' # <<<<<<<<<<<<<< * if exponent < 0: * bufptr[1] = b'-' */ (__pyx_v_bufptr[0]) = 'E'; /* "asyncpg/protocol/codecs/numeric.pyx":238 * if exponent != 0: * bufptr[0] = b'E' * if exponent < 0: # <<<<<<<<<<<<<< * bufptr[1] = b'-' * else: */ __pyx_t_2 = ((__pyx_v_exponent < 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":239 * bufptr[0] = b'E' * if exponent < 0: * bufptr[1] = b'-' # <<<<<<<<<<<<<< * else: * bufptr[1] = b'+' */ (__pyx_v_bufptr[1]) = '-'; /* "asyncpg/protocol/codecs/numeric.pyx":238 * if exponent != 0: * bufptr[0] = b'E' * if exponent < 0: # <<<<<<<<<<<<<< * bufptr[1] = b'-' * else: */ goto __pyx_L21; } /* "asyncpg/protocol/codecs/numeric.pyx":241 * bufptr[1] = b'-' * else: * bufptr[1] = b'+' # <<<<<<<<<<<<<< * bufptr += 2 * snprintf(bufptr, exponent_chars + 1, '%d', */ /*else*/ { (__pyx_v_bufptr[1]) = '+'; } __pyx_L21:; /* "asyncpg/protocol/codecs/numeric.pyx":242 * else: * bufptr[1] = b'+' * bufptr += 2 # <<<<<<<<<<<<<< * snprintf(bufptr, exponent_chars + 1, '%d', * abs_exponent) */ __pyx_v_bufptr = (__pyx_v_bufptr + 2); /* "asyncpg/protocol/codecs/numeric.pyx":243 * bufptr[1] = b'+' * bufptr += 2 * snprintf(bufptr, exponent_chars + 1, '%d', # <<<<<<<<<<<<<< * abs_exponent) * bufptr += exponent_chars */ snprintf(__pyx_v_bufptr, (((size_t)__pyx_v_exponent_chars) + 1), ((char const *)"%d"), ((int)__pyx_v_abs_exponent)); /* "asyncpg/protocol/codecs/numeric.pyx":245 * 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/protocol/codecs/numeric.pyx":236 * bufptr += dscale_left * * if exponent != 0: # <<<<<<<<<<<<<< * bufptr[0] = b'E' * if exponent < 0: */ } /* "asyncpg/protocol/codecs/numeric.pyx":247 * bufptr += exponent_chars * * bufptr[0] = 0 # <<<<<<<<<<<<<< * * pydigits = python.PyUnicode_FromString(charbuf) */ (__pyx_v_bufptr[0]) = 0; /* "asyncpg/protocol/codecs/numeric.pyx":249 * bufptr[0] = 0 * * pydigits = python.PyUnicode_FromString(charbuf) # <<<<<<<<<<<<<< * * return _Dec(pydigits) */ __pyx_t_3 = PyUnicode_FromString(__pyx_v_charbuf); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 249, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_pydigits = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":251 * pydigits = python.PyUnicode_FromString(charbuf) * * return _Dec(pydigits) # <<<<<<<<<<<<<< * * finally: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Dec); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 251, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_pydigits); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 251, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_pydigits}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 251, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_pydigits}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 251, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(18, 251, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_pydigits); __Pyx_GIVEREF(__pyx_v_pydigits); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_pydigits); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 251, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L8_return; } /* "asyncpg/protocol/codecs/numeric.pyx":254 * * finally: * if buf_allocated: # <<<<<<<<<<<<<< * PyMem_Free(charbuf) * */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L9_error:; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __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_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; { __pyx_t_2 = (__pyx_v_buf_allocated != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":255 * finally: * if buf_allocated: * PyMem_Free(charbuf) # <<<<<<<<<<<<<< * * */ PyMem_Free(__pyx_v_charbuf); /* "asyncpg/protocol/codecs/numeric.pyx":254 * * finally: * if buf_allocated: # <<<<<<<<<<<<<< * PyMem_Free(charbuf) * */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; goto __pyx_L1_error; } __pyx_L8_return: { __pyx_t_19 = __pyx_r; __pyx_r = 0; __pyx_t_2 = (__pyx_v_buf_allocated != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/numeric.pyx":255 * finally: * if buf_allocated: * PyMem_Free(charbuf) # <<<<<<<<<<<<<< * * */ PyMem_Free(__pyx_v_charbuf); /* "asyncpg/protocol/codecs/numeric.pyx":254 * * finally: * if buf_allocated: # <<<<<<<<<<<<<< * PyMem_Free(charbuf) * */ } __pyx_r = __pyx_t_19; __pyx_t_19 = 0; goto __pyx_L0; } } /* "asyncpg/protocol/codecs/numeric.pyx":134 * # than the simple text decoder above. That said, we need the binary * # decoder to support binary COPY with numeric values. * cdef numeric_decode_binary(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * uint16_t num_pgdigits = hton.unpack_int16(buf.read(2)) */ /* 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_10); __Pyx_AddTraceback("asyncpg.protocol.protocol.numeric_decode_binary", __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/protocol/codecs/numeric.pyx":258 * * * cdef inline char *_unpack_digit_stripping_lzeros(char *buf, int64_t pgdigit): # <<<<<<<<<<<<<< * cdef: * int64_t d */ static CYTHON_INLINE char *__pyx_f_7asyncpg_8protocol_8protocol__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; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("_unpack_digit_stripping_lzeros", 0); /* "asyncpg/protocol/codecs/numeric.pyx":263 * bint significant * * d = pgdigit // 1000 # <<<<<<<<<<<<<< * significant = (d > 0) * if significant: */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 0x3E8); /* "asyncpg/protocol/codecs/numeric.pyx":264 * * d = pgdigit // 1000 * significant = (d > 0) # <<<<<<<<<<<<<< * if significant: * pgdigit -= d * 1000 */ __pyx_v_significant = (__pyx_v_d > 0); /* "asyncpg/protocol/codecs/numeric.pyx":265 * d = pgdigit // 1000 * significant = (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 1000 * buf[0] = (d + b'0') */ __pyx_t_1 = (__pyx_v_significant != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/numeric.pyx":266 * 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/protocol/codecs/numeric.pyx":267 * if significant: * pgdigit -= d * 1000 * buf[0] = (d + b'0') # <<<<<<<<<<<<<< * buf += 1 * */ (__pyx_v_buf[0]) = ((char)(__pyx_v_d + ((int32_t)'0'))); /* "asyncpg/protocol/codecs/numeric.pyx":268 * pgdigit -= d * 1000 * buf[0] = (d + b'0') * buf += 1 # <<<<<<<<<<<<<< * * d = pgdigit // 100 */ __pyx_v_buf = (__pyx_v_buf + 1); /* "asyncpg/protocol/codecs/numeric.pyx":265 * d = pgdigit // 1000 * significant = (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 1000 * buf[0] = (d + b'0') */ } /* "asyncpg/protocol/codecs/numeric.pyx":270 * buf += 1 * * d = pgdigit // 100 # <<<<<<<<<<<<<< * significant |= (d > 0) * if significant: */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 0x64); /* "asyncpg/protocol/codecs/numeric.pyx":271 * * d = pgdigit // 100 * significant |= (d > 0) # <<<<<<<<<<<<<< * if significant: * pgdigit -= d * 100 */ __pyx_v_significant = (__pyx_v_significant | (__pyx_v_d > 0)); /* "asyncpg/protocol/codecs/numeric.pyx":272 * d = pgdigit // 100 * significant |= (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 100 * buf[0] = (d + b'0') */ __pyx_t_1 = (__pyx_v_significant != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/numeric.pyx":273 * 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/protocol/codecs/numeric.pyx":274 * if significant: * pgdigit -= d * 100 * buf[0] = (d + b'0') # <<<<<<<<<<<<<< * buf += 1 * */ (__pyx_v_buf[0]) = ((char)(__pyx_v_d + ((int32_t)'0'))); /* "asyncpg/protocol/codecs/numeric.pyx":275 * pgdigit -= d * 100 * buf[0] = (d + b'0') * buf += 1 # <<<<<<<<<<<<<< * * d = pgdigit // 10 */ __pyx_v_buf = (__pyx_v_buf + 1); /* "asyncpg/protocol/codecs/numeric.pyx":272 * d = pgdigit // 100 * significant |= (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 100 * buf[0] = (d + b'0') */ } /* "asyncpg/protocol/codecs/numeric.pyx":277 * buf += 1 * * d = pgdigit // 10 # <<<<<<<<<<<<<< * significant |= (d > 0) * if significant: */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 10); /* "asyncpg/protocol/codecs/numeric.pyx":278 * * d = pgdigit // 10 * significant |= (d > 0) # <<<<<<<<<<<<<< * if significant: * pgdigit -= d * 10 */ __pyx_v_significant = (__pyx_v_significant | (__pyx_v_d > 0)); /* "asyncpg/protocol/codecs/numeric.pyx":279 * d = pgdigit // 10 * significant |= (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 10 * buf[0] = (d + b'0') */ __pyx_t_1 = (__pyx_v_significant != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/numeric.pyx":280 * 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/protocol/codecs/numeric.pyx":281 * if significant: * pgdigit -= d * 10 * buf[0] = (d + b'0') # <<<<<<<<<<<<<< * buf += 1 * */ (__pyx_v_buf[0]) = ((char)(__pyx_v_d + ((int32_t)'0'))); /* "asyncpg/protocol/codecs/numeric.pyx":282 * pgdigit -= d * 10 * buf[0] = (d + b'0') * buf += 1 # <<<<<<<<<<<<<< * * buf[0] = (pgdigit + b'0') */ __pyx_v_buf = (__pyx_v_buf + 1); /* "asyncpg/protocol/codecs/numeric.pyx":279 * d = pgdigit // 10 * significant |= (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 10 * buf[0] = (d + b'0') */ } /* "asyncpg/protocol/codecs/numeric.pyx":284 * buf += 1 * * buf[0] = (pgdigit + b'0') # <<<<<<<<<<<<<< * buf += 1 * */ (__pyx_v_buf[0]) = ((char)(__pyx_v_pgdigit + ((int32_t)'0'))); /* "asyncpg/protocol/codecs/numeric.pyx":285 * * buf[0] = (pgdigit + b'0') * buf += 1 # <<<<<<<<<<<<<< * * return buf */ __pyx_v_buf = (__pyx_v_buf + 1); /* "asyncpg/protocol/codecs/numeric.pyx":287 * buf += 1 * * return buf # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/protocol/codecs/numeric.pyx":258 * * * cdef inline char *_unpack_digit_stripping_lzeros(char *buf, int64_t pgdigit): # <<<<<<<<<<<<<< * cdef: * int64_t d */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/numeric.pyx":290 * * * cdef inline char *_unpack_digit(char *buf, int64_t pgdigit): # <<<<<<<<<<<<<< * cdef: * int64_t d */ static CYTHON_INLINE char *__pyx_f_7asyncpg_8protocol_8protocol__unpack_digit(char *__pyx_v_buf, int64_t __pyx_v_pgdigit) { int64_t __pyx_v_d; char *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_unpack_digit", 0); /* "asyncpg/protocol/codecs/numeric.pyx":294 * int64_t d * * d = pgdigit // 1000 # <<<<<<<<<<<<<< * pgdigit -= d * 1000 * buf[0] = (d + b'0') */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 0x3E8); /* "asyncpg/protocol/codecs/numeric.pyx":295 * * d = pgdigit // 1000 * pgdigit -= d * 1000 # <<<<<<<<<<<<<< * buf[0] = (d + b'0') * */ __pyx_v_pgdigit = (__pyx_v_pgdigit - (__pyx_v_d * 0x3E8)); /* "asyncpg/protocol/codecs/numeric.pyx":296 * 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/protocol/codecs/numeric.pyx":298 * buf[0] = (d + b'0') * * d = pgdigit // 100 # <<<<<<<<<<<<<< * pgdigit -= d * 100 * buf[1] = (d + b'0') */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 0x64); /* "asyncpg/protocol/codecs/numeric.pyx":299 * * d = pgdigit // 100 * pgdigit -= d * 100 # <<<<<<<<<<<<<< * buf[1] = (d + b'0') * */ __pyx_v_pgdigit = (__pyx_v_pgdigit - (__pyx_v_d * 0x64)); /* "asyncpg/protocol/codecs/numeric.pyx":300 * 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/protocol/codecs/numeric.pyx":302 * buf[1] = (d + b'0') * * d = pgdigit // 10 # <<<<<<<<<<<<<< * pgdigit -= d * 10 * buf[2] = (d + b'0') */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 10); /* "asyncpg/protocol/codecs/numeric.pyx":303 * * d = pgdigit // 10 * pgdigit -= d * 10 # <<<<<<<<<<<<<< * buf[2] = (d + b'0') * */ __pyx_v_pgdigit = (__pyx_v_pgdigit - (__pyx_v_d * 10)); /* "asyncpg/protocol/codecs/numeric.pyx":304 * 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/protocol/codecs/numeric.pyx":306 * buf[2] = (d + b'0') * * buf[3] = (pgdigit + b'0') # <<<<<<<<<<<<<< * buf += 4 * */ (__pyx_v_buf[3]) = ((char)(__pyx_v_pgdigit + ((int32_t)'0'))); /* "asyncpg/protocol/codecs/numeric.pyx":307 * * buf[3] = (pgdigit + b'0') * buf += 4 # <<<<<<<<<<<<<< * * return buf */ __pyx_v_buf = (__pyx_v_buf + 4); /* "asyncpg/protocol/codecs/numeric.pyx":309 * buf += 4 * * return buf # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/protocol/codecs/numeric.pyx":290 * * * cdef inline char *_unpack_digit(char *buf, int64_t pgdigit): # <<<<<<<<<<<<<< * cdef: * int64_t d */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/numeric.pyx":312 * * * cdef init_numeric_codecs(): # <<<<<<<<<<<<<< * register_core_codec(NUMERICOID, * &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; __Pyx_RefNannySetupContext("init_numeric_codecs", 0); /* "asyncpg/protocol/codecs/numeric.pyx":313 * * cdef init_numeric_codecs(): * register_core_codec(NUMERICOID, # <<<<<<<<<<<<<< * &numeric_encode_text, * &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_8protocol_8protocol_numeric_encode_text)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_numeric_decode_text)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":318 * PG_FORMAT_TEXT) * * register_core_codec(NUMERICOID, # <<<<<<<<<<<<<< * &numeric_encode_binary, * &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_8protocol_8protocol_numeric_encode_binary)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_numeric_decode_binary)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":312 * * * cdef init_numeric_codecs(): # <<<<<<<<<<<<<< * register_core_codec(NUMERICOID, * &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/tsearch.pyx":8 * * * 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; __Pyx_RefNannySetupContext("init_tsearch_codecs", 0); /* "asyncpg/protocol/codecs/tsearch.pyx":9 * * cdef init_tsearch_codecs(): * ts_oids = [ # <<<<<<<<<<<<<< * TSQUERYOID, * TSVECTOROID, */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_3615); __Pyx_GIVEREF(__pyx_int_3615); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3615); __Pyx_INCREF(__pyx_int_3614); __Pyx_GIVEREF(__pyx_int_3614); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3614); __pyx_v_ts_oids = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/tsearch.pyx":14 * ] * * for oid in ts_oids: # <<<<<<<<<<<<<< * register_core_codec(oid, * &text_encode, */ __pyx_t_1 = __pyx_v_ts_oids; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(19, 14, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/tsearch.pyx":15 * * for oid in ts_oids: * register_core_codec(oid, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(19, 15, __pyx_L1_error) /* "asyncpg/protocol/codecs/tsearch.pyx":18 * &text_encode, * &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_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/tsearch.pyx":14 * ] * * for oid in ts_oids: # <<<<<<<<<<<<<< * register_core_codec(oid, * &text_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/tsearch.pyx":20 * PG_FORMAT_TEXT) * * register_core_codec(GTSVECTOROID, # <<<<<<<<<<<<<< * NULL, * &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_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/tsearch.pyx":8 * * * 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/txid.pyx":8 * * * cdef txid_snapshot_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * ssize_t nxip */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_txid_snapshot_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { Py_ssize_t __pyx_v_nxip; CYTHON_UNUSED int64_t __pyx_v_xmin; CYTHON_UNUSED int64_t __pyx_v_xmax; int __pyx_v_i; struct __pyx_obj_7asyncpg_8protocol_8protocol_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; Py_ssize_t __pyx_t_7; int64_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; int32_t __pyx_t_11; __Pyx_RefNannySetupContext("txid_snapshot_encode", 0); /* "asyncpg/protocol/codecs/txid.pyx":14 * int64_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_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xip_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/txid.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) != 0); 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) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/txid.pyx":18 * if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): * raise TypeError( * 'list or tuple expected (got type {})'.format(type(obj))) # <<<<<<<<<<<<<< * * if len(obj) != 3: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_list_or_tuple_expected_got_type, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_obj))}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 18, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_obj))}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 18, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_obj))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_obj))); PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)Py_TYPE(__pyx_v_obj))); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/txid.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 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(20, 17, __pyx_L1_error) /* "asyncpg/protocol/codecs/txid.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/protocol/codecs/txid.pyx":20 * 'list or tuple expected (got type {})'.format(type(obj))) * * if len(obj) != 3: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid number of elements in txid_snapshot tuple, expecting 4') */ __pyx_t_7 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(20, 20, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_7 != 3) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/txid.pyx":21 * * if len(obj) != 3: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid number of elements in txid_snapshot tuple, expecting 4') * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 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(20, 21, __pyx_L1_error) /* "asyncpg/protocol/codecs/txid.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/protocol/codecs/txid.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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(20, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nxip = __pyx_t_7; /* "asyncpg/protocol/codecs/txid.pyx":25 * * nxip = len(obj[2]) * if nxip > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('txid_snapshot value is too long') * */ __pyx_t_3 = ((__pyx_v_nxip > 0x7FFFFFFF) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/txid.pyx":26 * nxip = len(obj[2]) * if nxip > _MAXINT32: * raise ValueError('txid_snapshot value is too long') # <<<<<<<<<<<<<< * * xmin = obj[0] */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 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(20, 26, __pyx_L1_error) /* "asyncpg/protocol/codecs/txid.pyx":25 * * nxip = len(obj[2]) * if nxip > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('txid_snapshot value is too long') * */ } /* "asyncpg/protocol/codecs/txid.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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_xmin = __pyx_t_8; /* "asyncpg/protocol/codecs/txid.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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(20, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_xmax = __pyx_t_8; /* "asyncpg/protocol/codecs/txid.pyx":31 * xmax = obj[1] * * for i in range(nxip): # <<<<<<<<<<<<<< * xip_buf.write_int64(obj[2][i]) * */ __pyx_t_9 = __pyx_v_nxip; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; /* "asyncpg/protocol/codecs/txid.pyx":32 * * for i in range(nxip): * xip_buf.write_int64(obj[2][i]) # <<<<<<<<<<<<<< * * buf.write_int32(20 + xip_buf.len()) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(20, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_xip_buf, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/codecs/txid.pyx":34 * xip_buf.write_int64(obj[2][i]) * * buf.write_int32(20 + xip_buf.len()) # <<<<<<<<<<<<<< * * buf.write_int32(nxip) */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_len(__pyx_v_xip_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_20, __pyx_t_4, 20, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(20, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/txid.pyx":36 * buf.write_int32(20 + xip_buf.len()) * * buf.write_int32(nxip) # <<<<<<<<<<<<<< * buf.write_int64(obj[0]) * buf.write_int64(obj[1]) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_nxip)); 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/protocol/codecs/txid.pyx":37 * * buf.write_int32(nxip) * buf.write_int64(obj[0]) # <<<<<<<<<<<<<< * buf.write_int64(obj[1]) * buf.write_buffer(xip_buf) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(20, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/txid.pyx":38 * buf.write_int32(nxip) * buf.write_int64(obj[0]) * buf.write_int64(obj[1]) # <<<<<<<<<<<<<< * buf.write_buffer(xip_buf) * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(20, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/txid.pyx":39 * buf.write_int64(obj[0]) * buf.write_int64(obj[1]) * buf.write_buffer(xip_buf) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(__pyx_v_buf, __pyx_v_xip_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/txid.pyx":8 * * * cdef txid_snapshot_encode(ConnectionSettings 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.protocol.protocol.txid_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/protocol/codecs/txid.pyx":42 * * * cdef txid_snapshot_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t nxip */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_txid_snapshot_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { int32_t __pyx_v_nxip; int64_t __pyx_v_xmin; int64_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; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("txid_snapshot_decode", 0); /* "asyncpg/protocol/codecs/txid.pyx":51 * object xip * * nxip = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * xmin = hton.unpack_int64(buf.read(8)) * xmax = hton.unpack_int64(buf.read(8)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 51, __pyx_L1_error) __pyx_v_nxip = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/txid.pyx":52 * * nxip = hton.unpack_int32(buf.read(4)) * xmin = hton.unpack_int64(buf.read(8)) # <<<<<<<<<<<<<< * xmax = hton.unpack_int64(buf.read(8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 52, __pyx_L1_error) __pyx_v_xmin = __pyx_f_7asyncpg_8protocol_4hton_unpack_int64(__pyx_t_1); /* "asyncpg/protocol/codecs/txid.pyx":53 * nxip = hton.unpack_int32(buf.read(4)) * xmin = hton.unpack_int64(buf.read(8)) * xmax = hton.unpack_int64(buf.read(8)) # <<<<<<<<<<<<<< * * xip_tup = cpython.PyTuple_New(nxip) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 53, __pyx_L1_error) __pyx_v_xmax = __pyx_f_7asyncpg_8protocol_4hton_unpack_int64(__pyx_t_1); /* "asyncpg/protocol/codecs/txid.pyx":55 * xmax = hton.unpack_int64(buf.read(8)) * * xip_tup = cpython.PyTuple_New(nxip) # <<<<<<<<<<<<<< * for i in range(nxip): * xip = cpython.PyLong_FromLongLong(hton.unpack_int64(buf.read(8))) */ __pyx_t_2 = PyTuple_New(__pyx_v_nxip); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_xip_tup = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/txid.pyx":56 * * xip_tup = cpython.PyTuple_New(nxip) * for i in range(nxip): # <<<<<<<<<<<<<< * xip = cpython.PyLong_FromLongLong(hton.unpack_int64(buf.read(8))) * cpython.Py_INCREF(xip) */ __pyx_t_3 = __pyx_v_nxip; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "asyncpg/protocol/codecs/txid.pyx":57 * xip_tup = cpython.PyTuple_New(nxip) * for i in range(nxip): * xip = cpython.PyLong_FromLongLong(hton.unpack_int64(buf.read(8))) # <<<<<<<<<<<<<< * cpython.Py_INCREF(xip) * cpython.PyTuple_SET_ITEM(xip_tup, i, xip) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 57, __pyx_L1_error) __pyx_t_2 = PyLong_FromLongLong(__pyx_f_7asyncpg_8protocol_4hton_unpack_int64(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_xip, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/txid.pyx":58 * for i in range(nxip): * xip = cpython.PyLong_FromLongLong(hton.unpack_int64(buf.read(8))) * cpython.Py_INCREF(xip) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(xip_tup, i, xip) * */ Py_INCREF(__pyx_v_xip); /* "asyncpg/protocol/codecs/txid.pyx":59 * xip = cpython.PyLong_FromLongLong(hton.unpack_int64(buf.read(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/protocol/codecs/txid.pyx":61 * cpython.PyTuple_SET_ITEM(xip_tup, i, xip) * * return (xmin, xmax, xip_tup) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_xmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_xmax); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __Pyx_INCREF(__pyx_v_xip_tup); __Pyx_GIVEREF(__pyx_v_xip_tup); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_xip_tup); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/txid.pyx":42 * * * cdef txid_snapshot_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * int32_t nxip */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.txid_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; } /* "asyncpg/protocol/codecs/txid.pyx":64 * * * cdef init_txid_codecs(): # <<<<<<<<<<<<<< * register_core_codec(TXID_SNAPSHOTOID, * &txid_snapshot_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_txid_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_txid_codecs", 0); /* "asyncpg/protocol/codecs/txid.pyx":65 * * cdef init_txid_codecs(): * register_core_codec(TXID_SNAPSHOTOID, # <<<<<<<<<<<<<< * &txid_snapshot_encode, * &txid_snapshot_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xB9A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_txid_snapshot_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_txid_snapshot_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/txid.pyx":64 * * * cdef init_txid_codecs(): # <<<<<<<<<<<<<< * register_core_codec(TXID_SNAPSHOTOID, * &txid_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/uuid.pyx":14 * * * cdef uuid_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * if cpython.PyUnicode_Check(obj): * obj = _UUID(obj) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uuid_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_wbuf, 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; __Pyx_RefNannySetupContext("uuid_encode", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/protocol/codecs/uuid.pyx":15 * * cdef uuid_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * if cpython.PyUnicode_Check(obj): # <<<<<<<<<<<<<< * obj = _UUID(obj) * */ __pyx_t_1 = (PyUnicode_Check(__pyx_v_obj) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/uuid.pyx":16 * cdef uuid_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * if cpython.PyUnicode_Check(obj): * obj = _UUID(obj) # <<<<<<<<<<<<<< * * bytea_encode(settings, wbuf, obj.bytes) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_UUID); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_obj}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 16, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_obj}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 16, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_obj); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/uuid.pyx":15 * * cdef uuid_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): * if cpython.PyUnicode_Check(obj): # <<<<<<<<<<<<<< * obj = _UUID(obj) * */ } /* "asyncpg/protocol/codecs/uuid.pyx":18 * obj = _UUID(obj) * * bytea_encode(settings, wbuf, obj.bytes) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_bytea_encode(__pyx_v_settings, __pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 18, __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/codecs/uuid.pyx":14 * * * cdef uuid_encode(ConnectionSettings settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * if cpython.PyUnicode_Check(obj): * obj = _UUID(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_AddTraceback("asyncpg.protocol.protocol.uuid_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/protocol/codecs/uuid.pyx":21 * * * cdef uuid_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return _UUID(bytes=bytea_decode(settings, buf)) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uuid_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("uuid_decode", 0); /* "asyncpg/protocol/codecs/uuid.pyx":22 * * cdef uuid_decode(ConnectionSettings settings, FastReadBuffer buf): * return _UUID(bytes=bytea_decode(settings, buf)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UUID); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_bytea_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bytes, __pyx_t_3) < 0) __PYX_ERR(21, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/uuid.pyx":21 * * * cdef uuid_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return _UUID(bytes=bytea_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_AddTraceback("asyncpg.protocol.protocol.uuid_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/uuid.pyx":25 * * * cdef init_uuid_codecs(): # <<<<<<<<<<<<<< * register_core_codec(UUIDOID, * &uuid_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_uuid_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_uuid_codecs", 0); /* "asyncpg/protocol/codecs/uuid.pyx":26 * * cdef init_uuid_codecs(): * register_core_codec(UUIDOID, # <<<<<<<<<<<<<< * &uuid_encode, * &uuid_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xB86, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_uuid_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_uuid_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/uuid.pyx":25 * * * cdef init_uuid_codecs(): # <<<<<<<<<<<<<< * register_core_codec(UUIDOID, * &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/misc.pyx":8 * * * cdef void_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * # Void is zero bytes * buf.write_int32(0) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_void_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf, CYTHON_UNUSED PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("void_encode", 0); /* "asyncpg/protocol/codecs/misc.pyx":10 * cdef void_encode(ConnectionSettings settings, WriteBuffer buf, obj): * # Void is zero bytes * buf.write_int32(0) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_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/protocol/codecs/misc.pyx":8 * * * cdef void_encode(ConnectionSettings 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.protocol.protocol.void_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/misc.pyx":13 * * * cdef void_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * # Do nothing; void will be passed as NULL so this function * # will never be called. */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_void_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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/protocol/codecs/misc.pyx":19 * * * 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_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; __Pyx_RefNannySetupContext("init_pseudo_codecs", 0); /* "asyncpg/protocol/codecs/misc.pyx":21 * cdef init_pseudo_codecs(): * # Void type is returned by SELECT void_returning_function() * register_core_codec(VOIDOID, # <<<<<<<<<<<<<< * &void_encode, * &void_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x8E6, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_void_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_void_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":27 * * # Unknown type, always decoded as text * register_core_codec(UNKNOWNOID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2C1, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":33 * * # OID and friends * oid_types = [ # <<<<<<<<<<<<<< * OIDOID, TIDOID, XIDOID, CIDOID * ] */ __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_26); __Pyx_GIVEREF(__pyx_int_26); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_26); __Pyx_INCREF(__pyx_int_27); __Pyx_GIVEREF(__pyx_int_27); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_27); __Pyx_INCREF(__pyx_int_28); __Pyx_GIVEREF(__pyx_int_28); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_28); __Pyx_INCREF(__pyx_int_29); __Pyx_GIVEREF(__pyx_int_29); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_29); __pyx_v_oid_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":37 * ] * * for oid_type in oid_types: # <<<<<<<<<<<<<< * register_core_codec(oid_type, * &int4_encode, */ __pyx_t_1 = __pyx_v_oid_types; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(22, 37, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid_type, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/misc.pyx":38 * * for oid_type in oid_types: * register_core_codec(oid_type, # <<<<<<<<<<<<<< * &int4_encode, * &int4_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(22, 38, __pyx_L1_error) /* "asyncpg/protocol/codecs/misc.pyx":41 * &int4_encode, * &int4_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_8protocol_8protocol_int4_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_int4_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/misc.pyx":37 * ] * * for oid_type in oid_types: # <<<<<<<<<<<<<< * register_core_codec(oid_type, * &int4_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":48 * # useful. * # * reg_types = [ # <<<<<<<<<<<<<< * REGPROCOID, REGPROCEDUREOID, REGOPEROID, REGOPERATOROID, * REGCLASSOID, REGTYPEOID, REGCONFIGOID, REGDICTIONARYOID, */ __pyx_t_1 = PyList_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_24); __Pyx_GIVEREF(__pyx_int_24); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_24); __Pyx_INCREF(__pyx_int_2202); __Pyx_GIVEREF(__pyx_int_2202); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_2202); __Pyx_INCREF(__pyx_int_2203); __Pyx_GIVEREF(__pyx_int_2203); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_2203); __Pyx_INCREF(__pyx_int_2204); __Pyx_GIVEREF(__pyx_int_2204); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_2204); __Pyx_INCREF(__pyx_int_2205); __Pyx_GIVEREF(__pyx_int_2205); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_2205); __Pyx_INCREF(__pyx_int_2206); __Pyx_GIVEREF(__pyx_int_2206); PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_2206); __Pyx_INCREF(__pyx_int_3734); __Pyx_GIVEREF(__pyx_int_3734); PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_3734); __Pyx_INCREF(__pyx_int_3769); __Pyx_GIVEREF(__pyx_int_3769); PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_3769); __Pyx_INCREF(__pyx_int_4089); __Pyx_GIVEREF(__pyx_int_4089); PyList_SET_ITEM(__pyx_t_1, 8, __pyx_int_4089); __Pyx_INCREF(__pyx_int_4096); __Pyx_GIVEREF(__pyx_int_4096); PyList_SET_ITEM(__pyx_t_1, 9, __pyx_int_4096); __Pyx_INCREF(__pyx_int_1790); __Pyx_GIVEREF(__pyx_int_1790); PyList_SET_ITEM(__pyx_t_1, 10, __pyx_int_1790); __pyx_v_reg_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":54 * ] * * for reg_type in reg_types: # <<<<<<<<<<<<<< * register_core_codec(reg_type, * &text_encode, */ __pyx_t_1 = __pyx_v_reg_types; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(22, 54, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_reg_type, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/misc.pyx":55 * * for reg_type in reg_types: * register_core_codec(reg_type, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_reg_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(22, 55, __pyx_L1_error) /* "asyncpg/protocol/codecs/misc.pyx":58 * &text_encode, * &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_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/misc.pyx":54 * ] * * for reg_type in reg_types: # <<<<<<<<<<<<<< * register_core_codec(reg_type, * &text_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":61 * * # cstring type is used by Postgres' I/O functions * register_core_codec(CSTRINGOID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x8E3, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":67 * * # 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(12); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_2276); __Pyx_GIVEREF(__pyx_int_2276); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_2276); __Pyx_INCREF(__pyx_int_2279); __Pyx_GIVEREF(__pyx_int_2279); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_2279); __Pyx_INCREF(__pyx_int_3838); __Pyx_GIVEREF(__pyx_int_3838); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_3838); __Pyx_INCREF(__pyx_int_2280); __Pyx_GIVEREF(__pyx_int_2280); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_2280); __Pyx_INCREF(__pyx_int_3115); __Pyx_GIVEREF(__pyx_int_3115); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_3115); __Pyx_INCREF(__pyx_int_3310); __Pyx_GIVEREF(__pyx_int_3310); PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_3310); __Pyx_INCREF(__pyx_int_2281); __Pyx_GIVEREF(__pyx_int_2281); PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_2281); __Pyx_INCREF(__pyx_int_2282); __Pyx_GIVEREF(__pyx_int_2282); PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_2282); __Pyx_INCREF(__pyx_int_2283); __Pyx_GIVEREF(__pyx_int_2283); PyList_SET_ITEM(__pyx_t_1, 8, __pyx_int_2283); __Pyx_INCREF(__pyx_int_2776); __Pyx_GIVEREF(__pyx_int_2776); PyList_SET_ITEM(__pyx_t_1, 9, __pyx_int_2776); __Pyx_INCREF(__pyx_int_32); __Pyx_GIVEREF(__pyx_int_32); PyList_SET_ITEM(__pyx_t_1, 10, __pyx_int_32); __Pyx_INCREF(__pyx_int_325); __Pyx_GIVEREF(__pyx_int_325); PyList_SET_ITEM(__pyx_t_1, 11, __pyx_int_325); __pyx_v_no_io_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":74 * ] * * register_core_codec(ANYENUMOID, # <<<<<<<<<<<<<< * NULL, * &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_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":79 * 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 (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(22, 79, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_no_io_type, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/misc.pyx":80 * * for no_io_type in no_io_types: * register_core_codec(no_io_type, # <<<<<<<<<<<<<< * NULL, * NULL, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_no_io_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(22, 80, __pyx_L1_error) /* "asyncpg/protocol/codecs/misc.pyx":83 * 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(22, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/misc.pyx":79 * 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/misc.pyx":86 * * # ACL specification string * register_core_codec(ACLITEMOID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x409, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":92 * * # Postgres' serialized expression tree type * register_core_codec(PG_NODE_TREEOID, # <<<<<<<<<<<<<< * NULL, * &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_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":98 * * # pg_lsn type -- a pointer to a location in the XLOG. * register_core_codec(PG_LSNOID, # <<<<<<<<<<<<<< * &int8_encode, * &int8_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xC94, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_int8_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_int8_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":103 * PG_FORMAT_BINARY) * * register_core_codec(SMGROID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xD2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":110 * # pg_dependencies and pg_ndistinct are special types * # used in pg_statistic_ext columns. * register_core_codec(PG_DEPENDENCIESOID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xD4A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":115 * PG_FORMAT_TEXT) * * register_core_codec(PG_NDISTINCTOID, # <<<<<<<<<<<<<< * &text_encode, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xD21, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/misc.pyx":19 * * * 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_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/array.pyx":28 * * * cdef inline bint _is_trivial_container(object obj): # <<<<<<<<<<<<<< * return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \ * PyByteArray_Check(obj) or PyMemoryView_Check(obj) */ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__is_trivial_container(PyObject *__pyx_v_obj) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("_is_trivial_container", 0); /* "asyncpg/protocol/codecs/array.pyx":29 * * cdef inline bint _is_trivial_container(object obj): * return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \ # <<<<<<<<<<<<<< * PyByteArray_Check(obj) or PyMemoryView_Check(obj) * */ __pyx_t_2 = (PyUnicode_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 = (PyBytes_Check(__pyx_v_obj) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":30 * cdef inline bint _is_trivial_container(object obj): * return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \ * PyByteArray_Check(obj) or 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":28 * * * cdef inline bint _is_trivial_container(object obj): # <<<<<<<<<<<<<< * return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \ * PyByteArray_Check(obj) or PyMemoryView_Check(obj) */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":33 * * * cdef inline _is_container(object obj): # <<<<<<<<<<<<<< * return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_container(PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_is_container", 0); /* "asyncpg/protocol/codecs/array.pyx":34 * * cdef inline _is_container(object obj): * return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = (!(__pyx_f_7asyncpg_8protocol_8protocol__is_trivial_container(__pyx_v_obj) != 0)); if (__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 34, __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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ContainerABC); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 34, __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/codecs/array.pyx":33 * * * cdef inline _is_container(object obj): # <<<<<<<<<<<<<< * return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol._is_container", __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":37 * * * cdef inline _is_sub_array(object obj): # <<<<<<<<<<<<<< * return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) \ * and not cpython.PyTuple_Check(obj) */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_sub_array(PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_is_sub_array", 0); /* "asyncpg/protocol/codecs/array.pyx":38 * * cdef inline _is_sub_array(object obj): * return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) \ # <<<<<<<<<<<<<< * and not cpython.PyTuple_Check(obj) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = (!(__pyx_f_7asyncpg_8protocol_8protocol__is_trivial_container(__pyx_v_obj) != 0)); if (__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 38, __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/codecs/array.pyx":39 * cdef inline _is_sub_array(object obj): * return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) \ * and not cpython.PyTuple_Check(obj) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ContainerABC); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/array.pyx":38 * * cdef inline _is_sub_array(object obj): * return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) \ # <<<<<<<<<<<<<< * and not cpython.PyTuple_Check(obj) * */ __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 38, __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/codecs/array.pyx":39 * cdef inline _is_sub_array(object obj): * return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) \ * and not cpython.PyTuple_Check(obj) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = (!(PyTuple_Check(__pyx_v_obj) != 0)); __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 39, __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/codecs/array.pyx":37 * * * cdef inline _is_sub_array(object obj): # <<<<<<<<<<<<<< * return not _is_trivial_container(obj) and isinstance(obj, ContainerABC) \ * and not cpython.PyTuple_Check(obj) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol._is_sub_array", __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":42 * * * cdef _get_array_shape(object obj, int32_t *dims, int32_t *ndims): # <<<<<<<<<<<<<< * cdef: * ssize_t mylen = len(obj) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(PyObject *__pyx_v_obj, int32_t *__pyx_v_dims, int32_t *__pyx_v_ndims) { Py_ssize_t __pyx_v_mylen; Py_ssize_t __pyx_v_elemlen; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); Py_ssize_t __pyx_t_10; long __pyx_t_11; __Pyx_RefNannySetupContext("_get_array_shape", 0); /* "asyncpg/protocol/codecs/array.pyx":44 * 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(6, 44, __pyx_L1_error) __pyx_v_mylen = __pyx_t_1; /* "asyncpg/protocol/codecs/array.pyx":45 * cdef: * ssize_t mylen = len(obj) * ssize_t elemlen = -2 # <<<<<<<<<<<<<< * object it * */ __pyx_v_elemlen = -2L; /* "asyncpg/protocol/codecs/array.pyx":48 * object it * * if mylen > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in array value') * */ __pyx_t_2 = ((__pyx_v_mylen > 0x7FFFFFFF) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":49 * * if mylen > _MAXINT32: * raise ValueError('too many elements in array value') # <<<<<<<<<<<<<< * * if ndims[0] > ARRAY_MAXDIM: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 49, __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(6, 49, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":48 * object it * * if mylen > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in array value') * */ } /* "asyncpg/protocol/codecs/array.pyx":51 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":53 * if ndims[0] > ARRAY_MAXDIM: * raise ValueError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. # <<<<<<<<<<<<<< * format(ndims[0], ARRAY_MAXDIM)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_number_of_array_dimensions_excee, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/array.pyx":54 * raise ValueError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims[0], ARRAY_MAXDIM)) # <<<<<<<<<<<<<< * * dims[ndims[0] - 1] = mylen */ __pyx_t_5 = __Pyx_PyInt_From_int32_t((__pyx_v_ndims[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_int_6}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 54, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_int_6}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 54, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_int_6); __Pyx_GIVEREF(__pyx_int_6); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_int_6); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":52 * * if ndims[0] > ARRAY_MAXDIM: * raise ValueError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims[0], ARRAY_MAXDIM)) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 52, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":51 * 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":56 * 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":58 * dims[ndims[0] - 1] = mylen * * for elem in obj: # <<<<<<<<<<<<<< * if _is_sub_array(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(6, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 58, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(6, 58, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(6, 58, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(6, 58, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":59 * * for elem in obj: * if _is_sub_array(elem): # <<<<<<<<<<<<<< * if elemlen == -2: * elemlen = len(elem) */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol__is_sub_array(__pyx_v_elem); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":60 * for elem in obj: * if _is_sub_array(elem): * if elemlen == -2: # <<<<<<<<<<<<<< * elemlen = len(elem) * if elemlen > _MAXINT32: */ __pyx_t_2 = ((__pyx_v_elemlen == -2L) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":61 * if _is_sub_array(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(6, 61, __pyx_L1_error) __pyx_v_elemlen = __pyx_t_10; /* "asyncpg/protocol/codecs/array.pyx":62 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":63 * 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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 63, __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(6, 63, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":62 * 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":64 * 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":65 * raise ValueError('too many elements in array value') * ndims[0] += 1 * _get_array_shape(elem, dims, ndims) # <<<<<<<<<<<<<< * else: * if len(elem) != elemlen: */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(__pyx_v_elem, __pyx_v_dims, __pyx_v_ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":60 * for elem in obj: * if _is_sub_array(elem): * if elemlen == -2: # <<<<<<<<<<<<<< * elemlen = len(elem) * if elemlen > _MAXINT32: */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/array.pyx":67 * _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(6, 67, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_10 != __pyx_v_elemlen) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":68 * else: * if len(elem) != elemlen: * raise ValueError('non-homogeneous array') # <<<<<<<<<<<<<< * else: * if elemlen >= 0: */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 68, __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(6, 68, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":67 * _get_array_shape(elem, dims, ndims) * else: * if len(elem) != elemlen: # <<<<<<<<<<<<<< * raise ValueError('non-homogeneous array') * else: */ } } __pyx_L8:; /* "asyncpg/protocol/codecs/array.pyx":59 * * for elem in obj: * if _is_sub_array(elem): # <<<<<<<<<<<<<< * if elemlen == -2: * elemlen = len(elem) */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/array.pyx":70 * raise ValueError('non-homogeneous array') * else: * if elemlen >= 0: # <<<<<<<<<<<<<< * raise ValueError('non-homogeneous array') * else: */ /*else*/ { __pyx_t_2 = ((__pyx_v_elemlen >= 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":71 * else: * if elemlen >= 0: * raise ValueError('non-homogeneous array') # <<<<<<<<<<<<<< * else: * elemlen = -1 */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 71, __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(6, 71, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":70 * raise ValueError('non-homogeneous array') * else: * if elemlen >= 0: # <<<<<<<<<<<<<< * raise ValueError('non-homogeneous array') * else: */ } /* "asyncpg/protocol/codecs/array.pyx":73 * raise ValueError('non-homogeneous array') * else: * elemlen = -1 # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_v_elemlen = -1L; } } __pyx_L7:; /* "asyncpg/protocol/codecs/array.pyx":58 * dims[ndims[0] - 1] = mylen * * for elem in obj: # <<<<<<<<<<<<<< * if _is_sub_array(elem): * if elemlen == -2: */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":42 * * * cdef _get_array_shape(object obj, int32_t *dims, int32_t *ndims): # <<<<<<<<<<<<<< * cdef: * ssize_t mylen = len(obj) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_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":76 * * * 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_8protocol_8protocol_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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; 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; char const *__pyx_t_19; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; __Pyx_RefNannySetupContext("_write_array_data", 0); /* "asyncpg/protocol/codecs/array.pyx":79 * 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)) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":80 * 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(6, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 80, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 80, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 80, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(6, 80, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":81 * 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(6, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":80 * 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":79 * 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":84 * 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(6, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 84, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 84, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 84, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(6, 84, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":85 * else: * for item in obj: * if item is None: # <<<<<<<<<<<<<< * elem_data.write_int32(-1) * else: */ __pyx_t_1 = (__pyx_v_item == Py_None); __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/array.pyx":86 * for item in obj: * if item is None: * elem_data.write_int32(-1) # <<<<<<<<<<<<<< * else: * try: */ __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":85 * else: * for item in obj: * if item is None: # <<<<<<<<<<<<<< * elem_data.write_int32(-1) * else: */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/array.pyx":88 * 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_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/codecs/array.pyx":89 * 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(6, 89, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":88 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ } __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_L9_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":90 * 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_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_10) { __Pyx_AddTraceback("asyncpg.protocol.protocol._write_array_data", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(6, 90, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __pyx_v_e = __pyx_t_11; /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":92 * except TypeError as e: * raise ValueError( * 'invalid array element: {}'.format(e.args[0])) from None # <<<<<<<<<<<<<< * * */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_array_element, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 92, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 92, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(6, 92, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); } } if (!__pyx_t_15) { __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_16); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 92, __pyx_L22_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_13); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_14)) { PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_16}; __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 92, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) { PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_16}; __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 92, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 92, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15); __pyx_t_15 = NULL; __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 92, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "asyncpg/protocol/codecs/array.pyx":91 * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid array element: {}'.format(e.args[0])) from None * */ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 91, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 91, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "asyncpg/protocol/codecs/array.pyx":92 * except TypeError as e: * raise ValueError( * 'invalid array element: {}'.format(e.args[0])) from None # <<<<<<<<<<<<<< * * */ __Pyx_Raise(__pyx_t_13, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __PYX_ERR(6, 91, __pyx_L22_error) } /* "asyncpg/protocol/codecs/array.pyx":90 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element: {}'.format(e.args[0])) from None */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L22_error:; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __Pyx_PyThreadState_assign __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_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); __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_XGOTREF(__pyx_t_25); __pyx_t_10 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25); } __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22); __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19; goto __pyx_L11_except_error; } } } goto __pyx_L11_except_error; __pyx_L11_except_error:; /* "asyncpg/protocol/codecs/array.pyx":88 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ __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_L16_try_end:; } } __pyx_L8:; /* "asyncpg/protocol/codecs/array.pyx":84 * 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":76 * * * 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_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":95 * * * 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_8protocol_8protocol_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_8protocol_8protocol_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; int32_t __pyx_t_8; Py_ssize_t __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_t_20; char const *__pyx_t_21; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; int32_t __pyx_t_28; __Pyx_RefNannySetupContext("array_encode", 0); /* "asyncpg/protocol/codecs/array.pyx":101 * WriteBuffer elem_data * int32_t dims[ARRAY_MAXDIM] * int32_t ndims = 1 # <<<<<<<<<<<<<< * int32_t i * */ __pyx_v_ndims = 1; /* "asyncpg/protocol/codecs/array.pyx":104 * int32_t i * * if not _is_container(obj): # <<<<<<<<<<<<<< * raise TypeError( * 'a non-trivial iterable expected (got type {!r})'.format( */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__is_container(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/array.pyx":106 * if not _is_container(obj): * raise TypeError( * 'a non-trivial iterable expected (got type {!r})'.format( # <<<<<<<<<<<<<< * type(obj).__name__)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_non_trivial_iterable_expected, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/array.pyx":107 * raise TypeError( * 'a non-trivial iterable expected (got type {!r})'.format( * type(obj).__name__)) # <<<<<<<<<<<<<< * * _get_array_shape(obj, dims, &ndims) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 106, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 106, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":105 * * if not _is_container(obj): * raise TypeError( # <<<<<<<<<<<<<< * 'a non-trivial iterable expected (got type {!r})'.format( * type(obj).__name__)) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(6, 105, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":104 * int32_t i * * if not _is_container(obj): # <<<<<<<<<<<<<< * raise TypeError( * 'a non-trivial iterable expected (got type {!r})'.format( */ } /* "asyncpg/protocol/codecs/array.pyx":109 * 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(6, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":111 * _get_array_shape(obj, dims, &ndims) * * elem_data = WriteBuffer.new() # <<<<<<<<<<<<<< * * if ndims > 1: */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_elem_data = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":113 * 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) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/array.pyx":114 * * 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(6, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":113 * 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":117 * encoder, encoder_arg) * else: * for i, item in enumerate(obj): # <<<<<<<<<<<<<< * if item is None: * elem_data.write_int32(-1) */ /*else*/ { __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) { __pyx_t_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(6, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 117, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(6, 117, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(6, 117, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_10(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(6, 117, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); __pyx_t_4 = 0; __pyx_v_i = __pyx_t_8; __pyx_t_8 = (__pyx_t_8 + 1); /* "asyncpg/protocol/codecs/array.pyx":118 * 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); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":119 * for i, item in enumerate(obj): * if item is None: * elem_data.write_int32(-1) # <<<<<<<<<<<<<< * else: * try: */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":118 * 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":121 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ /*else*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":122 * else: * try: * encoder(settings, elem_data, item, encoder_arg) # <<<<<<<<<<<<<< * except TypeError as e: * raise ValueError( */ __pyx_t_4 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_elem_data, __pyx_v_item, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 122, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":121 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L15_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":123 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element at index {}: {}'.format( */ __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_14) { __Pyx_AddTraceback("asyncpg.protocol.protocol.array_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_5) < 0) __PYX_ERR(6, 123, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_v_e = __pyx_t_7; /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":125 * except TypeError as e: * raise ValueError( * 'invalid array element at index {}: {}'.format( # <<<<<<<<<<<<<< * i, e.args[0])) from None * */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_array_element_at_index, __pyx_n_s_format); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 125, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_15); /* "asyncpg/protocol/codecs/array.pyx":126 * 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_16 = __Pyx_PyInt_From_int32_t(__pyx_v_i); if (unlikely(!__pyx_t_16)) __PYX_ERR(6, 126, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 126, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_17, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(6, 126, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = NULL; __pyx_t_14 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); __pyx_t_14 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_16, __pyx_t_18}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 125, __pyx_L21_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) { PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_16, __pyx_t_18}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 125, __pyx_L21_error) __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } else #endif { __pyx_t_19 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_19)) __PYX_ERR(6, 125, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_19); if (__pyx_t_17) { __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17); __pyx_t_17 = NULL; } __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_14, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_14, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_18 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 125, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/array.pyx":124 * 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_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 124, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_15, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 124, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/array.pyx":126 * raise ValueError( * 'invalid array element at index {}: {}'.format( * i, e.args[0])) from None # <<<<<<<<<<<<<< * * buf.write_int32(12 + 8 * ndims + elem_data.len()) */ __Pyx_Raise(__pyx_t_6, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(6, 124, __pyx_L21_error) } /* "asyncpg/protocol/codecs/array.pyx":123 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element at index {}: {}'.format( */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L21_error:; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __pyx_t_14 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27); } __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24); __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21; goto __pyx_L10_except_error; } } } goto __pyx_L10_except_error; __pyx_L10_except_error:; /* "asyncpg/protocol/codecs/array.pyx":121 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L15_try_end:; } } __pyx_L7:; /* "asyncpg/protocol/codecs/array.pyx":117 * 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":128 * 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_PyInt_From_long((12 + (8 * __pyx_v_ndims))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_7); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/array.pyx":130 * buf.write_int32(12 + 8 * ndims + elem_data.len()) * # Number of dimensions * buf.write_int32(ndims) # <<<<<<<<<<<<<< * # flags * buf.write_int32(0) */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_ndims); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/array.pyx":132 * buf.write_int32(ndims) * # flags * buf.write_int32(0) # <<<<<<<<<<<<<< * # element type * buf.write_int32(elem_oid) */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/array.pyx":134 * buf.write_int32(0) * # element type * buf.write_int32(elem_oid) # <<<<<<<<<<<<<< * # upper / lower bounds * for i in range(ndims): */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_elem_oid)); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/array.pyx":136 * buf.write_int32(elem_oid) * # upper / lower bounds * for i in range(ndims): # <<<<<<<<<<<<<< * buf.write_int32(dims[i]) * buf.write_int32(1) */ __pyx_t_8 = __pyx_v_ndims; for (__pyx_t_28 = 0; __pyx_t_28 < __pyx_t_8; __pyx_t_28+=1) { __pyx_v_i = __pyx_t_28; /* "asyncpg/protocol/codecs/array.pyx":137 * # upper / lower bounds * for i in range(ndims): * buf.write_int32(dims[i]) # <<<<<<<<<<<<<< * buf.write_int32(1) * # element data */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, (__pyx_v_dims[__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/array.pyx":138 * for i in range(ndims): * buf.write_int32(dims[i]) * buf.write_int32(1) # <<<<<<<<<<<<<< * # element data * buf.write_buffer(elem_data) */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "asyncpg/protocol/codecs/array.pyx":140 * buf.write_int32(1) * # element data * buf.write_buffer(elem_data) # <<<<<<<<<<<<<< * * */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/array.pyx":95 * * * 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_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); __Pyx_AddTraceback("asyncpg.protocol.protocol.array_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_elem_data); __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":143 * * * 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_8protocol_8protocol_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_8protocol_8protocol_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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; 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; char const *__pyx_t_19; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; Py_ssize_t __pyx_t_26; Py_ssize_t __pyx_t_27; char const *__pyx_t_28; __Pyx_RefNannySetupContext("_write_textarray_data", 0); /* "asyncpg/protocol/codecs/array.pyx":148 * Py_UCS4 typdelim): * cdef: * ssize_t i = 0 # <<<<<<<<<<<<<< * int8_t delim = typdelim * WriteBuffer elem_data */ __pyx_v_i = 0; /* "asyncpg/protocol/codecs/array.pyx":149 * 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":158 * bint need_quoting * * array_data.write_byte(b'{') # <<<<<<<<<<<<<< * * if dim < ndims - 1: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_array_data, '{'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":160 * 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)) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":161 * * 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(6, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 161, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 161, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 161, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(6, 161, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":162 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":163 * 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 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_array_data, __pyx_v_delim); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":164 * 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 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_array_data, ' '); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":162 * 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":165 * 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(6, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":167 * _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":161 * * 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":160 * array_data.write_byte(b'{') * * if dim < ndims - 1: # <<<<<<<<<<<<<< * for item in obj: * if i > 0: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/array.pyx":169 * 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(6, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 169, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 169, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 169, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(6, 169, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":170 * else: * for item in obj: * elem_data = WriteBuffer.new() # <<<<<<<<<<<<<< * * if i > 0: */ __pyx_t_5 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_elem_data, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_5)); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":172 * elem_data = WriteBuffer.new() * * if i > 0: # <<<<<<<<<<<<<< * array_data.write_byte(delim) * array_data.write_byte(b' ') */ __pyx_t_2 = ((__pyx_v_i > 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":173 * * if i > 0: * array_data.write_byte(delim) # <<<<<<<<<<<<<< * array_data.write_byte(b' ') * */ __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_array_data, __pyx_v_delim); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 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' ') # <<<<<<<<<<<<<< * * if item is None: */ __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_array_data, ' '); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":172 * elem_data = WriteBuffer.new() * * if i > 0: # <<<<<<<<<<<<<< * array_data.write_byte(delim) * array_data.write_byte(b' ') */ } /* "asyncpg/protocol/codecs/array.pyx":176 * 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); __pyx_t_6 = (__pyx_t_2 != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/array.pyx":177 * * if item is None: * array_data.write_bytes(b'NULL') # <<<<<<<<<<<<<< * i += 1 * continue */ __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytes(__pyx_v_array_data, __pyx_n_b_NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":178 * 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":179 * array_data.write_bytes(b'NULL') * i += 1 * continue # <<<<<<<<<<<<<< * else: * try: */ goto __pyx_L7_continue; /* "asyncpg/protocol/codecs/array.pyx":176 * array_data.write_byte(b' ') * * if item is None: # <<<<<<<<<<<<<< * array_data.write_bytes(b'NULL') * i += 1 */ } /* "asyncpg/protocol/codecs/array.pyx":181 * 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_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/codecs/array.pyx":182 * 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(6, 182, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":181 * continue * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ } __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_L18_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":183 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element: {}'.format( */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_10) { __Pyx_AddTraceback("asyncpg.protocol.protocol._write_textarray_data", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(6, 183, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __pyx_v_e = __pyx_t_11; /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":185 * except TypeError as e: * raise ValueError( * 'invalid array element: {}'.format( # <<<<<<<<<<<<<< * e.args[0])) from None * */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_array_element, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 185, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_14); /* "asyncpg/protocol/codecs/array.pyx":186 * raise ValueError( * 'invalid array element: {}'.format( * e.args[0])) from None # <<<<<<<<<<<<<< * * # element string length (first four bytes are the encoded length.) */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 186, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(6, 186, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); } } if (!__pyx_t_15) { __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_16); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 185, __pyx_L24_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_13); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_14)) { PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_16}; __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 185, __pyx_L24_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) { PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_16}; __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 185, __pyx_L24_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 185, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15); __pyx_t_15 = NULL; __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 185, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "asyncpg/protocol/codecs/array.pyx":184 * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid array element: {}'.format( * e.args[0])) from None */ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 184, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 184, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "asyncpg/protocol/codecs/array.pyx":186 * raise ValueError( * 'invalid array element: {}'.format( * e.args[0])) from None # <<<<<<<<<<<<<< * * # element string length (first four bytes are the encoded length.) */ __Pyx_Raise(__pyx_t_13, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __PYX_ERR(6, 184, __pyx_L24_error) } /* "asyncpg/protocol/codecs/array.pyx":183 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element: {}'.format( */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L24_error:; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __Pyx_PyThreadState_assign __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_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); __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_XGOTREF(__pyx_t_25); __pyx_t_10 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25); } __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22); __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19; goto __pyx_L13_except_error; } } } goto __pyx_L13_except_error; __pyx_L13_except_error:; /* "asyncpg/protocol/codecs/array.pyx":181 * continue * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ __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_L18_try_end:; } } /* "asyncpg/protocol/codecs/array.pyx":189 * * # element string length (first four bytes are the encoded length.) * elem_len = elem_data.len() - 4 # <<<<<<<<<<<<<< * * if elem_len == 0: */ __pyx_t_12 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __Pyx_PyInt_SubtractObjC(__pyx_t_12, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_26 = PyInt_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_26 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_elem_len = __pyx_t_26; /* "asyncpg/protocol/codecs/array.pyx":191 * elem_len = elem_data.len() - 4 * * if elem_len == 0: # <<<<<<<<<<<<<< * # Empty string * array_data.write_bytes(b'""') */ __pyx_t_6 = ((__pyx_v_elem_len == 0) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/array.pyx":193 * if elem_len == 0: * # Empty string * array_data.write_bytes(b'""') # <<<<<<<<<<<<<< * else: * cpython.PyObject_GetBuffer( */ __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytes(__pyx_v_array_data, __pyx_kp_b__64); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/codecs/array.pyx":191 * elem_len = elem_data.len() - 4 * * if elem_len == 0: # <<<<<<<<<<<<<< * # Empty string * array_data.write_bytes(b'""') */ goto __pyx_L30; } /* "asyncpg/protocol/codecs/array.pyx":195 * array_data.write_bytes(b'""') * else: * cpython.PyObject_GetBuffer( # <<<<<<<<<<<<<< * elem_data, &pybuf, cpython.PyBUF_SIMPLE) * */ /*else*/ { /* "asyncpg/protocol/codecs/array.pyx":196 * else: * cpython.PyObject_GetBuffer( * elem_data, &pybuf, cpython.PyBUF_SIMPLE) # <<<<<<<<<<<<<< * * elem_str = (pybuf.buf) + 4 */ __pyx_t_18 = PyObject_GetBuffer(((PyObject *)__pyx_v_elem_data), (&__pyx_v_pybuf), PyBUF_SIMPLE); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(6, 195, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":198 * 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":200 * elem_str = (pybuf.buf) + 4 * * try: # <<<<<<<<<<<<<< * if not apg_strcasecmp_char(elem_str, b'NULL'): * array_data.write_bytes(b'"NULL"') */ /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":201 * * try: * if not apg_strcasecmp_char(elem_str, b'NULL'): # <<<<<<<<<<<<<< * array_data.write_bytes(b'"NULL"') * else: */ __pyx_t_6 = ((!(__pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp_char(__pyx_v_elem_str, ((char const *)"NULL")) != 0)) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/array.pyx":202 * try: * if not apg_strcasecmp_char(elem_str, b'NULL'): * array_data.write_bytes(b'"NULL"') # <<<<<<<<<<<<<< * else: * quoted_elem_len = elem_len */ __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytes(__pyx_v_array_data, __pyx_kp_b_NULL_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 202, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/codecs/array.pyx":201 * * try: * if not apg_strcasecmp_char(elem_str, b'NULL'): # <<<<<<<<<<<<<< * array_data.write_bytes(b'"NULL"') * else: */ goto __pyx_L36; } /* "asyncpg/protocol/codecs/array.pyx":204 * array_data.write_bytes(b'"NULL"') * else: * quoted_elem_len = elem_len # <<<<<<<<<<<<<< * need_quoting = False * */ /*else*/ { __pyx_v_quoted_elem_len = __pyx_v_elem_len; /* "asyncpg/protocol/codecs/array.pyx":205 * 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":207 * need_quoting = False * * for i in range(elem_len): # <<<<<<<<<<<<<< * ch = elem_str[i] * if ch == b'"' or ch == b'\\': */ __pyx_t_26 = __pyx_v_elem_len; for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) { __pyx_v_i = __pyx_t_27; /* "asyncpg/protocol/codecs/array.pyx":208 * * 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":209 * 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_6 = 1; break; default: __pyx_t_6 = 0; break; } if (__pyx_t_6) { /* "asyncpg/protocol/codecs/array.pyx":211 * 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":212 * # 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":209 * 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_L39; } /* "asyncpg/protocol/codecs/array.pyx":213 * 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_2 = ((__pyx_v_ch == '{') != 0); if (!__pyx_t_2) { } else { __pyx_t_6 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } __pyx_t_2 = ((__pyx_v_ch == '}') != 0); if (!__pyx_t_2) { } else { __pyx_t_6 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } __pyx_t_2 = ((__pyx_v_ch == __pyx_v_delim) != 0); if (!__pyx_t_2) { } else { __pyx_t_6 = __pyx_t_2; goto __pyx_L40_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":214 * need_quoting = True * elif (ch == b'{' or ch == b'}' or ch == delim or * apg_ascii_isspace(ch)): # <<<<<<<<<<<<<< * need_quoting = True * */ __pyx_t_2 = (__pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace(((uint32_t)__pyx_v_ch)) != 0); __pyx_t_6 = __pyx_t_2; __pyx_L40_bool_binop_done:; /* "asyncpg/protocol/codecs/array.pyx":213 * 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_6) { /* "asyncpg/protocol/codecs/array.pyx":215 * 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":213 * 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_L39:; } /* "asyncpg/protocol/codecs/array.pyx":217 * need_quoting = True * * if need_quoting: # <<<<<<<<<<<<<< * array_data.write_byte(b'"') * */ __pyx_t_6 = (__pyx_v_need_quoting != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/array.pyx":218 * * if need_quoting: * array_data.write_byte(b'"') # <<<<<<<<<<<<<< * * if quoted_elem_len == elem_len: */ __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_array_data, '"'); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 218, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/codecs/array.pyx":220 * array_data.write_byte(b'"') * * if quoted_elem_len == elem_len: # <<<<<<<<<<<<<< * array_data.write_cstr(elem_str, elem_len) * else: */ __pyx_t_6 = ((__pyx_v_quoted_elem_len == __pyx_v_elem_len) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/array.pyx":221 * * if quoted_elem_len == elem_len: * array_data.write_cstr(elem_str, elem_len) # <<<<<<<<<<<<<< * else: * # Escaping required. */ __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_array_data, __pyx_v_elem_str, __pyx_v_elem_len); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 221, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/codecs/array.pyx":220 * array_data.write_byte(b'"') * * if quoted_elem_len == elem_len: # <<<<<<<<<<<<<< * array_data.write_cstr(elem_str, elem_len) * else: */ goto __pyx_L45; } /* "asyncpg/protocol/codecs/array.pyx":224 * else: * # Escaping required. * for i in range(elem_len): # <<<<<<<<<<<<<< * ch = elem_str[i] * if ch == b'"' or ch == b'\\': */ /*else*/ { __pyx_t_26 = __pyx_v_elem_len; for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) { __pyx_v_i = __pyx_t_27; /* "asyncpg/protocol/codecs/array.pyx":225 * # 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":226 * 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":227 * ch = elem_str[i] * if ch == b'"' or ch == b'\\': * array_data.write_byte(b'\\') # <<<<<<<<<<<<<< * array_data.write_byte(ch) * */ __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_array_data, '\\'); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 227, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/codecs/array.pyx":226 * 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":228 * if ch == b'"' or ch == b'\\': * array_data.write_byte(b'\\') * array_data.write_byte(ch) # <<<<<<<<<<<<<< * * array_data.write_byte(b'"') */ __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_array_data, __pyx_v_ch); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 228, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __pyx_L45:; /* "asyncpg/protocol/codecs/array.pyx":230 * array_data.write_byte(ch) * * array_data.write_byte(b'"') # <<<<<<<<<<<<<< * else: * array_data.write_cstr(elem_str, elem_len) */ __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_array_data, '"'); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 230, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/codecs/array.pyx":217 * need_quoting = True * * if need_quoting: # <<<<<<<<<<<<<< * array_data.write_byte(b'"') * */ goto __pyx_L44; } /* "asyncpg/protocol/codecs/array.pyx":232 * array_data.write_byte(b'"') * else: * array_data.write_cstr(elem_str, elem_len) # <<<<<<<<<<<<<< * finally: * cpython.PyBuffer_Release(&pybuf) */ /*else*/ { __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_array_data, __pyx_v_elem_str, __pyx_v_elem_len); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 232, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_L44:; } __pyx_L36:; } /* "asyncpg/protocol/codecs/array.pyx":234 * 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_L35; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L34_error:; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __Pyx_PyThreadState_assign __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_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_24, &__pyx_t_23); if ((PY_MAJOR_VERSION < 3) || 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_25); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_23); __pyx_t_18 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_28 = __pyx_filename; { PyBuffer_Release((&__pyx_v_pybuf)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_24, __pyx_t_23); } __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_9, __pyx_t_8, __pyx_t_7); __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_lineno = __pyx_t_18; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_28; goto __pyx_L1_error; } __pyx_L35:; } } __pyx_L30:; /* "asyncpg/protocol/codecs/array.pyx":236 * cpython.PyBuffer_Release(&pybuf) * * i += 1 # <<<<<<<<<<<<<< * * array_data.write_byte(b'}') */ __pyx_v_i = (__pyx_v_i + 1); /* "asyncpg/protocol/codecs/array.pyx":169 * i += 1 * else: * for item in obj: # <<<<<<<<<<<<<< * elem_data = WriteBuffer.new() * */ __pyx_L7_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/array.pyx":238 * i += 1 * * array_data.write_byte(b'}') # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_array_data, '}'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":143 * * * 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_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":241 * * * 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_8protocol_8protocol_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_8protocol_8protocol_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; int32_t __pyx_t_8; __Pyx_RefNannySetupContext("textarray_encode", 0); /* "asyncpg/protocol/codecs/array.pyx":247 * WriteBuffer array_data * int32_t dims[ARRAY_MAXDIM] * int32_t ndims = 1 # <<<<<<<<<<<<<< * int32_t i * */ __pyx_v_ndims = 1; /* "asyncpg/protocol/codecs/array.pyx":250 * int32_t i * * if not _is_container(obj): # <<<<<<<<<<<<<< * raise TypeError( * 'a non-trivial iterable expected (got type {!r})'.format( */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__is_container(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/array.pyx":252 * if not _is_container(obj): * raise TypeError( * 'a non-trivial iterable expected (got type {!r})'.format( # <<<<<<<<<<<<<< * type(obj).__name__)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_non_trivial_iterable_expected, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/array.pyx":253 * raise TypeError( * 'a non-trivial iterable expected (got type {!r})'.format( * type(obj).__name__)) # <<<<<<<<<<<<<< * * _get_array_shape(obj, dims, &ndims) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 252, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 252, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":251 * * if not _is_container(obj): * raise TypeError( # <<<<<<<<<<<<<< * 'a non-trivial iterable expected (got type {!r})'.format( * type(obj).__name__)) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(6, 251, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":250 * int32_t i * * if not _is_container(obj): # <<<<<<<<<<<<<< * raise TypeError( * 'a non-trivial iterable expected (got type {!r})'.format( */ } /* "asyncpg/protocol/codecs/array.pyx":255 * 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(6, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":257 * _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_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_array_data = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":258 * * 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(6, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":260 * _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_8protocol_8protocol_11WriteBuffer_len(__pyx_v_array_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":261 * encoder, encoder_arg, typdelim) * buf.write_int32(array_data.len()) * buf.write_buffer(array_data) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(__pyx_v_buf, __pyx_v_array_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":241 * * * 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":264 * * * cdef inline array_decode(ConnectionSettings settings, FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_elem_buf = 0; int32_t __pyx_v_dims[6]; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int32_t __pyx_t_9; __Pyx_RefNannySetupContext("array_decode", 0); /* "asyncpg/protocol/codecs/array.pyx":267 * decode_func_ex decoder, const void *decoder_arg): * cdef: * int32_t ndims = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * int32_t flags = hton.unpack_int32(buf.read(4)) * uint32_t elem_oid = hton.unpack_int32(buf.read(4)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 267, __pyx_L1_error) __pyx_v_ndims = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/array.pyx":268 * cdef: * int32_t ndims = hton.unpack_int32(buf.read(4)) * int32_t flags = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * uint32_t elem_oid = hton.unpack_int32(buf.read(4)) * list result */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 268, __pyx_L1_error) __pyx_v_flags = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/array.pyx":269 * int32_t ndims = hton.unpack_int32(buf.read(4)) * int32_t flags = hton.unpack_int32(buf.read(4)) * uint32_t elem_oid = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * list result * int i */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 269, __pyx_L1_error) __pyx_v_elem_oid = ((uint32_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1)); /* "asyncpg/protocol/codecs/array.pyx":273 * int i * int32_t elem_len * int32_t elem_count = 1 # <<<<<<<<<<<<<< * FastReadBuffer elem_buf = FastReadBuffer.new() * int32_t dims[ARRAY_MAXDIM] */ __pyx_v_elem_count = 1; /* "asyncpg/protocol/codecs/array.pyx":274 * int32_t elem_len * int32_t elem_count = 1 * FastReadBuffer elem_buf = FastReadBuffer.new() # <<<<<<<<<<<<<< * int32_t dims[ARRAY_MAXDIM] * Codec elem_codec */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_new()); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_elem_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/array.pyx":278 * Codec elem_codec * * if ndims == 0: # <<<<<<<<<<<<<< * result = cpython.PyList_New(0) * return result */ __pyx_t_3 = ((__pyx_v_ndims == 0) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/array.pyx":279 * * if ndims == 0: * result = cpython.PyList_New(0) # <<<<<<<<<<<<<< * return result * */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/array.pyx":280 * if ndims == 0: * result = cpython.PyList_New(0) * return result # <<<<<<<<<<<<<< * * if ndims > ARRAY_MAXDIM: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":278 * Codec elem_codec * * if ndims == 0: # <<<<<<<<<<<<<< * result = cpython.PyList_New(0) * return result */ } /* "asyncpg/protocol/codecs/array.pyx":282 * return result * * if ndims > ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise RuntimeError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. */ __pyx_t_3 = ((__pyx_v_ndims > 6) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/array.pyx":284 * if ndims > ARRAY_MAXDIM: * raise RuntimeError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. # <<<<<<<<<<<<<< * format(ndims, ARRAY_MAXDIM)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_number_of_array_dimensions_excee, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/array.pyx":285 * raise RuntimeError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims, ARRAY_MAXDIM)) # <<<<<<<<<<<<<< * * for i in range(ndims): */ __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_int_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 285, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_int_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 285, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_int_6); __Pyx_GIVEREF(__pyx_int_6); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_int_6); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":283 * * if ndims > ARRAY_MAXDIM: * raise RuntimeError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims, ARRAY_MAXDIM)) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(6, 283, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":282 * return result * * if ndims > ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise RuntimeError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. */ } /* "asyncpg/protocol/codecs/array.pyx":287 * format(ndims, ARRAY_MAXDIM)) * * for i in range(ndims): # <<<<<<<<<<<<<< * dims[i] = hton.unpack_int32(buf.read(4)) * # Ignore the lower bound information */ __pyx_t_9 = __pyx_v_ndims; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_9; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; /* "asyncpg/protocol/codecs/array.pyx":288 * * for i in range(ndims): * dims[i] = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * # Ignore the lower bound information * buf.read(4) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 288, __pyx_L1_error) (__pyx_v_dims[__pyx_v_i]) = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/array.pyx":290 * dims[i] = hton.unpack_int32(buf.read(4)) * # Ignore the lower bound information * buf.read(4) # <<<<<<<<<<<<<< * * if ndims == 1: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 290, __pyx_L1_error) } /* "asyncpg/protocol/codecs/array.pyx":292 * buf.read(4) * * if ndims == 1: # <<<<<<<<<<<<<< * # Fast path for flat arrays * elem_count = dims[0] */ __pyx_t_3 = ((__pyx_v_ndims == 1) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/array.pyx":294 * 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":295 * # Fast path for flat arrays * elem_count = dims[0] * result = cpython.PyList_New(elem_count) # <<<<<<<<<<<<<< * * for i in range(elem_count): */ __pyx_t_2 = PyList_New(__pyx_v_elem_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/array.pyx":297 * result = cpython.PyList_New(elem_count) * * for i in range(elem_count): # <<<<<<<<<<<<<< * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len == -1: */ __pyx_t_9 = __pyx_v_elem_count; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_9; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; /* "asyncpg/protocol/codecs/array.pyx":298 * * for i in range(elem_count): * elem_len = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * if elem_len == -1: * elem = None */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 298, __pyx_L1_error) __pyx_v_elem_len = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/array.pyx":299 * for i in range(elem_count): * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ __pyx_t_3 = ((__pyx_v_elem_len == -1L) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/array.pyx":300 * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len == -1: * elem = None # <<<<<<<<<<<<<< * else: * elem_buf.slice_from(buf, elem_len) */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_elem, Py_None); /* "asyncpg/protocol/codecs/array.pyx":299 * for i in range(elem_count): * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ goto __pyx_L10; } /* "asyncpg/protocol/codecs/array.pyx":302 * elem = None * else: * elem_buf.slice_from(buf, elem_len) # <<<<<<<<<<<<<< * elem = decoder(settings, elem_buf, decoder_arg) * */ /*else*/ { __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_slice_from(__pyx_v_elem_buf, __pyx_v_buf, __pyx_v_elem_len)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/array.pyx":303 * else: * elem_buf.slice_from(buf, elem_len) * elem = decoder(settings, elem_buf, decoder_arg) # <<<<<<<<<<<<<< * * cpython.Py_INCREF(elem) */ __pyx_t_2 = __pyx_v_decoder(__pyx_v_settings, __pyx_v_elem_buf, __pyx_v_decoder_arg); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L10:; /* "asyncpg/protocol/codecs/array.pyx":305 * 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":306 * * 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":292 * buf.read(4) * * if ndims == 1: # <<<<<<<<<<<<<< * # Fast path for flat arrays * elem_count = dims[0] */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/array.pyx":309 * * else: * result = _nested_array_decode(settings, buf, # <<<<<<<<<<<<<< * decoder, decoder_arg, ndims, dims, * elem_buf) */ /*else*/ { /* "asyncpg/protocol/codecs/array.pyx":311 * result = _nested_array_decode(settings, buf, * decoder, decoder_arg, ndims, dims, * elem_buf) # <<<<<<<<<<<<<< * * return result */ __pyx_t_2 = __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_2)) __PYX_ERR(6, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/array.pyx":309 * * else: * result = _nested_array_decode(settings, buf, # <<<<<<<<<<<<<< * decoder, decoder_arg, ndims, dims, * elem_buf) */ if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(6, 309, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L7:; /* "asyncpg/protocol/codecs/array.pyx":313 * 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":264 * * * cdef inline array_decode(ConnectionSettings settings, FastReadBuffer buf, # <<<<<<<<<<<<<< * decode_func_ex decoder, const void *decoder_arg): * cdef: */ /* function exit code */ __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_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((PyObject *)__pyx_v_elem_buf); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":316 * * * cdef _nested_array_decode(ConnectionSettings settings, # <<<<<<<<<<<<<< * FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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 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; int32_t __pyx_t_7; int64_t __pyx_t_8; int64_t __pyx_t_9; char const *__pyx_t_10; int64_t __pyx_t_11; int64_t __pyx_t_12; int __pyx_t_13; __Pyx_RefNannySetupContext("_nested_array_decode", 0); /* "asyncpg/protocol/codecs/array.pyx":326 * 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":333 * int32_t indexes[ARRAY_MAXDIM] * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if ndims <= 0: * raise RuntimeError('unexpected ndims value: {}'.format(ndims)) */ __pyx_t_1 = (ASYNCPG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":334 * * if ASYNCPG_DEBUG: * if ndims <= 0: # <<<<<<<<<<<<<< * raise RuntimeError('unexpected ndims value: {}'.format(ndims)) * */ __pyx_t_1 = ((__pyx_v_ndims <= 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":335 * if ASYNCPG_DEBUG: * if ndims <= 0: * raise RuntimeError('unexpected ndims value: {}'.format(ndims)) # <<<<<<<<<<<<<< * * for i in range(ndims): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_ndims_value, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 335, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 335, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(6, 335, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":334 * * if ASYNCPG_DEBUG: * if ndims <= 0: # <<<<<<<<<<<<<< * raise RuntimeError('unexpected ndims value: {}'.format(ndims)) * */ } /* "asyncpg/protocol/codecs/array.pyx":333 * int32_t indexes[ARRAY_MAXDIM] * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if ndims <= 0: * raise RuntimeError('unexpected ndims value: {}'.format(ndims)) */ } /* "asyncpg/protocol/codecs/array.pyx":337 * raise RuntimeError('unexpected ndims value: {}'.format(ndims)) * * for i in range(ndims): # <<<<<<<<<<<<<< * array_len *= dims[i] * indexes[i] = 0 */ __pyx_t_7 = __pyx_v_ndims; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "asyncpg/protocol/codecs/array.pyx":338 * * for i in range(ndims): * array_len *= dims[i] # <<<<<<<<<<<<<< * indexes[i] = 0 * */ __pyx_v_array_len = (__pyx_v_array_len * (__pyx_v_dims[__pyx_v_i])); /* "asyncpg/protocol/codecs/array.pyx":339 * for i in range(ndims): * array_len *= dims[i] * indexes[i] = 0 # <<<<<<<<<<<<<< * * for i in range(array_len): */ (__pyx_v_indexes[__pyx_v_i]) = 0; } /* "asyncpg/protocol/codecs/array.pyx":341 * indexes[i] = 0 * * for i in range(array_len): # <<<<<<<<<<<<<< * # Decode the element. * elem_len = hton.unpack_int32(buf.read(4)) */ __pyx_t_8 = __pyx_v_array_len; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; /* "asyncpg/protocol/codecs/array.pyx":343 * for i in range(array_len): * # Decode the element. * elem_len = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * if elem_len == -1: * elem = None */ __pyx_t_10 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_10 == ((char const *)NULL))) __PYX_ERR(6, 343, __pyx_L1_error) __pyx_v_elem_len = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_10); /* "asyncpg/protocol/codecs/array.pyx":344 * # Decode the element. * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ __pyx_t_1 = ((__pyx_v_elem_len == -1L) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":345 * elem_len = hton.unpack_int32(buf.read(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":344 * # Decode the element. * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ goto __pyx_L9; } /* "asyncpg/protocol/codecs/array.pyx":347 * elem = None * else: * elem = decoder(settings, # <<<<<<<<<<<<<< * elem_buf.slice_from(buf, elem_len), * decoder_arg) */ /*else*/ { /* "asyncpg/protocol/codecs/array.pyx":348 * else: * elem = decoder(settings, * elem_buf.slice_from(buf, elem_len), # <<<<<<<<<<<<<< * decoder_arg) * */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_slice_from(__pyx_v_elem_buf, __pyx_v_buf, __pyx_v_elem_len)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/array.pyx":347 * elem = None * else: * elem = decoder(settings, # <<<<<<<<<<<<<< * elem_buf.slice_from(buf, elem_len), * decoder_arg) */ __pyx_t_3 = __pyx_v_decoder(__pyx_v_settings, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_2), __pyx_v_decoder_arg); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L9:; /* "asyncpg/protocol/codecs/array.pyx":353 * # 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":357 * # 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_11 = __pyx_v_ndims-1; __pyx_t_11 >= 0; __pyx_t_11-=1) { __pyx_v_j = __pyx_t_11; /* "asyncpg/protocol/codecs/array.pyx":358 * # 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_1 = (((__pyx_v_indexes[__pyx_v_j]) == 0) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":360 * if indexes[j] == 0: * # Allocate the list for this array level. * stride = cpython.PyList_New(dims[j]) # <<<<<<<<<<<<<< * * strides[j] = stride */ __pyx_t_3 = PyList_New((__pyx_v_dims[__pyx_v_j])); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":362 * 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":365 * # 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":358 * # 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":367 * cpython.Py_INCREF(stride) * * stride = strides[j] # <<<<<<<<<<<<<< * cpython.PyList_SET_ITEM(stride, indexes[j], elem) * indexes[j] += 1 */ __pyx_t_3 = ((PyObject *)((PyObject *)(__pyx_v_strides[__pyx_v_j]))); __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":368 * * 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":369 * stride = strides[j] * cpython.PyList_SET_ITEM(stride, indexes[j], elem) * indexes[j] += 1 # <<<<<<<<<<<<<< * * if indexes[j] == dims[j] and j != 0: */ __pyx_t_12 = __pyx_v_j; (__pyx_v_indexes[__pyx_t_12]) = ((__pyx_v_indexes[__pyx_t_12]) + 1); /* "asyncpg/protocol/codecs/array.pyx":371 * 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_13 = (((__pyx_v_indexes[__pyx_v_j]) == (__pyx_v_dims[__pyx_v_j])) != 0); if (__pyx_t_13) { } else { __pyx_t_1 = __pyx_t_13; goto __pyx_L14_bool_binop_done; } __pyx_t_13 = ((__pyx_v_j != 0) != 0); __pyx_t_1 = __pyx_t_13; __pyx_L14_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":375 * # 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":379 * # 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":371 * 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_L13; } /* "asyncpg/protocol/codecs/array.pyx":381 * indexes[j] = 0 * else: * break # <<<<<<<<<<<<<< * * stride = strides[0] */ /*else*/ { goto __pyx_L11_break; } __pyx_L13:; } __pyx_L11_break:; } /* "asyncpg/protocol/codecs/array.pyx":383 * 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_3 = ((PyObject *)((PyObject *)(__pyx_v_strides[0]))); __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":387 * # 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":388 * # 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":316 * * * cdef _nested_array_decode(ConnectionSettings settings, # <<<<<<<<<<<<<< * FastReadBuffer buf, * 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._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":391 * * * cdef textarray_decode(ConnectionSettings settings, FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = 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; char const *__pyx_t_21; __Pyx_RefNannySetupContext("textarray_decode", 0); /* "asyncpg/protocol/codecs/array.pyx":400 * # Make a copy of array data since we will be mutating it for * # the purposes of element decoding. * s = text_decode(settings, buf) # <<<<<<<<<<<<<< * array_text = PyUnicode_AsUCS4Copy(s) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(6, 400, __pyx_L1_error) __pyx_v_s = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":401 * # the purposes of element decoding. * s = text_decode(settings, buf) * array_text = PyUnicode_AsUCS4Copy(s) # <<<<<<<<<<<<<< * * try: */ __pyx_v_array_text = PyUnicode_AsUCS4Copy(__pyx_v_s); /* "asyncpg/protocol/codecs/array.pyx":403 * array_text = 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_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/codecs/array.pyx":404 * * try: * return _textarray_decode( # <<<<<<<<<<<<<< * settings, array_text, decoder, decoder_arg, typdelim) * except ValueError as e: */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/codecs/array.pyx":405 * try: * return _textarray_decode( * settings, array_text, decoder, decoder_arg, typdelim) # <<<<<<<<<<<<<< * except ValueError as e: * raise ValueError( */ __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(6, 404, __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":403 * array_text = 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":406 * return _textarray_decode( * settings, array_text, decoder, decoder_arg, typdelim) * except ValueError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'malformed array literal {!r}: {}'.format(s, e.args[0])) */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_5) { __Pyx_AddTraceback("asyncpg.protocol.protocol.textarray_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(6, 406, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":408 * except ValueError as e: * raise ValueError( * 'malformed array literal {!r}: {}'.format(s, e.args[0])) # <<<<<<<<<<<<<< * finally: * PyMem_Free(array_text) */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_malformed_array_literal_r, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 408, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 408, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 408, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_s, __pyx_t_11}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 408, __pyx_L17_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_s, __pyx_t_11}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 408, __pyx_L17_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 408, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(__pyx_v_s); __Pyx_GIVEREF(__pyx_v_s); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_v_s); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 408, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/codecs/array.pyx":407 * settings, array_text, decoder, decoder_arg, typdelim) * except ValueError as e: * raise ValueError( # <<<<<<<<<<<<<< * 'malformed array literal {!r}: {}'.format(s, e.args[0])) * finally: */ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 407, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 407, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(6, 407, __pyx_L17_error) } /* "asyncpg/protocol/codecs/array.pyx":406 * return _textarray_decode( * settings, array_text, decoder, decoder_arg, typdelim) * except ValueError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'malformed array literal {!r}: {}'.format(s, e.args[0])) */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L17_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_5 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L8_except_error; } } } goto __pyx_L8_except_error; __pyx_L8_except_error:; /* "asyncpg/protocol/codecs/array.pyx":403 * array_text = PyUnicode_AsUCS4Copy(s) * * try: # <<<<<<<<<<<<<< * return _textarray_decode( * settings, array_text, decoder, decoder_arg, typdelim) */ __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_L4_error; __pyx_L10_try_return:; __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_L3_return; } } /* "asyncpg/protocol/codecs/array.pyx":410 * 'malformed array literal {!r}: {}'.format(s, e.args[0])) * finally: * PyMem_Free(array_text) # <<<<<<<<<<<<<< * * */ /*finally:*/ { /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L4_error:; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); __pyx_t_13 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_21 = __pyx_filename; { PyMem_Free(__pyx_v_array_text); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_21; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_18 = __pyx_r; __pyx_r = 0; PyMem_Free(__pyx_v_array_text); __pyx_r = __pyx_t_18; __pyx_t_18 = 0; goto __pyx_L0; } } /* "asyncpg/protocol/codecs/array.pyx":391 * * * cdef textarray_decode(ConnectionSettings settings, FastReadBuffer 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_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.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":413 * * * 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_item_buf = 0; char *__pyx_v_pg_item_str; Py_ssize_t __pyx_v_pg_item_len; 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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int32_t __pyx_t_8; PyObject *__pyx_t_9; int __pyx_t_10; long __pyx_t_11; __Pyx_RefNannySetupContext("_textarray_decode", 0); /* "asyncpg/protocol/codecs/array.pyx":424 * 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":425 * 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":426 * 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":429 * 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":432 * 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":433 * 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":434 * 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":436 * 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":437 * * 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":438 * 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":439 * 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":447 * object item * str item_text * FastReadBuffer item_buf = FastReadBuffer.new() # <<<<<<<<<<<<<< * char *pg_item_str * ssize_t pg_item_len */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_item_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":451 * ssize_t pg_item_len * * ptr = array_text # <<<<<<<<<<<<<< * * while True: */ __pyx_v_ptr = __pyx_v_array_text; /* "asyncpg/protocol/codecs/array.pyx":453 * ptr = array_text * * while True: # <<<<<<<<<<<<<< * while apg_ascii_isspace(ptr[0]): * ptr += 1 */ while (1) { /* "asyncpg/protocol/codecs/array.pyx":454 * * while True: * while apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * ptr += 1 * */ while (1) { __pyx_t_2 = (__pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])) != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/codecs/array.pyx":455 * 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":457 * ptr += 1 * * if ptr[0] != '[': # <<<<<<<<<<<<<< * # Finished parsing dimensions spec. * break */ __pyx_t_2 = (((__pyx_v_ptr[0]) != 91) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":459 * if ptr[0] != '[': * # Finished parsing dimensions spec. * break # <<<<<<<<<<<<<< * * ptr += 1 # '[' */ goto __pyx_L4_break; /* "asyncpg/protocol/codecs/array.pyx":457 * ptr += 1 * * if ptr[0] != '[': # <<<<<<<<<<<<<< * # Finished parsing dimensions spec. * break */ } /* "asyncpg/protocol/codecs/array.pyx":461 * break * * ptr += 1 # '[' # <<<<<<<<<<<<<< * * if ndims > ARRAY_MAXDIM: */ __pyx_v_ptr = (__pyx_v_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":463 * ptr += 1 # '[' * * if ndims > ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise ValueError( * 'number of array dimensions ({}) exceed the ' */ __pyx_t_2 = ((__pyx_v_ndims > 6) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":466 * raise ValueError( * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM)) # <<<<<<<<<<<<<< * * ptr = apg_parse_int32(ptr, &ubound) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_number_of_array_dimensions_excee, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_int_6}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 466, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_int_6}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 466, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_int_6); __Pyx_GIVEREF(__pyx_int_6); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_int_6); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":464 * * if ndims > ARRAY_MAXDIM: * raise ValueError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM)) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(6, 464, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":463 * ptr += 1 # '[' * * if ndims > ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise ValueError( * 'number of array dimensions ({}) exceed the ' */ } /* "asyncpg/protocol/codecs/array.pyx":468 * 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM)) * * ptr = apg_parse_int32(ptr, &ubound) # <<<<<<<<<<<<<< * if ptr == NULL: * raise ValueError('missing array dimension value') */ __pyx_v_ptr = __pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(__pyx_v_ptr, (&__pyx_v_ubound)); /* "asyncpg/protocol/codecs/array.pyx":469 * * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: # <<<<<<<<<<<<<< * raise ValueError('missing array dimension value') * */ __pyx_t_2 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":470 * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: * raise ValueError('missing array dimension value') # <<<<<<<<<<<<<< * * if ptr[0] == ':': */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 470, __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(6, 470, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":469 * * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: # <<<<<<<<<<<<<< * raise ValueError('missing array dimension value') * */ } /* "asyncpg/protocol/codecs/array.pyx":472 * raise ValueError('missing array dimension value') * * if ptr[0] == ':': # <<<<<<<<<<<<<< * ptr += 1 * lbound = ubound */ __pyx_t_2 = (((__pyx_v_ptr[0]) == 58) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":473 * * if ptr[0] == ':': * ptr += 1 # <<<<<<<<<<<<<< * lbound = ubound * */ __pyx_v_ptr = (__pyx_v_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":474 * 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":477 * * # [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_v_ptr = __pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(__pyx_v_ptr, (&__pyx_v_ubound)); /* "asyncpg/protocol/codecs/array.pyx":478 * # [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_2 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":479 * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: * raise ValueError('missing array dimension value') # <<<<<<<<<<<<<< * else: * lbound = 1 */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 479, __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(6, 479, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":478 * # [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":472 * raise ValueError('missing array dimension value') * * if ptr[0] == ':': # <<<<<<<<<<<<<< * ptr += 1 * lbound = ubound */ goto __pyx_L10; } /* "asyncpg/protocol/codecs/array.pyx":481 * raise ValueError('missing array dimension value') * else: * lbound = 1 # <<<<<<<<<<<<<< * * if ptr[0] != ']': */ /*else*/ { __pyx_v_lbound = 1; } __pyx_L10:; /* "asyncpg/protocol/codecs/array.pyx":483 * lbound = 1 * * if ptr[0] != ']': # <<<<<<<<<<<<<< * raise ValueError('missing \']\' after array dimensions') * */ __pyx_t_2 = (((__pyx_v_ptr[0]) != 93) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":484 * * if ptr[0] != ']': * raise ValueError('missing \']\' after array dimensions') # <<<<<<<<<<<<<< * * ptr += 1 # ']' */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 484, __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(6, 484, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":483 * lbound = 1 * * if ptr[0] != ']': # <<<<<<<<<<<<<< * raise ValueError('missing \']\' after array dimensions') * */ } /* "asyncpg/protocol/codecs/array.pyx":486 * 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":488 * 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":489 * * 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":491 * ndims += 1 * * if ndims != 0: # <<<<<<<<<<<<<< * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': */ __pyx_t_2 = ((__pyx_v_ndims != 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":493 * if ndims != 0: * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': # <<<<<<<<<<<<<< * raise ValueError('missing \'=\' after array dimensions') * */ __pyx_t_2 = (((__pyx_v_ptr[0]) != 61) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":494 * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': * raise ValueError('missing \'=\' after array dimensions') # <<<<<<<<<<<<<< * * ptr += 1 # '=' */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 494, __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(6, 494, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":493 * 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":496 * 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":500 * # 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_2 = (__pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])) != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/codecs/array.pyx":501 * # 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":506 * # 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_1 = __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_1)) __PYX_ERR(6, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":508 * _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_2 = ((__pyx_v_inferred_ndims != __pyx_v_ndims) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":509 * * if inferred_ndims != ndims: * raise ValueError( # <<<<<<<<<<<<<< * 'specified array dimensions do not match array content') * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 509, __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(6, 509, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":508 * _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":512 * 'specified array dimensions do not match array content') * * for i in range(ndims): # <<<<<<<<<<<<<< * if inferred_dims[i] != dims[i]: * raise ValueError( */ __pyx_t_8 = __pyx_v_ndims; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "asyncpg/protocol/codecs/array.pyx":513 * * for i in range(ndims): * if inferred_dims[i] != dims[i]: # <<<<<<<<<<<<<< * raise ValueError( * 'specified array dimensions do not match array content') */ __pyx_t_2 = (((__pyx_v_inferred_dims[__pyx_v_i]) != (__pyx_v_dims[__pyx_v_i])) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":514 * for i in range(ndims): * if inferred_dims[i] != dims[i]: * raise ValueError( # <<<<<<<<<<<<<< * 'specified array dimensions do not match array content') * else: */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 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(6, 514, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":513 * * 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":491 * ndims += 1 * * if ndims != 0: # <<<<<<<<<<<<<< * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': */ goto __pyx_L13; } /* "asyncpg/protocol/codecs/array.pyx":519 * # 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_1 = __pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(__pyx_v_ptr, __pyx_v_typdelim, __pyx_v_dims, (&__pyx_v_ndims)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L13:; /* "asyncpg/protocol/codecs/array.pyx":521 * _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_2 = ((!(__pyx_v_end_of_array != 0)) != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/codecs/array.pyx":525 * # 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":526 * # 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":531 * # 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":532 * # 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":534 * item_level = 0 * * while not end_of_item: # <<<<<<<<<<<<<< * if ptr[0] == '"': * in_quotes = not in_quotes */ while (1) { __pyx_t_2 = ((!(__pyx_v_end_of_item != 0)) != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/codecs/array.pyx":535 * * while not end_of_item: * if ptr[0] == '"': # <<<<<<<<<<<<<< * in_quotes = not in_quotes * if in_quotes: */ __pyx_t_2 = (((__pyx_v_ptr[0]) == 34) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":536 * 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 != 0)); /* "asyncpg/protocol/codecs/array.pyx":537 * if ptr[0] == '"': * in_quotes = not in_quotes * if in_quotes: # <<<<<<<<<<<<<< * strip_spaces = False * else: */ __pyx_t_2 = (__pyx_v_in_quotes != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":538 * 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":537 * if ptr[0] == '"': * in_quotes = not in_quotes * if in_quotes: # <<<<<<<<<<<<<< * strip_spaces = False * else: */ goto __pyx_L26; } /* "asyncpg/protocol/codecs/array.pyx":540 * 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":541 * else: * item_end = item_ptr * has_quoting = True # <<<<<<<<<<<<<< * * elif ptr[0] == '\\': */ __pyx_v_has_quoting = 1; /* "asyncpg/protocol/codecs/array.pyx":535 * * while not end_of_item: * if ptr[0] == '"': # <<<<<<<<<<<<<< * in_quotes = not in_quotes * if in_quotes: */ goto __pyx_L25; } /* "asyncpg/protocol/codecs/array.pyx":543 * has_quoting = True * * elif ptr[0] == '\\': # <<<<<<<<<<<<<< * # Quoted character, collapse the backslash. * ptr += 1 */ __pyx_t_2 = (((__pyx_v_ptr[0]) == 92) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":545 * 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":546 * # 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":547 * 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":548 * 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":549 * 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":550 * 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":543 * has_quoting = True * * elif ptr[0] == '\\': # <<<<<<<<<<<<<< * # Quoted character, collapse the backslash. * ptr += 1 */ goto __pyx_L25; } /* "asyncpg/protocol/codecs/array.pyx":552 * item_end = item_ptr * * elif in_quotes: # <<<<<<<<<<<<<< * # Consume the string until we see the closing quote. * item_ptr[0] = ptr[0] */ __pyx_t_2 = (__pyx_v_in_quotes != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":554 * 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":555 * # 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":552 * 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":557 * item_ptr += 1 * * elif ptr[0] == '{': # <<<<<<<<<<<<<< * # Nesting level increase. * nest_level += 1 */ __pyx_t_2 = (((__pyx_v_ptr[0]) == 0x7B) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":559 * 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":561 * 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":562 * * indexes[nest_level - 1] = 0 * new_stride = cpython.PyList_New(dims[nest_level - 1]) # <<<<<<<<<<<<<< * strides[nest_level - 1] = \ * (new_stride) */ __pyx_t_1 = PyList_New((__pyx_v_dims[(__pyx_v_nest_level - 1)])); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_new_stride, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":563 * 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":566 * (new_stride) * * if nest_level > 1: # <<<<<<<<<<<<<< * cpython.Py_INCREF(new_stride) * cpython.PyList_SET_ITEM( */ __pyx_t_2 = ((__pyx_v_nest_level > 1) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":567 * * 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":569 * cpython.Py_INCREF(new_stride) * cpython.PyList_SET_ITEM( * strides[nest_level - 2], # <<<<<<<<<<<<<< * indexes[nest_level - 2], * new_stride) */ __pyx_t_9 = ((PyObject *)(__pyx_v_strides[(__pyx_v_nest_level - 2)])); /* "asyncpg/protocol/codecs/array.pyx":568 * 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_9), (__pyx_v_indexes[(__pyx_v_nest_level - 2)]), __pyx_v_new_stride); /* "asyncpg/protocol/codecs/array.pyx":566 * (new_stride) * * if nest_level > 1: # <<<<<<<<<<<<<< * cpython.Py_INCREF(new_stride) * cpython.PyList_SET_ITEM( */ goto __pyx_L27; } /* "asyncpg/protocol/codecs/array.pyx":573 * 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":557 * item_ptr += 1 * * elif ptr[0] == '{': # <<<<<<<<<<<<<< * # Nesting level increase. * nest_level += 1 */ goto __pyx_L25; } /* "asyncpg/protocol/codecs/array.pyx":575 * result = new_stride * * elif ptr[0] == '}': # <<<<<<<<<<<<<< * if item_level == 0: * # Make sure we keep track of which nesting */ __pyx_t_2 = (((__pyx_v_ptr[0]) == 0x7D) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":576 * * 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_2 = ((__pyx_v_item_level == 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":581 * # 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":576 * * 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":583 * 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":585 * nest_level -= 1 * * if nest_level == 0: # <<<<<<<<<<<<<< * end_of_array = end_of_item = True * */ __pyx_t_2 = ((__pyx_v_nest_level == 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":586 * * 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":585 * nest_level -= 1 * * if nest_level == 0: # <<<<<<<<<<<<<< * end_of_array = end_of_item = True * */ } /* "asyncpg/protocol/codecs/array.pyx":575 * 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":588 * end_of_array = end_of_item = True * * elif ptr[0] == typdelim: # <<<<<<<<<<<<<< * # Array element delimiter, * end_of_item = True */ __pyx_t_2 = (((__pyx_v_ptr[0]) == __pyx_v_typdelim) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":590 * 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":591 * # Array element delimiter, * end_of_item = True * if item_level == 0: # <<<<<<<<<<<<<< * item_level = nest_level * */ __pyx_t_2 = ((__pyx_v_item_level == 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":592 * 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":591 * # Array element delimiter, * end_of_item = True * if item_level == 0: # <<<<<<<<<<<<<< * item_level = nest_level * */ } /* "asyncpg/protocol/codecs/array.pyx":588 * 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":594 * item_level = nest_level * * elif apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * if not strip_spaces: * item_ptr[0] = ptr[0] */ __pyx_t_2 = (__pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":595 * * elif apg_ascii_isspace(ptr[0]): * if not strip_spaces: # <<<<<<<<<<<<<< * item_ptr[0] = ptr[0] * item_ptr += 1 */ __pyx_t_2 = ((!(__pyx_v_strip_spaces != 0)) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":596 * 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":597 * 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":595 * * elif apg_ascii_isspace(ptr[0]): * if not strip_spaces: # <<<<<<<<<<<<<< * item_ptr[0] = ptr[0] * item_ptr += 1 */ } /* "asyncpg/protocol/codecs/array.pyx":594 * 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":601 * * 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":602 * 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":603 * 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":604 * 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":606 * item_end = item_ptr * * ptr += 1 # <<<<<<<<<<<<<< * * # end while not end_of_item */ __pyx_v_ptr = (__pyx_v_ptr + 1); } /* "asyncpg/protocol/codecs/array.pyx":610 * # end while not end_of_item * * if item_end == item_start: # <<<<<<<<<<<<<< * # Empty array * continue */ __pyx_t_2 = ((__pyx_v_item_end == __pyx_v_item_start) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":612 * if item_end == item_start: * # Empty array * continue # <<<<<<<<<<<<<< * * item_end[0] = '\0' */ goto __pyx_L21_continue; /* "asyncpg/protocol/codecs/array.pyx":610 * # end while not end_of_item * * if item_end == item_start: # <<<<<<<<<<<<<< * # Empty array * continue */ } /* "asyncpg/protocol/codecs/array.pyx":614 * 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":616 * item_end[0] = '\0' * * if not has_quoting and apg_strcasecmp(item_start, APG_NULL) == 0: # <<<<<<<<<<<<<< * # NULL element. * item = None */ __pyx_t_10 = ((!(__pyx_v_has_quoting != 0)) != 0); if (__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L34_bool_binop_done; } __pyx_t_10 = ((__pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp(__pyx_v_item_start, __pyx_v_7asyncpg_8protocol_8protocol_APG_NULL) == 0) != 0); __pyx_t_2 = __pyx_t_10; __pyx_L34_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":618 * 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":616 * 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":622 * # XXX: find a way to avoid the redundant encode/decode * # cycle here. * item_text = PyUnicode_FromKindAndData( # <<<<<<<<<<<<<< * PyUnicode_4BYTE_KIND, * item_start, */ /*else*/ { /* "asyncpg/protocol/codecs/array.pyx":625 * PyUnicode_4BYTE_KIND, * item_start, * item_end - item_start) # <<<<<<<<<<<<<< * * # Prepare the element buffer and call the text decoder */ __pyx_t_1 = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, ((void *)__pyx_v_item_start), (__pyx_v_item_end - __pyx_v_item_start)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/codecs/array.pyx":622 * # XXX: find a way to avoid the redundant encode/decode * # cycle here. * item_text = PyUnicode_FromKindAndData( # <<<<<<<<<<<<<< * PyUnicode_4BYTE_KIND, * item_start, */ if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(6, 622, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_item_text, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":629 * # Prepare the element buffer and call the text decoder * # for the element type. * as_pg_string_and_size( # <<<<<<<<<<<<<< * settings, item_text, &pg_item_str, &pg_item_len) * item_buf.buf = pg_item_str */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_as_pg_string_and_size(__pyx_v_settings, __pyx_v_item_text, (&__pyx_v_pg_item_str), (&__pyx_v_pg_item_len)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":631 * as_pg_string_and_size( * settings, item_text, &pg_item_str, &pg_item_len) * item_buf.buf = pg_item_str # <<<<<<<<<<<<<< * item_buf.len = pg_item_len * item = decoder(settings, item_buf, decoder_arg) */ __pyx_v_item_buf->buf = __pyx_v_pg_item_str; /* "asyncpg/protocol/codecs/array.pyx":632 * settings, item_text, &pg_item_str, &pg_item_len) * item_buf.buf = pg_item_str * item_buf.len = pg_item_len # <<<<<<<<<<<<<< * item = decoder(settings, item_buf, decoder_arg) * */ __pyx_v_item_buf->len = __pyx_v_pg_item_len; /* "asyncpg/protocol/codecs/array.pyx":633 * item_buf.buf = pg_item_str * item_buf.len = pg_item_len * item = decoder(settings, item_buf, decoder_arg) # <<<<<<<<<<<<<< * * # Place the decoded element in the array. */ __pyx_t_1 = __pyx_v_decoder(__pyx_v_settings, __pyx_v_item_buf, __pyx_v_decoder_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L33:; /* "asyncpg/protocol/codecs/array.pyx":636 * * # 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":638 * cpython.Py_INCREF(item) * cpython.PyList_SET_ITEM( * strides[item_level - 1], # <<<<<<<<<<<<<< * indexes[item_level - 1], * item) */ __pyx_t_9 = ((PyObject *)(__pyx_v_strides[(__pyx_v_item_level - 1)])); /* "asyncpg/protocol/codecs/array.pyx":637 * # 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_9), (__pyx_v_indexes[(__pyx_v_item_level - 1)]), __pyx_v_item); /* "asyncpg/protocol/codecs/array.pyx":642 * item) * * if nest_level > 0: # <<<<<<<<<<<<<< * indexes[nest_level - 1] += 1 * */ __pyx_t_2 = ((__pyx_v_nest_level > 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":643 * * if nest_level > 0: * indexes[nest_level - 1] += 1 # <<<<<<<<<<<<<< * * return result */ __pyx_t_11 = (__pyx_v_nest_level - 1); (__pyx_v_indexes[__pyx_t_11]) = ((__pyx_v_indexes[__pyx_t_11]) + 1); /* "asyncpg/protocol/codecs/array.pyx":642 * item) * * if nest_level > 0: # <<<<<<<<<<<<<< * indexes[nest_level - 1] += 1 * */ } __pyx_L21_continue:; } /* "asyncpg/protocol/codecs/array.pyx":645 * indexes[nest_level - 1] += 1 * * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); __PYX_ERR(6, 645, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":413 * * * cdef _textarray_decode(ConnectionSettings settings, # <<<<<<<<<<<<<< * Py_UCS4 *array_text, * decode_func_ex decoder, */ /* 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_7); __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_XDECREF((PyObject *)__pyx_v_item_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":657 * * * 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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("_UnexpectedCharacter", 0); /* "asyncpg/protocol/codecs/array.pyx":658 * * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr): * return ValueError('unexpected character {!r} at position {}'.format( # <<<<<<<<<<<<<< * cpython.PyUnicode_FromOrdinal(ptr[0]), ptr - array_text + 1)) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_character_r_at_positi, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/array.pyx":659 * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr): * return ValueError('unexpected character {!r} at position {}'.format( * cpython.PyUnicode_FromOrdinal(ptr[0]), ptr - array_text + 1)) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyUnicode_FromOrdinal(((int)(__pyx_v_ptr[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t(((__pyx_v_ptr - __pyx_v_array_text) + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 658, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 658, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/array.pyx":658 * * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr): * return ValueError('unexpected character {!r} at position {}'.format( # <<<<<<<<<<<<<< * cpython.PyUnicode_FromOrdinal(ptr[0]), ptr - array_text + 1)) * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":657 * * * 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_7); __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":662 * * * cdef _infer_array_dims(const Py_UCS4 *array_text, # <<<<<<<<<<<<<< * Py_UCS4 typdelim, * int32_t *dims, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(Py_UCS4 const *__pyx_v_array_text, Py_UCS4 __pyx_v_typdelim, int32_t *__pyx_v_dims, int32_t *__pyx_v_ndims) { Py_UCS4 const *__pyx_v_ptr; int __pyx_v_i; int __pyx_v_nest_level; int __pyx_v_end_of_array; int __pyx_v_end_of_item; int __pyx_v_in_quotes; int __pyx_v_array_is_empty; int __pyx_v_stride_len[6]; int __pyx_v_prev_stride_len[6]; enum __pyx_t_7asyncpg_8protocol_8protocol__ArrayParseState __pyx_v_parse_state; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; long __pyx_t_10; __Pyx_RefNannySetupContext("_infer_array_dims", 0); /* "asyncpg/protocol/codecs/array.pyx":667 * 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":669 * 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":670 * 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":671 * 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":672 * 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":673 * 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":676 * 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":678 * _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":679 * * 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":680 * 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":682 * stride_len[i] = 1 * * while not end_of_array: # <<<<<<<<<<<<<< * end_of_item = False * */ while (1) { __pyx_t_2 = ((!(__pyx_v_end_of_array != 0)) != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/codecs/array.pyx":683 * * 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":685 * 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 != 0)) != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/codecs/array.pyx":686 * * while not end_of_item: * if ptr[0] == '\0': # <<<<<<<<<<<<<< * raise ValueError('unexpected end of string') * */ __pyx_t_2 = (((__pyx_v_ptr[0]) == 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":687 * while not end_of_item: * if ptr[0] == '\0': * raise ValueError('unexpected end of string') # <<<<<<<<<<<<<< * * elif ptr[0] == '"': */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 687, __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(6, 687, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":686 * * while not end_of_item: * if ptr[0] == '\0': # <<<<<<<<<<<<<< * raise ValueError('unexpected end of string') * */ } /* "asyncpg/protocol/codecs/array.pyx":689 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":690 * * 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: /* "asyncpg/protocol/codecs/array.pyx":691 * 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) */ case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED: /* "asyncpg/protocol/codecs/array.pyx":690 * * elif ptr[0] == '"': * if (parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_DELIMITED) and * not (parse_state == APS_ELEM_STARTED and in_quotes)): */ __pyx_t_4 = 0; break; default: __pyx_t_4 = 1; break; } __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L11_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":692 * if (parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_DELIMITED) and * not (parse_state == APS_ELEM_STARTED and in_quotes)): # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ __pyx_t_4 = ((__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED) != 0); if (__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L13_bool_binop_done; } __pyx_t_4 = (__pyx_v_in_quotes != 0); __pyx_t_5 = __pyx_t_4; __pyx_L13_bool_binop_done:; __pyx_t_4 = ((!__pyx_t_5) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L11_bool_binop_done:; /* "asyncpg/protocol/codecs/array.pyx":690 * * 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 (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":693 * 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(6, 693, __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(6, 693, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":690 * * 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":695 * 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 != 0)); /* "asyncpg/protocol/codecs/array.pyx":696 * * in_quotes = not in_quotes * if in_quotes: # <<<<<<<<<<<<<< * parse_state = APS_ELEM_STARTED * array_is_empty = False */ __pyx_t_2 = (__pyx_v_in_quotes != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":697 * 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":698 * 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":696 * * in_quotes = not in_quotes * if in_quotes: # <<<<<<<<<<<<<< * parse_state = APS_ELEM_STARTED * array_is_empty = False */ } /* "asyncpg/protocol/codecs/array.pyx":689 * 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":700 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":701 * * 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: /* "asyncpg/protocol/codecs/array.pyx":702 * 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_STARTED: /* "asyncpg/protocol/codecs/array.pyx":703 * 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":701 * * elif ptr[0] == '\\': * if parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): */ __pyx_t_2 = 0; break; default: __pyx_t_2 = 1; break; } __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":704 * 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(6, 704, __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(6, 704, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":701 * * elif ptr[0] == '\\': * if parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): */ } /* "asyncpg/protocol/codecs/array.pyx":706 * 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":707 * * parse_state = APS_ELEM_STARTED * array_is_empty = False # <<<<<<<<<<<<<< * * if ptr[1] != '\0': */ __pyx_v_array_is_empty = 0; /* "asyncpg/protocol/codecs/array.pyx":709 * array_is_empty = False * * if ptr[1] != '\0': # <<<<<<<<<<<<<< * ptr += 1 * else: */ __pyx_t_4 = (((__pyx_v_ptr[1]) != 0) != 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":710 * * 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":709 * array_is_empty = False * * if ptr[1] != '\0': # <<<<<<<<<<<<<< * ptr += 1 * else: */ goto __pyx_L17; } /* "asyncpg/protocol/codecs/array.pyx":712 * ptr += 1 * else: * raise ValueError('unexpected end of string') # <<<<<<<<<<<<<< * * elif in_quotes: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 712, __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(6, 712, __pyx_L1_error) } __pyx_L17:; /* "asyncpg/protocol/codecs/array.pyx":700 * 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":714 * raise ValueError('unexpected end of string') * * elif in_quotes: # <<<<<<<<<<<<<< * # Ignore everything inside the quotes. * pass */ __pyx_t_4 = (__pyx_v_in_quotes != 0); if (__pyx_t_4) { goto __pyx_L9; } /* "asyncpg/protocol/codecs/array.pyx":718 * pass * * elif ptr[0] == '{': # <<<<<<<<<<<<<< * if parse_state not in (APS_START, * APS_STRIDE_STARTED, */ __pyx_t_4 = (((__pyx_v_ptr[0]) == 0x7B) != 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":719 * * 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: /* "asyncpg/protocol/codecs/array.pyx":720 * 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_STARTED: /* "asyncpg/protocol/codecs/array.pyx":721 * 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":719 * * elif ptr[0] == '{': * if parse_state not in (APS_START, # <<<<<<<<<<<<<< * APS_STRIDE_STARTED, * APS_STRIDE_DELIMITED): */ __pyx_t_4 = 0; break; default: __pyx_t_4 = 1; break; } __pyx_t_2 = (__pyx_t_4 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":722 * 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(6, 722, __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(6, 722, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":719 * * elif ptr[0] == '{': * if parse_state not in (APS_START, # <<<<<<<<<<<<<< * APS_STRIDE_STARTED, * APS_STRIDE_DELIMITED): */ } /* "asyncpg/protocol/codecs/array.pyx":724 * 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":725 * * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":728 * raise ValueError( * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format( # <<<<<<<<<<<<<< * nest_level, ARRAY_MAXDIM)) * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_number_of_array_dimensions_excee, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/codecs/array.pyx":729 * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format( * nest_level, ARRAY_MAXDIM)) # <<<<<<<<<<<<<< * * dims[nest_level] = 0 */ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_nest_level); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_int_6}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 728, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_int_6}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 728, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_int_6); __Pyx_GIVEREF(__pyx_int_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_int_6); __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/array.pyx":726 * parse_state = APS_STRIDE_STARTED * if nest_level >= ARRAY_MAXDIM: * raise ValueError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format( */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 726, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":725 * * parse_state = APS_STRIDE_STARTED * if nest_level >= ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise ValueError( * 'number of array dimensions ({}) exceed the ' */ } /* "asyncpg/protocol/codecs/array.pyx":731 * 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":732 * * 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":733 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":734 * 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":733 * dims[nest_level] = 0 * nest_level += 1 * if ndims[0] < nest_level: # <<<<<<<<<<<<<< * ndims[0] = nest_level * */ } /* "asyncpg/protocol/codecs/array.pyx":718 * pass * * elif ptr[0] == '{': # <<<<<<<<<<<<<< * if parse_state not in (APS_START, * APS_STRIDE_STARTED, */ goto __pyx_L9; } /* "asyncpg/protocol/codecs/array.pyx":736 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":737 * * elif ptr[0] == '}': * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and # <<<<<<<<<<<<<< * not (nest_level == 1 and * parse_state == APS_STRIDE_STARTED)): */ switch (__pyx_v_parse_state) { case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED: case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE: __pyx_t_4 = 0; break; default: __pyx_t_4 = 1; break; } __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L22_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":738 * elif ptr[0] == '}': * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and * not (nest_level == 1 and # <<<<<<<<<<<<<< * parse_state == APS_STRIDE_STARTED)): * raise _UnexpectedCharacter(array_text, ptr) */ __pyx_t_4 = ((__pyx_v_nest_level == 1) != 0); if (__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L24_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":739 * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and * not (nest_level == 1 and * parse_state == APS_STRIDE_STARTED)): # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ __pyx_t_4 = ((__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED) != 0); __pyx_t_5 = __pyx_t_4; __pyx_L24_bool_binop_done:; /* "asyncpg/protocol/codecs/array.pyx":738 * elif ptr[0] == '}': * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and * not (nest_level == 1 and # <<<<<<<<<<<<<< * parse_state == APS_STRIDE_STARTED)): * raise _UnexpectedCharacter(array_text, ptr) */ __pyx_t_4 = ((!__pyx_t_5) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L22_bool_binop_done:; /* "asyncpg/protocol/codecs/array.pyx":737 * * 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 (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":740 * 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(6, 740, __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(6, 740, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":737 * * 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":742 * 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":744 * parse_state = APS_STRIDE_DONE * * if nest_level == 0: # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ __pyx_t_2 = ((__pyx_v_nest_level == 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":745 * * 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(6, 745, __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(6, 745, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":744 * parse_state = APS_STRIDE_DONE * * if nest_level == 0: # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ } /* "asyncpg/protocol/codecs/array.pyx":747 * 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":749 * nest_level -= 1 * * if (prev_stride_len[nest_level] != 0 and # <<<<<<<<<<<<<< * stride_len[nest_level] != prev_stride_len[nest_level]): * raise ValueError( */ __pyx_t_4 = (((__pyx_v_prev_stride_len[__pyx_v_nest_level]) != 0) != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L28_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":750 * * if (prev_stride_len[nest_level] != 0 and * stride_len[nest_level] != prev_stride_len[nest_level]): # <<<<<<<<<<<<<< * raise ValueError( * 'inconsistent sub-array dimensions' */ __pyx_t_4 = (((__pyx_v_stride_len[__pyx_v_nest_level]) != (__pyx_v_prev_stride_len[__pyx_v_nest_level])) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L28_bool_binop_done:; /* "asyncpg/protocol/codecs/array.pyx":749 * nest_level -= 1 * * if (prev_stride_len[nest_level] != 0 and # <<<<<<<<<<<<<< * stride_len[nest_level] != prev_stride_len[nest_level]): * raise ValueError( */ if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":753 * raise ValueError( * 'inconsistent sub-array dimensions' * ' at position {}'.format( # <<<<<<<<<<<<<< * ptr - array_text + 1)) * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_inconsistent_sub_array_dimension, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/codecs/array.pyx":754 * 'inconsistent sub-array dimensions' * ' at position {}'.format( * ptr - array_text + 1)) # <<<<<<<<<<<<<< * * prev_stride_len[nest_level] = stride_len[nest_level] */ __pyx_t_9 = __Pyx_PyInt_From_ptrdiff_t(((__pyx_v_ptr - __pyx_v_array_text) + 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_7) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_9}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 753, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_9}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 753, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/array.pyx":751 * 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_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 751, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":749 * 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":756 * 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":757 * * 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":758 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":759 * 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":758 * 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":761 * end_of_array = end_of_item = True * else: * dims[nest_level - 1] += 1 # <<<<<<<<<<<<<< * * elif ptr[0] == typdelim: */ /*else*/ { __pyx_t_10 = (__pyx_v_nest_level - 1); (__pyx_v_dims[__pyx_t_10]) = ((__pyx_v_dims[__pyx_t_10]) + 1); } __pyx_L30:; /* "asyncpg/protocol/codecs/array.pyx":736 * 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":763 * 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) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":764 * * elif ptr[0] == typdelim: * if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE): # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ switch (__pyx_v_parse_state) { case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED: case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE: __pyx_t_2 = 0; break; default: __pyx_t_2 = 1; break; } __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":765 * 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(6, 765, __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(6, 765, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":764 * * 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":767 * raise _UnexpectedCharacter(array_text, ptr) * * if parse_state == APS_STRIDE_DONE: # <<<<<<<<<<<<<< * parse_state = APS_STRIDE_DELIMITED * else: */ __pyx_t_4 = ((__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE) != 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":768 * * 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":767 * 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":770 * 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":771 * 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":772 * parse_state = APS_ELEM_DELIMITED * end_of_item = True * stride_len[nest_level - 1] += 1 # <<<<<<<<<<<<<< * * elif not apg_ascii_isspace(ptr[0]): */ __pyx_t_10 = (__pyx_v_nest_level - 1); (__pyx_v_stride_len[__pyx_t_10]) = ((__pyx_v_stride_len[__pyx_t_10]) + 1); /* "asyncpg/protocol/codecs/array.pyx":763 * 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":774 * stride_len[nest_level - 1] += 1 * * elif not apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * if parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_STARTED, */ __pyx_t_4 = ((!(__pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])) != 0)) != 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":775 * * 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: /* "asyncpg/protocol/codecs/array.pyx":776 * 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_STARTED: /* "asyncpg/protocol/codecs/array.pyx":777 * 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":775 * * elif not apg_ascii_isspace(ptr[0]): * if parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): */ __pyx_t_4 = 0; break; default: __pyx_t_4 = 1; break; } __pyx_t_2 = (__pyx_t_4 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":778 * 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(6, 778, __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(6, 778, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":775 * * 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":780 * 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":781 * * 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":774 * 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":783 * array_is_empty = False * * if not end_of_item: # <<<<<<<<<<<<<< * ptr += 1 * */ __pyx_t_2 = ((!(__pyx_v_end_of_item != 0)) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":784 * * if not end_of_item: * ptr += 1 # <<<<<<<<<<<<<< * * if not array_is_empty: */ __pyx_v_ptr = (__pyx_v_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":783 * array_is_empty = False * * if not end_of_item: # <<<<<<<<<<<<<< * ptr += 1 * */ } } /* "asyncpg/protocol/codecs/array.pyx":786 * ptr += 1 * * if not array_is_empty: # <<<<<<<<<<<<<< * dims[ndims[0] - 1] += 1 * */ __pyx_t_2 = ((!(__pyx_v_array_is_empty != 0)) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":787 * * if not array_is_empty: * dims[ndims[0] - 1] += 1 # <<<<<<<<<<<<<< * * ptr += 1 */ __pyx_t_10 = ((__pyx_v_ndims[0]) - 1); (__pyx_v_dims[__pyx_t_10]) = ((__pyx_v_dims[__pyx_t_10]) + 1); /* "asyncpg/protocol/codecs/array.pyx":786 * ptr += 1 * * if not array_is_empty: # <<<<<<<<<<<<<< * dims[ndims[0] - 1] += 1 * */ } /* "asyncpg/protocol/codecs/array.pyx":789 * 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":792 * * # 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_2 = (((__pyx_v_ptr[0]) != 0) != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/codecs/array.pyx":793 * # 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_2 = ((!(__pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])) != 0)) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":794 * 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(6, 794, __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(6, 794, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":793 * # 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":796 * raise _UnexpectedCharacter(array_text, ptr) * * ptr += 1 # <<<<<<<<<<<<<< * * if array_is_empty: */ __pyx_v_ptr = (__pyx_v_ptr + 1); } /* "asyncpg/protocol/codecs/array.pyx":798 * ptr += 1 * * if array_is_empty: # <<<<<<<<<<<<<< * ndims[0] = 0 * */ __pyx_t_2 = (__pyx_v_array_is_empty != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":799 * * if array_is_empty: * ndims[0] = 0 # <<<<<<<<<<<<<< * * */ (__pyx_v_ndims[0]) = 0; /* "asyncpg/protocol/codecs/array.pyx":798 * ptr += 1 * * if array_is_empty: # <<<<<<<<<<<<<< * ndims[0] = 0 * */ } /* "asyncpg/protocol/codecs/array.pyx":662 * * * cdef _infer_array_dims(const Py_UCS4 *array_text, # <<<<<<<<<<<<<< * Py_UCS4 typdelim, * int32_t *dims, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __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":802 * * * cdef int4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, # <<<<<<<<<<<<<< * const void *arg): * return int4_encode(settings, buf, obj) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int4_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("int4_encode_ex", 0); /* "asyncpg/protocol/codecs/array.pyx":804 * cdef int4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, * const void *arg): * return int4_encode(settings, buf, obj) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_int4_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 804, __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":802 * * * cdef int4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, # <<<<<<<<<<<<<< * const void *arg): * return int4_encode(settings, buf, obj) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.int4_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":807 * * * cdef int4_decode_ex(ConnectionSettings settings, FastReadBuffer buf, # <<<<<<<<<<<<<< * const void *arg): * return int4_decode(settings, buf) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_int4_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf, CYTHON_UNUSED void const *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("int4_decode_ex", 0); /* "asyncpg/protocol/codecs/array.pyx":809 * cdef int4_decode_ex(ConnectionSettings settings, FastReadBuffer buf, * const void *arg): * return int4_decode(settings, buf) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_int4_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 809, __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":807 * * * cdef int4_decode_ex(ConnectionSettings settings, FastReadBuffer buf, # <<<<<<<<<<<<<< * const void *arg): * return int4_decode(settings, buf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.int4_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":812 * * * cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items): # <<<<<<<<<<<<<< * array_encode(settings, buf, items, OIDOID, * &int4_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_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_items) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("arrayoid_encode", 0); /* "asyncpg/protocol/codecs/array.pyx":813 * * cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items): * array_encode(settings, buf, items, OIDOID, # <<<<<<<<<<<<<< * &int4_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_int4_encode_ex)), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":812 * * * cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items): # <<<<<<<<<<<<<< * array_encode(settings, buf, items, OIDOID, * &int4_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":817 * * * cdef arrayoid_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return array_decode(settings, buf, &int4_decode_ex, NULL) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("arrayoid_decode", 0); /* "asyncpg/protocol/codecs/array.pyx":818 * * cdef arrayoid_decode(ConnectionSettings settings, FastReadBuffer buf): * return array_decode(settings, buf, &int4_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_int4_decode_ex)), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 818, __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":817 * * * cdef arrayoid_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * return array_decode(settings, buf, &int4_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":821 * * * cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, # <<<<<<<<<<<<<< * const void *arg): * return 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_8protocol_8protocol_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; __Pyx_RefNannySetupContext("text_encode_ex", 0); /* "asyncpg/protocol/codecs/array.pyx":823 * cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, * const void *arg): * return text_encode(settings, buf, obj) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_text_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 823, __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":821 * * * cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, # <<<<<<<<<<<<<< * const void *arg): * return 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":826 * * * cdef text_decode_ex(ConnectionSettings settings, FastReadBuffer buf, # <<<<<<<<<<<<<< * const void *arg): * return 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf, CYTHON_UNUSED void const *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("text_decode_ex", 0); /* "asyncpg/protocol/codecs/array.pyx":828 * cdef text_decode_ex(ConnectionSettings settings, FastReadBuffer buf, * const void *arg): * return text_decode(settings, buf) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 828, __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":826 * * * cdef text_decode_ex(ConnectionSettings settings, FastReadBuffer buf, # <<<<<<<<<<<<<< * const void *arg): * return 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":831 * * * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_items) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("arraytext_encode", 0); /* "asyncpg/protocol/codecs/array.pyx":832 * * 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(6, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":831 * * * 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":836 * * * cdef arraytext_decode(ConnectionSettings settings, FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("arraytext_decode", 0); /* "asyncpg/protocol/codecs/array.pyx":837 * * cdef arraytext_decode(ConnectionSettings settings, FastReadBuffer 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(6, 837, __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":836 * * * cdef arraytext_decode(ConnectionSettings settings, FastReadBuffer 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":840 * * * cdef anyarray_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * # Instances of anyarray (or any other polymorphic pseudotype) are * # never supposed to be returned from actual queries. */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anyarray_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("anyarray_decode", 0); /* "asyncpg/protocol/codecs/array.pyx":843 * # Instances of anyarray (or any other polymorphic pseudotype) are * # never supposed to be returned from actual queries. * raise RuntimeError('unexpected instance of \'anyarray\' type') # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 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(6, 843, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":840 * * * cdef anyarray_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * # Instances of anyarray (or any other polymorphic pseudotype) are * # never supposed to be returned from actual queries. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.anyarray_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":846 * * * cdef init_array_codecs(): # <<<<<<<<<<<<<< * register_core_codec(ANYARRAYOID, * NULL, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_array_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_array_codecs", 0); /* "asyncpg/protocol/codecs/array.pyx":847 * * cdef init_array_codecs(): * register_core_codec(ANYARRAYOID, # <<<<<<<<<<<<<< * NULL, * &anyarray_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x8E5, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_anyarray_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":855 * # 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(6, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":860 * 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(6, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":846 * * * cdef init_array_codecs(): # <<<<<<<<<<<<<< * register_core_codec(ANYARRAYOID, * 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.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":24 * * * 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; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_range_has_lbound", 0); /* "asyncpg/protocol/codecs/range.pyx":25 * * cdef inline bint _range_has_lbound(uint8_t flags): * return not (flags & (RANGE_EMPTY | RANGE_LB_INF)) # <<<<<<<<<<<<<< * * */ __pyx_r = (!((__pyx_v_flags & 9) != 0)); goto __pyx_L0; /* "asyncpg/protocol/codecs/range.pyx":24 * * * cdef inline bint _range_has_lbound(uint8_t flags): # <<<<<<<<<<<<<< * return not (flags & (RANGE_EMPTY | RANGE_LB_INF)) * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":28 * * * 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; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_range_has_ubound", 0); /* "asyncpg/protocol/codecs/range.pyx":29 * * cdef inline bint _range_has_ubound(uint8_t flags): * return not (flags & (RANGE_EMPTY | RANGE_UB_INF)) # <<<<<<<<<<<<<< * * */ __pyx_r = (!((__pyx_v_flags & 17) != 0)); goto __pyx_L0; /* "asyncpg/protocol/codecs/range.pyx":28 * * * cdef inline bint _range_has_ubound(uint8_t flags): # <<<<<<<<<<<<<< * return not (flags & (RANGE_EMPTY | RANGE_UB_INF)) * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":32 * * * 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; __Pyx_RefNannySetupContext("_range_type", 0); /* "asyncpg/protocol/codecs/range.pyx":33 * * 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) != 0); 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) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "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 # <<<<<<<<<<<<<< * 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":33 * * 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":35 * 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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Range); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 35, __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(23, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/range.pyx":36 * 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":35 * 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":38 * 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":32 * * * 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_WriteUnraisable("asyncpg.protocol.protocol._range_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = (enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType) 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":41 * * * 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_8protocol_8protocol_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_8protocol_8protocol_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; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int32_t __pyx_t_9; __Pyx_RefNannySetupContext("range_encode", 0); /* "asyncpg/protocol/codecs/range.pyx":46 * cdef: * ssize_t obj_len * uint8_t flags = 0 # <<<<<<<<<<<<<< * object lower = None * object upper = None */ __pyx_v_flags = 0; /* "asyncpg/protocol/codecs/range.pyx":47 * 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":48 * 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":49 * object lower = None * object upper = None * WriteBuffer bounds_data = WriteBuffer.new() # <<<<<<<<<<<<<< * _RangeArgumentType arg_type = _range_type(obj) * */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds_data = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":50 * object upper = None * WriteBuffer bounds_data = WriteBuffer.new() * _RangeArgumentType arg_type = _range_type(obj) # <<<<<<<<<<<<<< * * if arg_type == _RANGE_ARGUMENT_INVALID: */ __pyx_v_arg_type = __pyx_f_7asyncpg_8protocol_8protocol__range_type(__pyx_v_obj); /* "asyncpg/protocol/codecs/range.pyx":52 * _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":54 * if arg_type == _RANGE_ARGUMENT_INVALID: * raise TypeError( * 'list, tuple or Range object expected (got type {})'.format( # <<<<<<<<<<<<<< * type(obj))) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_list_tuple_or_Range_object_expec, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/range.pyx":55 * raise TypeError( * 'list, tuple or Range object expected (got type {})'.format( * type(obj))) # <<<<<<<<<<<<<< * * elif arg_type == _RANGE_ARGUMENT_TUPLE: */ __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)Py_TYPE(__pyx_v_obj))}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 54, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)Py_TYPE(__pyx_v_obj))}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 54, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_obj))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_obj))); PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)Py_TYPE(__pyx_v_obj))); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/range.pyx":53 * * if arg_type == _RANGE_ARGUMENT_INVALID: * raise TypeError( # <<<<<<<<<<<<<< * 'list, tuple or Range object expected (got type {})'.format( * type(obj))) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(23, 53, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":52 * _RangeArgumentType arg_type = _range_type(obj) * * if arg_type == _RANGE_ARGUMENT_INVALID: # <<<<<<<<<<<<<< * raise TypeError( * 'list, tuple or Range object expected (got type {})'.format( */ break; /* "asyncpg/protocol/codecs/range.pyx":57 * type(obj))) * * elif arg_type == _RANGE_ARGUMENT_TUPLE: # <<<<<<<<<<<<<< * obj_len = len(obj) * if obj_len == 2: */ case __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_TUPLE: /* "asyncpg/protocol/codecs/range.pyx":58 * * elif arg_type == _RANGE_ARGUMENT_TUPLE: * obj_len = len(obj) # <<<<<<<<<<<<<< * if obj_len == 2: * lower = obj[0] */ __pyx_t_5 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(23, 58, __pyx_L1_error) __pyx_v_obj_len = __pyx_t_5; /* "asyncpg/protocol/codecs/range.pyx":59 * elif arg_type == _RANGE_ARGUMENT_TUPLE: * obj_len = len(obj) * if obj_len == 2: # <<<<<<<<<<<<<< * lower = obj[0] * upper = obj[1] */ __pyx_t_6 = ((__pyx_v_obj_len == 2) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/range.pyx":60 * 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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 60, __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":61 * 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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 61, __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":63 * upper = obj[1] * * if lower is None: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INF * */ __pyx_t_6 = (__pyx_v_lower == Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":64 * * if lower is None: * flags |= RANGE_LB_INF # <<<<<<<<<<<<<< * * if upper is None: */ __pyx_v_flags = (__pyx_v_flags | 8); /* "asyncpg/protocol/codecs/range.pyx":63 * upper = obj[1] * * if lower is None: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INF * */ } /* "asyncpg/protocol/codecs/range.pyx":66 * flags |= RANGE_LB_INF * * if upper is None: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INF * */ __pyx_t_7 = (__pyx_v_upper == Py_None); __pyx_t_6 = (__pyx_t_7 != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/range.pyx":67 * * 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":66 * flags |= RANGE_LB_INF * * if upper is None: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INF * */ } /* "asyncpg/protocol/codecs/range.pyx":69 * flags |= RANGE_UB_INF * * flags |= RANGE_LB_INC | RANGE_UB_INC # <<<<<<<<<<<<<< * * elif obj_len == 1: */ __pyx_v_flags = (__pyx_v_flags | 6); /* "asyncpg/protocol/codecs/range.pyx":59 * elif arg_type == _RANGE_ARGUMENT_TUPLE: * obj_len = len(obj) * if obj_len == 2: # <<<<<<<<<<<<<< * lower = obj[0] * upper = obj[1] */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/range.pyx":71 * flags |= RANGE_LB_INC | RANGE_UB_INC * * elif obj_len == 1: # <<<<<<<<<<<<<< * lower = obj[0] * flags |= RANGE_LB_INC | RANGE_UB_INF */ __pyx_t_6 = ((__pyx_v_obj_len == 1) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/range.pyx":72 * * 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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 72, __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":73 * elif obj_len == 1: * lower = obj[0] * flags |= RANGE_LB_INC | RANGE_UB_INF # <<<<<<<<<<<<<< * * elif obj_len == 0: */ __pyx_v_flags = (__pyx_v_flags | 18); /* "asyncpg/protocol/codecs/range.pyx":71 * flags |= RANGE_LB_INC | RANGE_UB_INC * * elif obj_len == 1: # <<<<<<<<<<<<<< * lower = obj[0] * flags |= RANGE_LB_INC | RANGE_UB_INF */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/range.pyx":75 * flags |= RANGE_LB_INC | RANGE_UB_INF * * elif obj_len == 0: # <<<<<<<<<<<<<< * flags |= RANGE_EMPTY * */ __pyx_t_6 = ((__pyx_v_obj_len == 0) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/range.pyx":76 * * elif obj_len == 0: * flags |= RANGE_EMPTY # <<<<<<<<<<<<<< * * else: */ __pyx_v_flags = (__pyx_v_flags | 1); /* "asyncpg/protocol/codecs/range.pyx":75 * flags |= RANGE_LB_INC | RANGE_UB_INF * * elif obj_len == 0: # <<<<<<<<<<<<<< * flags |= RANGE_EMPTY * */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/range.pyx":79 * * else: * raise ValueError( # <<<<<<<<<<<<<< * 'expected 0, 1 or 2 elements in range (got {})'.format( * obj_len)) */ /*else*/ { /* "asyncpg/protocol/codecs/range.pyx":80 * else: * raise ValueError( * 'expected 0, 1 or 2 elements in range (got {})'.format( # <<<<<<<<<<<<<< * obj_len)) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_expected_0_1_or_2_elements_in_ra, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/range.pyx":81 * raise ValueError( * 'expected 0, 1 or 2 elements in range (got {})'.format( * obj_len)) # <<<<<<<<<<<<<< * * else: */ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_obj_len); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 80, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 80, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/range.pyx":79 * * else: * raise ValueError( # <<<<<<<<<<<<<< * 'expected 0, 1 or 2 elements in range (got {})'.format( * obj_len)) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(23, 79, __pyx_L1_error) } __pyx_L3:; /* "asyncpg/protocol/codecs/range.pyx":57 * type(obj))) * * elif arg_type == _RANGE_ARGUMENT_TUPLE: # <<<<<<<<<<<<<< * obj_len = len(obj) * if obj_len == 2: */ break; default: /* "asyncpg/protocol/codecs/range.pyx":84 * * else: * if obj.isempty: # <<<<<<<<<<<<<< * flags |= RANGE_EMPTY * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_isempty); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(23, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/range.pyx":85 * else: * if obj.isempty: * flags |= RANGE_EMPTY # <<<<<<<<<<<<<< * else: * lower = obj.lower */ __pyx_v_flags = (__pyx_v_flags | 1); /* "asyncpg/protocol/codecs/range.pyx":84 * * else: * if obj.isempty: # <<<<<<<<<<<<<< * flags |= RANGE_EMPTY * else: */ goto __pyx_L6; } /* "asyncpg/protocol/codecs/range.pyx":87 * flags |= RANGE_EMPTY * else: * lower = obj.lower # <<<<<<<<<<<<<< * upper = obj.upper * */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 87, __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":88 * else: * lower = obj.lower * upper = obj.upper # <<<<<<<<<<<<<< * * if obj.lower_inc: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 88, __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":90 * upper = obj.upper * * if obj.lower_inc: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INC * elif lower is None: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_lower_inc); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(23, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/range.pyx":91 * * 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":90 * upper = obj.upper * * if obj.lower_inc: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INC * elif lower is None: */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/range.pyx":92 * if obj.lower_inc: * flags |= RANGE_LB_INC * elif lower is None: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INF * */ __pyx_t_6 = (__pyx_v_lower == Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":93 * 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":92 * if obj.lower_inc: * flags |= RANGE_LB_INC * elif lower is None: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INF * */ } __pyx_L7:; /* "asyncpg/protocol/codecs/range.pyx":95 * flags |= RANGE_LB_INF * * if obj.upper_inc: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INC * elif upper is None: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_upper_inc); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(23, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":96 * * 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":95 * flags |= RANGE_LB_INF * * if obj.upper_inc: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INC * elif upper is None: */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/range.pyx":97 * if obj.upper_inc: * flags |= RANGE_UB_INC * elif upper is None: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INF * */ __pyx_t_7 = (__pyx_v_upper == Py_None); __pyx_t_6 = (__pyx_t_7 != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/range.pyx":98 * 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":97 * if obj.upper_inc: * flags |= RANGE_UB_INC * elif upper is None: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INF * */ } __pyx_L8:; } __pyx_L6:; break; } /* "asyncpg/protocol/codecs/range.pyx":100 * flags |= RANGE_UB_INF * * if _range_has_lbound(flags): # <<<<<<<<<<<<<< * encoder(settings, bounds_data, lower, encoder_arg) * */ __pyx_t_6 = (__pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(__pyx_v_flags) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/range.pyx":101 * * 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(23, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":100 * flags |= RANGE_UB_INF * * if _range_has_lbound(flags): # <<<<<<<<<<<<<< * encoder(settings, bounds_data, lower, encoder_arg) * */ } /* "asyncpg/protocol/codecs/range.pyx":103 * encoder(settings, bounds_data, lower, encoder_arg) * * if _range_has_ubound(flags): # <<<<<<<<<<<<<< * encoder(settings, bounds_data, upper, encoder_arg) * */ __pyx_t_6 = (__pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(__pyx_v_flags) != 0); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/range.pyx":104 * * 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(23, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":103 * encoder(settings, bounds_data, lower, encoder_arg) * * if _range_has_ubound(flags): # <<<<<<<<<<<<<< * encoder(settings, bounds_data, upper, encoder_arg) * */ } /* "asyncpg/protocol/codecs/range.pyx":106 * 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_8protocol_8protocol_11WriteBuffer_len(__pyx_v_bounds_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int32_t(__pyx_t_2); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(23, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/range.pyx":107 * * buf.write_int32(1 + bounds_data.len()) * buf.write_byte(flags) # <<<<<<<<<<<<<< * buf.write_buffer(bounds_data) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_buf, ((int8_t)__pyx_v_flags)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/range.pyx":108 * buf.write_int32(1 + bounds_data.len()) * buf.write_byte(flags) * buf.write_buffer(bounds_data) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(__pyx_v_buf, __pyx_v_bounds_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/range.pyx":41 * * * 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_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.range_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_lower); __Pyx_XDECREF(__pyx_v_upper); __Pyx_XDECREF((PyObject *)__pyx_v_bounds_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":111 * * * cdef range_decode(ConnectionSettings settings, FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_bound_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("range_decode", 0); /* "asyncpg/protocol/codecs/range.pyx":114 * decode_func_ex decoder, const void *decoder_arg): * cdef: * uint8_t flags = buf.read(1)[0] # <<<<<<<<<<<<<< * int32_t bound_len * object lower = None */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(23, 114, __pyx_L1_error) __pyx_v_flags = ((uint8_t)(__pyx_t_1[0])); /* "asyncpg/protocol/codecs/range.pyx":116 * uint8_t flags = buf.read(1)[0] * int32_t bound_len * object lower = None # <<<<<<<<<<<<<< * object upper = None * FastReadBuffer bound_buf = FastReadBuffer.new() */ __Pyx_INCREF(Py_None); __pyx_v_lower = Py_None; /* "asyncpg/protocol/codecs/range.pyx":117 * int32_t bound_len * object lower = None * object upper = None # <<<<<<<<<<<<<< * FastReadBuffer bound_buf = FastReadBuffer.new() * */ __Pyx_INCREF(Py_None); __pyx_v_upper = Py_None; /* "asyncpg/protocol/codecs/range.pyx":118 * object lower = None * object upper = None * FastReadBuffer bound_buf = FastReadBuffer.new() # <<<<<<<<<<<<<< * * if _range_has_lbound(flags): */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_new()); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_bound_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/range.pyx":120 * FastReadBuffer bound_buf = FastReadBuffer.new() * * if _range_has_lbound(flags): # <<<<<<<<<<<<<< * bound_len = hton.unpack_int32(buf.read(4)) * if bound_len == -1: */ __pyx_t_3 = (__pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(__pyx_v_flags) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/range.pyx":121 * * if _range_has_lbound(flags): * bound_len = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * if bound_len == -1: * lower = None */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(23, 121, __pyx_L1_error) __pyx_v_bound_len = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/range.pyx":122 * if _range_has_lbound(flags): * bound_len = hton.unpack_int32(buf.read(4)) * if bound_len == -1: # <<<<<<<<<<<<<< * lower = None * else: */ __pyx_t_3 = ((__pyx_v_bound_len == -1L) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/range.pyx":123 * bound_len = hton.unpack_int32(buf.read(4)) * if bound_len == -1: * lower = None # <<<<<<<<<<<<<< * else: * bound_buf.slice_from(buf, bound_len) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_lower, Py_None); /* "asyncpg/protocol/codecs/range.pyx":122 * if _range_has_lbound(flags): * bound_len = hton.unpack_int32(buf.read(4)) * if bound_len == -1: # <<<<<<<<<<<<<< * lower = None * else: */ goto __pyx_L4; } /* "asyncpg/protocol/codecs/range.pyx":125 * lower = None * else: * bound_buf.slice_from(buf, bound_len) # <<<<<<<<<<<<<< * lower = decoder(settings, bound_buf, decoder_arg) * */ /*else*/ { __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_slice_from(__pyx_v_bound_buf, __pyx_v_buf, __pyx_v_bound_len)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/range.pyx":126 * else: * bound_buf.slice_from(buf, bound_len) * lower = decoder(settings, bound_buf, decoder_arg) # <<<<<<<<<<<<<< * * if _range_has_ubound(flags): */ __pyx_t_2 = __pyx_v_decoder(__pyx_v_settings, __pyx_v_bound_buf, __pyx_v_decoder_arg); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L4:; /* "asyncpg/protocol/codecs/range.pyx":120 * FastReadBuffer bound_buf = FastReadBuffer.new() * * if _range_has_lbound(flags): # <<<<<<<<<<<<<< * bound_len = hton.unpack_int32(buf.read(4)) * if bound_len == -1: */ } /* "asyncpg/protocol/codecs/range.pyx":128 * lower = decoder(settings, bound_buf, decoder_arg) * * if _range_has_ubound(flags): # <<<<<<<<<<<<<< * bound_len = hton.unpack_int32(buf.read(4)) * if bound_len == -1: */ __pyx_t_3 = (__pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(__pyx_v_flags) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/range.pyx":129 * * if _range_has_ubound(flags): * bound_len = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * if bound_len == -1: * upper = None */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(23, 129, __pyx_L1_error) __pyx_v_bound_len = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/range.pyx":130 * if _range_has_ubound(flags): * bound_len = hton.unpack_int32(buf.read(4)) * if bound_len == -1: # <<<<<<<<<<<<<< * upper = None * else: */ __pyx_t_3 = ((__pyx_v_bound_len == -1L) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/range.pyx":131 * bound_len = hton.unpack_int32(buf.read(4)) * if bound_len == -1: * upper = None # <<<<<<<<<<<<<< * else: * bound_buf.slice_from(buf, bound_len) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_upper, Py_None); /* "asyncpg/protocol/codecs/range.pyx":130 * if _range_has_ubound(flags): * bound_len = hton.unpack_int32(buf.read(4)) * if bound_len == -1: # <<<<<<<<<<<<<< * upper = None * else: */ goto __pyx_L6; } /* "asyncpg/protocol/codecs/range.pyx":133 * upper = None * else: * bound_buf.slice_from(buf, bound_len) # <<<<<<<<<<<<<< * upper = decoder(settings, bound_buf, decoder_arg) * */ /*else*/ { __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_slice_from(__pyx_v_bound_buf, __pyx_v_buf, __pyx_v_bound_len)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/range.pyx":134 * else: * bound_buf.slice_from(buf, bound_len) * upper = decoder(settings, bound_buf, decoder_arg) # <<<<<<<<<<<<<< * * return apg_types.Range(lower=lower, upper=upper, */ __pyx_t_2 = __pyx_v_decoder(__pyx_v_settings, __pyx_v_bound_buf, __pyx_v_decoder_arg); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_upper, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L6:; /* "asyncpg/protocol/codecs/range.pyx":128 * lower = decoder(settings, bound_buf, decoder_arg) * * if _range_has_ubound(flags): # <<<<<<<<<<<<<< * bound_len = hton.unpack_int32(buf.read(4)) * if bound_len == -1: */ } /* "asyncpg/protocol/codecs/range.pyx":136 * 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Range); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lower, __pyx_v_lower) < 0) __PYX_ERR(23, 136, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_upper, __pyx_v_upper) < 0) __PYX_ERR(23, 136, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":137 * * 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_5 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 2) != 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lower_inc, __pyx_t_5) < 0) __PYX_ERR(23, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/range.pyx":138 * 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_5 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 4) != 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_upper_inc, __pyx_t_5) < 0) __PYX_ERR(23, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/range.pyx":139 * lower_inc=(flags & RANGE_LB_INC) != 0, * upper_inc=(flags & RANGE_UB_INC) != 0, * empty=(flags & RANGE_EMPTY) != 0) # <<<<<<<<<<<<<< * * */ __pyx_t_5 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 1) != 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_empty, __pyx_t_5) < 0) __PYX_ERR(23, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/range.pyx":136 * upper = decoder(settings, bound_buf, decoder_arg) * * return apg_types.Range(lower=lower, upper=upper, # <<<<<<<<<<<<<< * lower_inc=(flags & RANGE_LB_INC) != 0, * upper_inc=(flags & RANGE_UB_INC) != 0, */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 136, __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; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/range.pyx":111 * * * cdef range_decode(ConnectionSettings settings, FastReadBuffer buf, # <<<<<<<<<<<<<< * decode_func_ex decoder, const void *decoder_arg): * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __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_XDECREF((PyObject *)__pyx_v_bound_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":142 * * * cdef init_range_codecs(): # <<<<<<<<<<<<<< * register_core_codec(ANYRANGEOID, * NULL, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_range_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_range_codecs", 0); /* "asyncpg/protocol/codecs/range.pyx":143 * * cdef init_range_codecs(): * register_core_codec(ANYRANGEOID, # <<<<<<<<<<<<<< * NULL, * &text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xEF7, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":142 * * * cdef init_range_codecs(): # <<<<<<<<<<<<<< * register_core_codec(ANYRANGEOID, * 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.init_range_codecs", __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":8 * * * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf, struct __pyx_obj_7asyncpg_8protocol_8protocol_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; __Pyx_RefNannySetupContext("record_encode_frame", 0); /* "asyncpg/protocol/codecs/record.pyx":10 * 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_8protocol_8protocol_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_AddCObj(__pyx_int_4, __pyx_t_1, 4, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(24, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/record.pyx":12 * 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 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_elem_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/record.pyx":14 * buf.write_int32(elem_count) * # encoded attribute data * buf.write_buffer(elem_data) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/record.pyx":8 * * * 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":17 * * * cdef anonymous_record_decode(ConnectionSettings settings, FastReadBuffer 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_buf) { PyObject *__pyx_v_result = 0; uint32_t __pyx_v_elem_count; int32_t __pyx_v_elem_len; uint32_t __pyx_v_elem_typ; uint32_t __pyx_v_i; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_elem_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_elem_buf = 0; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; uint32_t __pyx_t_3; uint32_t __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; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; __Pyx_RefNannySetupContext("anonymous_record_decode", 0); /* "asyncpg/protocol/codecs/record.pyx":25 * uint32_t i * Codec elem_codec * FastReadBuffer elem_buf = FastReadBuffer.new() # <<<<<<<<<<<<<< * * elem_count = hton.unpack_int32(buf.read(4)) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_elem_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/record.pyx":27 * FastReadBuffer elem_buf = FastReadBuffer.new() * * elem_count = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * result = cpython.PyTuple_New(elem_count) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(24, 27, __pyx_L1_error) __pyx_v_elem_count = ((uint32_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2)); /* "asyncpg/protocol/codecs/record.pyx":28 * * elem_count = hton.unpack_int32(buf.read(4)) * result = cpython.PyTuple_New(elem_count) # <<<<<<<<<<<<<< * * for i in range(elem_count): */ __pyx_t_1 = PyTuple_New(__pyx_v_elem_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/record.pyx":30 * result = cpython.PyTuple_New(elem_count) * * for i in range(elem_count): # <<<<<<<<<<<<<< * elem_typ = hton.unpack_int32(buf.read(4)) * elem_len = hton.unpack_int32(buf.read(4)) */ __pyx_t_3 = __pyx_v_elem_count; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "asyncpg/protocol/codecs/record.pyx":31 * * for i in range(elem_count): * elem_typ = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * elem_len = hton.unpack_int32(buf.read(4)) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(24, 31, __pyx_L1_error) __pyx_v_elem_typ = ((uint32_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2)); /* "asyncpg/protocol/codecs/record.pyx":32 * for i in range(elem_count): * elem_typ = hton.unpack_int32(buf.read(4)) * elem_len = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * * if elem_len == -1: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(24, 32, __pyx_L1_error) __pyx_v_elem_len = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2); /* "asyncpg/protocol/codecs/record.pyx":34 * elem_len = hton.unpack_int32(buf.read(4)) * * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ __pyx_t_5 = ((__pyx_v_elem_len == -1L) != 0); if (__pyx_t_5) { /* "asyncpg/protocol/codecs/record.pyx":35 * * 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":34 * elem_len = hton.unpack_int32(buf.read(4)) * * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ goto __pyx_L5; } /* "asyncpg/protocol/codecs/record.pyx":37 * elem = None * else: * elem_codec = settings.get_data_codec(elem_typ) # <<<<<<<<<<<<<< * if elem_codec is None or not elem_codec.has_decoder(): * raise RuntimeError( */ /*else*/ { __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_settings, __pyx_v_elem_typ, 0, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/record.pyx":38 * else: * elem_codec = settings.get_data_codec(elem_typ) * if elem_codec is None or not elem_codec.has_decoder(): # <<<<<<<<<<<<<< * raise RuntimeError( * 'no decoder for composite type element in ' */ __pyx_t_6 = (((PyObject *)__pyx_v_elem_codec) == Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (!__pyx_t_7) { } else { __pyx_t_5 = __pyx_t_7; goto __pyx_L7_bool_binop_done; } __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_elem_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(24, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = ((!__pyx_t_7) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_5) { /* "asyncpg/protocol/codecs/record.pyx":41 * raise RuntimeError( * 'no decoder for composite type element in ' * 'position {} of type OID {}'.format(i, elem_typ)) # <<<<<<<<<<<<<< * elem = elem_codec.decode(settings, * elem_buf.slice_from(buf, elem_len)) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_no_decoder_for_composite_type_el, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_10)) __PYX_ERR(24, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_12 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_12 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 41, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_10}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 41, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(24, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_10); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/record.pyx":39 * elem_codec = settings.get_data_codec(elem_typ) * if elem_codec is None or not elem_codec.has_decoder(): * raise RuntimeError( # <<<<<<<<<<<<<< * 'no decoder for composite type element in ' * 'position {} of type OID {}'.format(i, elem_typ)) */ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(24, 39, __pyx_L1_error) /* "asyncpg/protocol/codecs/record.pyx":38 * else: * elem_codec = settings.get_data_codec(elem_typ) * if elem_codec is None or not elem_codec.has_decoder(): # <<<<<<<<<<<<<< * raise RuntimeError( * 'no decoder for composite type element in ' */ } /* "asyncpg/protocol/codecs/record.pyx":43 * 'position {} of type OID {}'.format(i, elem_typ)) * elem = elem_codec.decode(settings, * elem_buf.slice_from(buf, elem_len)) # <<<<<<<<<<<<<< * * cpython.Py_INCREF(elem) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_slice_from(__pyx_v_elem_buf, __pyx_v_buf, __pyx_v_elem_len)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/codecs/record.pyx":42 * 'no decoder for composite type element in ' * 'position {} of type OID {}'.format(i, elem_typ)) * elem = elem_codec.decode(settings, # <<<<<<<<<<<<<< * elem_buf.slice_from(buf, elem_len)) * */ __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_elem_codec, __pyx_v_settings, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_8); __pyx_t_8 = 0; } __pyx_L5:; /* "asyncpg/protocol/codecs/record.pyx":45 * elem_buf.slice_from(buf, elem_len)) * * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(result, i, elem) * */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/codecs/record.pyx":46 * * 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":48 * 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":17 * * * cdef anonymous_record_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * tuple result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_13); __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((PyObject *)__pyx_v_elem_buf); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/record.pyx":51 * * * cdef init_record_codecs(): # <<<<<<<<<<<<<< * register_core_codec(RECORDOID, * NULL, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_record_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_record_codecs", 0); /* "asyncpg/protocol/codecs/record.pyx":52 * * cdef init_record_codecs(): * register_core_codec(RECORDOID, # <<<<<<<<<<<<<< * NULL, * &anonymous_record_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x8C9, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)NULL), ((__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(24, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/record.pyx":51 * * * cdef init_record_codecs(): # <<<<<<<<<<<<<< * register_core_codec(RECORDOID, * 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.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/codecs/hstore.pyx":8 * * * cdef hstore_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_hstore_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_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_8protocol_8protocol_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; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int32_t __pyx_t_11; __Pyx_RefNannySetupContext("hstore_encode", 0); /* "asyncpg/protocol/codecs/hstore.pyx":14 * ssize_t count * object items * WriteBuffer item_buf = WriteBuffer.new() # <<<<<<<<<<<<<< * * count = len(obj) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_item_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/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(25, 16, __pyx_L1_error) __pyx_v_count = __pyx_t_2; /* "asyncpg/protocol/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) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/hstore.pyx":18 * count = len(obj) * if count > _MAXINT32: * raise ValueError('hstore value is too large') # <<<<<<<<<<<<<< * item_buf.write_int32(count) * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 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(25, 18, __pyx_L1_error) /* "asyncpg/protocol/codecs/hstore.pyx":17 * * count = len(obj) * if count > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('hstore value is too large') * item_buf.write_int32(count) */ } /* "asyncpg/protocol/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_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_item_buf, ((int32_t)__pyx_v_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/hstore.pyx":21 * item_buf.write_int32(count) * * if hasattr(obj, 'items'): # <<<<<<<<<<<<<< * items = obj.items() * else: */ __pyx_t_3 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_items); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(25, 21, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/hstore.pyx":22 * * if hasattr(obj, 'items'): * items = obj.items() # <<<<<<<<<<<<<< * else: * items = obj */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 22, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_items = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/hstore.pyx":21 * item_buf.write_int32(count) * * if hasattr(obj, 'items'): # <<<<<<<<<<<<<< * items = obj.items() * else: */ goto __pyx_L4; } /* "asyncpg/protocol/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/protocol/codecs/hstore.pyx":26 * items = obj * * for k, v in items: # <<<<<<<<<<<<<< * if k is None: * raise ValueError('null value not allowed in hstore key') */ if (likely(PyList_CheckExact(__pyx_v_items)) || PyTuple_CheckExact(__pyx_v_items)) { __pyx_t_1 = __pyx_v_items; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_7 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 26, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(25, 26, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(25, 26, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(25, 26, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 26, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); 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(25, 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(25, 26, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/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_4 = (__pyx_v_k == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/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_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 28, __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(25, 28, __pyx_L1_error) /* "asyncpg/protocol/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/protocol/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_5 = __pyx_f_7asyncpg_8protocol_8protocol_as_pg_string_and_size(__pyx_v_settings, __pyx_v_k, (&__pyx_v_str), (&__pyx_v_size)); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/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_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_item_buf, ((int32_t)__pyx_v_size)); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/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_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_item_buf, __pyx_v_str, __pyx_v_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/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); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "asyncpg/protocol/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_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_item_buf, ((int32_t)-1L)); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/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/protocol/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_5 = __pyx_f_7asyncpg_8protocol_8protocol_as_pg_string_and_size(__pyx_v_settings, __pyx_v_v, (&__pyx_v_str), (&__pyx_v_size)); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/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_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_item_buf, ((int32_t)__pyx_v_size)); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/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_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_item_buf, __pyx_v_str, __pyx_v_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L10:; /* "asyncpg/protocol/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/protocol/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_8protocol_8protocol_11WriteBuffer_len(__pyx_v_item_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(25, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_t_11); 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/protocol/codecs/hstore.pyx":40 * * buf.write_int32(item_buf.len()) * buf.write_buffer(item_buf) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(__pyx_v_buf, __pyx_v_item_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/protocol/codecs/hstore.pyx":8 * * * cdef hstore_encode(ConnectionSettings 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_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.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/protocol/codecs/hstore.pyx":43 * * * cdef hstore_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * dict result */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_hstore_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__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; __Pyx_RefNannySetupContext("hstore_decode", 0); /* "asyncpg/protocol/codecs/hstore.pyx":52 * str v * * result = {} # <<<<<<<<<<<<<< * * elem_count = hton.unpack_int32(buf.read(4)) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/hstore.pyx":54 * result = {} * * elem_count = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * if elem_count == 0: * return result */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(25, 54, __pyx_L1_error) __pyx_v_elem_count = ((uint32_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2)); /* "asyncpg/protocol/codecs/hstore.pyx":55 * * elem_count = hton.unpack_int32(buf.read(4)) * if elem_count == 0: # <<<<<<<<<<<<<< * return result * */ __pyx_t_3 = ((__pyx_v_elem_count == 0) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/hstore.pyx":56 * elem_count = hton.unpack_int32(buf.read(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/protocol/codecs/hstore.pyx":55 * * elem_count = hton.unpack_int32(buf.read(4)) * if elem_count == 0: # <<<<<<<<<<<<<< * return result * */ } /* "asyncpg/protocol/codecs/hstore.pyx":58 * return result * * for i in range(elem_count): # <<<<<<<<<<<<<< * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len < 0: */ __pyx_t_4 = __pyx_v_elem_count; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "asyncpg/protocol/codecs/hstore.pyx":59 * * for i in range(elem_count): * elem_len = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * if elem_len < 0: * raise ValueError('null value not allowed in hstore key') */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(25, 59, __pyx_L1_error) __pyx_v_elem_len = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2); /* "asyncpg/protocol/codecs/hstore.pyx":60 * for i in range(elem_count): * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len < 0: # <<<<<<<<<<<<<< * raise ValueError('null value not allowed in hstore key') * */ __pyx_t_3 = ((__pyx_v_elem_len < 0) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/hstore.pyx":61 * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len < 0: * raise ValueError('null value not allowed in hstore key') # <<<<<<<<<<<<<< * * k = decode_pg_string(settings, buf.read(elem_len), elem_len) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 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(25, 61, __pyx_L1_error) /* "asyncpg/protocol/codecs/hstore.pyx":60 * for i in range(elem_count): * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len < 0: # <<<<<<<<<<<<<< * raise ValueError('null value not allowed in hstore key') * */ } /* "asyncpg/protocol/codecs/hstore.pyx":63 * raise ValueError('null value not allowed in hstore key') * * k = decode_pg_string(settings, buf.read(elem_len), elem_len) # <<<<<<<<<<<<<< * * elem_len = hton.unpack_int32(buf.read(4)) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(25, 63, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_decode_pg_string(__pyx_v_settings, __pyx_t_2, __pyx_v_elem_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(25, 63, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_k, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/hstore.pyx":65 * k = decode_pg_string(settings, buf.read(elem_len), elem_len) * * elem_len = hton.unpack_int32(buf.read(4)) # <<<<<<<<<<<<<< * if elem_len < 0: * v = None */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(25, 65, __pyx_L1_error) __pyx_v_elem_len = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2); /* "asyncpg/protocol/codecs/hstore.pyx":66 * * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len < 0: # <<<<<<<<<<<<<< * v = None * else: */ __pyx_t_3 = ((__pyx_v_elem_len < 0) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/hstore.pyx":67 * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len < 0: * v = None # <<<<<<<<<<<<<< * else: * v = decode_pg_string(settings, buf.read(elem_len), elem_len) */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_v, ((PyObject*)Py_None)); /* "asyncpg/protocol/codecs/hstore.pyx":66 * * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len < 0: # <<<<<<<<<<<<<< * v = None * else: */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/hstore.pyx":69 * v = None * else: * v = decode_pg_string(settings, buf.read(elem_len), elem_len) # <<<<<<<<<<<<<< * * result[k] = v */ /*else*/ { __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(25, 69, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_decode_pg_string(__pyx_v_settings, __pyx_t_2, __pyx_v_elem_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(25, 69, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_v, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L7:; /* "asyncpg/protocol/codecs/hstore.pyx":71 * v = decode_pg_string(settings, buf.read(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(25, 71, __pyx_L1_error) } /* "asyncpg/protocol/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/protocol/codecs/hstore.pyx":43 * * * cdef hstore_decode(ConnectionSettings settings, FastReadBuffer buf): # <<<<<<<<<<<<<< * cdef: * dict result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.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/protocol/codecs/hstore.pyx":76 * * * cdef init_hstore_codecs(): # <<<<<<<<<<<<<< * register_extra_codec('pg_contrib.hstore', * &hstore_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_hstore_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("init_hstore_codecs", 0); /* "asyncpg/protocol/codecs/hstore.pyx":77 * * cdef init_hstore_codecs(): * register_extra_codec('pg_contrib.hstore', # <<<<<<<<<<<<<< * &hstore_encode, * &hstore_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_extra_codec(__pyx_kp_u_pg_contrib_hstore, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_hstore_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_hstore_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/hstore.pyx":76 * * * cdef init_hstore_codecs(): # <<<<<<<<<<<<<< * register_extra_codec('pg_contrib.hstore', * &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/coreproto.pyx":13 * cdef class CoreProtocol: * * def __init__(self, con_params): # <<<<<<<<<<<<<< * # type of `con_params` is `_ConnectionParameters` * self.buffer = ReadBuffer() */ /* 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_con_params = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_con_params,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_con_params)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 13, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_con_params = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 13, __pyx_L3_error) __pyx_L3_error:; __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_con_params); /* function exit code */ __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_con_params) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__init__", 0); /* "asyncpg/protocol/coreproto.pyx":15 * def __init__(self, con_params): * # type of `con_params` is `_ConnectionParameters` * self.buffer = ReadBuffer() # <<<<<<<<<<<<<< * self.user = con_params.user * self.password = con_params.password */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ReadBuffer), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->buffer); __Pyx_DECREF(((PyObject *)__pyx_v_self->buffer)); __pyx_v_self->buffer = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":16 * # type of `con_params` is `_ConnectionParameters` * self.buffer = ReadBuffer() * self.user = con_params.user # <<<<<<<<<<<<<< * self.password = con_params.password * self.auth_msg = None */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_con_params, __pyx_n_s_user); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_user, __pyx_t_1) < 0) __PYX_ERR(7, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":17 * self.buffer = ReadBuffer() * self.user = con_params.user * self.password = con_params.password # <<<<<<<<<<<<<< * self.auth_msg = None * self.con_params = con_params */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_con_params, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_password, __pyx_t_1) < 0) __PYX_ERR(7, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":18 * self.user = con_params.user * self.password = con_params.password * self.auth_msg = None # <<<<<<<<<<<<<< * self.con_params = con_params * self.transport = None */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, Py_None) < 0) __PYX_ERR(7, 18, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":19 * self.password = con_params.password * self.auth_msg = None * self.con_params = con_params # <<<<<<<<<<<<<< * self.transport = None * self.con_status = CONNECTION_BAD */ __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":20 * self.auth_msg = None * self.con_params = con_params * self.transport = None # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self.state = PROTOCOL_IDLE */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->transport); __Pyx_DECREF(__pyx_v_self->transport); __pyx_v_self->transport = Py_None; /* "asyncpg/protocol/coreproto.pyx":21 * self.con_params = con_params * self.transport = None * 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":22 * self.transport = None * 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":23 * self.con_status = CONNECTION_BAD * self.state = PROTOCOL_IDLE * self.xact_status = PQTRANS_IDLE # <<<<<<<<<<<<<< * self.encoding = 'utf-8' * */ __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_IDLE; /* "asyncpg/protocol/coreproto.pyx":24 * self.state = PROTOCOL_IDLE * self.xact_status = PQTRANS_IDLE * self.encoding = 'utf-8' # <<<<<<<<<<<<<< * * self._skip_discard = False */ __Pyx_INCREF(__pyx_kp_u_utf_8); __Pyx_GIVEREF(__pyx_kp_u_utf_8); __Pyx_GOTREF(__pyx_v_self->encoding); __Pyx_DECREF(__pyx_v_self->encoding); __pyx_v_self->encoding = __pyx_kp_u_utf_8; /* "asyncpg/protocol/coreproto.pyx":26 * self.encoding = 'utf-8' * * self._skip_discard = False # <<<<<<<<<<<<<< * * # executemany support data */ __pyx_v_self->_skip_discard = 0; /* "asyncpg/protocol/coreproto.pyx":29 * * # 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":30 * # 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":31 * self._execute_iter = None * self._execute_portal_name = None * self._execute_stmt_name = None # <<<<<<<<<<<<<< * * self._reset_result() */ __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":33 * self._execute_stmt_name = None * * self._reset_result() # <<<<<<<<<<<<<< * * cdef _write(self, buf): */ __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(7, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":13 * cdef class CoreProtocol: * * def __init__(self, con_params): # <<<<<<<<<<<<<< * # type of `con_params` is `_ConnectionParameters` * self.buffer = ReadBuffer() */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":35 * self._reset_result() * * cdef _write(self, buf): # <<<<<<<<<<<<<< * self.transport.write(memoryview(buf)) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_write", 0); /* "asyncpg/protocol/coreproto.pyx":36 * * cdef _write(self, buf): * self.transport.write(memoryview(buf)) # <<<<<<<<<<<<<< * * cdef inline _write_sync_message(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->transport, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_buf); __Pyx_GIVEREF(__pyx_v_buf); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_buf); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_memoryview, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 36, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 36, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":35 * self._reset_result() * * cdef _write(self, buf): # <<<<<<<<<<<<<< * self.transport.write(memoryview(buf)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._write", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":38 * self.transport.write(memoryview(buf)) * * cdef inline _write_sync_message(self): # <<<<<<<<<<<<<< * self.transport.write(SYNC_MESSAGE) * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_sync_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__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; __Pyx_RefNannySetupContext("_write_sync_message", 0); /* "asyncpg/protocol/coreproto.pyx":39 * * cdef inline _write_sync_message(self): * self.transport.write(SYNC_MESSAGE) # <<<<<<<<<<<<<< * * cdef _read_server_messages(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->transport, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 39, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 39, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE); __Pyx_GIVEREF(__pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":38 * self.transport.write(memoryview(buf)) * * cdef inline _write_sync_message(self): # <<<<<<<<<<<<<< * self.transport.write(SYNC_MESSAGE) * */ /* 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.CoreProtocol._write_sync_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":41 * self.transport.write(SYNC_MESSAGE) * * 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; PyObject *__pyx_v_ex = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; int __pyx_t_2; enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __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; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __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; char const *__pyx_t_23; __Pyx_RefNannySetupContext("_read_server_messages", 0); /* "asyncpg/protocol/coreproto.pyx":46 * ProtocolState state * * while self.buffer.has_message() == 1: # <<<<<<<<<<<<<< * mtype = self.buffer.get_message_type() * state = self.state */ while (1) { __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1))) __PYX_ERR(7, 46, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 1) != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/coreproto.pyx":47 * * while self.buffer.has_message() == 1: * mtype = self.buffer.get_message_type() # <<<<<<<<<<<<<< * state = self.state * */ __pyx_v_mtype = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_type(__pyx_v_self->buffer); /* "asyncpg/protocol/coreproto.pyx":48 * while self.buffer.has_message() == 1: * mtype = self.buffer.get_message_type() * state = self.state # <<<<<<<<<<<<<< * * try: */ __pyx_t_3 = __pyx_v_self->state; __pyx_v_state = __pyx_t_3; /* "asyncpg/protocol/coreproto.pyx":50 * state = self.state * * try: # <<<<<<<<<<<<<< * if mtype == b'S': * # ParameterStatus */ /*try:*/ { { __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/coreproto.pyx":51 * * try: * if mtype == b'S': # <<<<<<<<<<<<<< * # ParameterStatus * self._parse_msg_parameter_status() */ switch (__pyx_v_mtype) { case 'S': /* "asyncpg/protocol/coreproto.pyx":53 * if mtype == b'S': * # ParameterStatus * self._parse_msg_parameter_status() # <<<<<<<<<<<<<< * continue * elif mtype == b'A': */ __pyx_t_7 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_parameter_status(__pyx_v_self); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 53, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/coreproto.pyx":54 * # ParameterStatus * self._parse_msg_parameter_status() * continue # <<<<<<<<<<<<<< * elif mtype == b'A': * # NotificationResponse */ goto __pyx_L16_try_continue; /* "asyncpg/protocol/coreproto.pyx":51 * * try: * if mtype == b'S': # <<<<<<<<<<<<<< * # ParameterStatus * self._parse_msg_parameter_status() */ break; /* "asyncpg/protocol/coreproto.pyx":55 * self._parse_msg_parameter_status() * continue * elif mtype == b'A': # <<<<<<<<<<<<<< * # NotificationResponse * self._parse_msg_notification() */ case 'A': /* "asyncpg/protocol/coreproto.pyx":57 * elif mtype == b'A': * # NotificationResponse * self._parse_msg_notification() # <<<<<<<<<<<<<< * continue * elif mtype == b'N': */ __pyx_t_7 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_notification(__pyx_v_self); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 57, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/coreproto.pyx":58 * # NotificationResponse * self._parse_msg_notification() * continue # <<<<<<<<<<<<<< * elif mtype == b'N': * # 'N' - NoticeResponse */ goto __pyx_L16_try_continue; /* "asyncpg/protocol/coreproto.pyx":55 * self._parse_msg_parameter_status() * continue * elif mtype == b'A': # <<<<<<<<<<<<<< * # NotificationResponse * self._parse_msg_notification() */ break; /* "asyncpg/protocol/coreproto.pyx":59 * self._parse_msg_notification() * continue * elif mtype == b'N': # <<<<<<<<<<<<<< * # 'N' - NoticeResponse * self._on_notice(self._parse_msg_error_response(False)) */ case 'N': /* "asyncpg/protocol/coreproto.pyx":61 * elif mtype == b'N': * # 'N' - NoticeResponse * self._on_notice(self._parse_msg_error_response(False)) # <<<<<<<<<<<<<< * continue * */ __pyx_t_7 = ((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_7)) __PYX_ERR(7, 61, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_notice(__pyx_v_self, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 61, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":62 * # 'N' - NoticeResponse * self._on_notice(self._parse_msg_error_response(False)) * continue # <<<<<<<<<<<<<< * * if state == PROTOCOL_AUTH: */ goto __pyx_L16_try_continue; /* "asyncpg/protocol/coreproto.pyx":59 * self._parse_msg_notification() * continue * elif mtype == b'N': # <<<<<<<<<<<<<< * # 'N' - NoticeResponse * self._on_notice(self._parse_msg_error_response(False)) */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":64 * continue * * if state == PROTOCOL_AUTH: # <<<<<<<<<<<<<< * self._process__auth(mtype) * */ switch (__pyx_v_state) { case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_AUTH: /* "asyncpg/protocol/coreproto.pyx":65 * * if state == PROTOCOL_AUTH: * self._process__auth(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_PREPARE: */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__auth(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 65, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":64 * continue * * if state == PROTOCOL_AUTH: # <<<<<<<<<<<<<< * self._process__auth(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":67 * self._process__auth(mtype) * * elif state == PROTOCOL_PREPARE: # <<<<<<<<<<<<<< * self._process__prepare(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE: /* "asyncpg/protocol/coreproto.pyx":68 * * elif state == PROTOCOL_PREPARE: * self._process__prepare(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_BIND_EXECUTE: */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__prepare(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 68, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":67 * self._process__auth(mtype) * * elif state == PROTOCOL_PREPARE: # <<<<<<<<<<<<<< * self._process__prepare(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":70 * self._process__prepare(mtype) * * elif state == PROTOCOL_BIND_EXECUTE: # <<<<<<<<<<<<<< * self._process__bind_execute(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE: /* "asyncpg/protocol/coreproto.pyx":71 * * elif state == PROTOCOL_BIND_EXECUTE: * self._process__bind_execute(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_BIND_EXECUTE_MANY: */ __pyx_t_8 = ((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_8)) __PYX_ERR(7, 71, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":70 * self._process__prepare(mtype) * * elif state == PROTOCOL_BIND_EXECUTE: # <<<<<<<<<<<<<< * self._process__bind_execute(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":73 * self._process__bind_execute(mtype) * * elif state == PROTOCOL_BIND_EXECUTE_MANY: # <<<<<<<<<<<<<< * self._process__bind_execute_many(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE_MANY: /* "asyncpg/protocol/coreproto.pyx":74 * * elif state == PROTOCOL_BIND_EXECUTE_MANY: * self._process__bind_execute_many(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_EXECUTE: */ __pyx_t_8 = ((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_8)) __PYX_ERR(7, 74, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":73 * self._process__bind_execute(mtype) * * elif state == PROTOCOL_BIND_EXECUTE_MANY: # <<<<<<<<<<<<<< * self._process__bind_execute_many(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":76 * self._process__bind_execute_many(mtype) * * elif state == PROTOCOL_EXECUTE: # <<<<<<<<<<<<<< * self._process__bind_execute(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_EXECUTE: /* "asyncpg/protocol/coreproto.pyx":77 * * elif state == PROTOCOL_EXECUTE: * self._process__bind_execute(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_BIND: */ __pyx_t_8 = ((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_8)) __PYX_ERR(7, 77, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":76 * self._process__bind_execute_many(mtype) * * elif state == PROTOCOL_EXECUTE: # <<<<<<<<<<<<<< * self._process__bind_execute(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":79 * self._process__bind_execute(mtype) * * elif state == PROTOCOL_BIND: # <<<<<<<<<<<<<< * self._process__bind(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND: /* "asyncpg/protocol/coreproto.pyx":80 * * elif state == PROTOCOL_BIND: * self._process__bind(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_CLOSE_STMT_PORTAL: */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__bind(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 80, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":79 * self._process__bind_execute(mtype) * * elif state == PROTOCOL_BIND: # <<<<<<<<<<<<<< * self._process__bind(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":82 * self._process__bind(mtype) * * elif state == PROTOCOL_CLOSE_STMT_PORTAL: # <<<<<<<<<<<<<< * self._process__close_stmt_portal(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CLOSE_STMT_PORTAL: /* "asyncpg/protocol/coreproto.pyx":83 * * elif state == PROTOCOL_CLOSE_STMT_PORTAL: * self._process__close_stmt_portal(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_SIMPLE_QUERY: */ __pyx_t_8 = ((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_8)) __PYX_ERR(7, 83, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":82 * self._process__bind(mtype) * * elif state == PROTOCOL_CLOSE_STMT_PORTAL: # <<<<<<<<<<<<<< * self._process__close_stmt_portal(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":85 * self._process__close_stmt_portal(mtype) * * elif state == PROTOCOL_SIMPLE_QUERY: # <<<<<<<<<<<<<< * self._process__simple_query(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_SIMPLE_QUERY: /* "asyncpg/protocol/coreproto.pyx":86 * * elif state == PROTOCOL_SIMPLE_QUERY: * self._process__simple_query(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_COPY_OUT: */ __pyx_t_8 = ((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_8)) __PYX_ERR(7, 86, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":85 * self._process__close_stmt_portal(mtype) * * elif state == PROTOCOL_SIMPLE_QUERY: # <<<<<<<<<<<<<< * self._process__simple_query(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":88 * self._process__simple_query(mtype) * * elif state == PROTOCOL_COPY_OUT: # <<<<<<<<<<<<<< * self._process__copy_out(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT: /* "asyncpg/protocol/coreproto.pyx":89 * * elif state == PROTOCOL_COPY_OUT: * self._process__copy_out(mtype) # <<<<<<<<<<<<<< * * elif (state == PROTOCOL_COPY_OUT_DATA or */ __pyx_t_8 = ((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_8)) __PYX_ERR(7, 89, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":88 * self._process__simple_query(mtype) * * elif state == PROTOCOL_COPY_OUT: # <<<<<<<<<<<<<< * self._process__copy_out(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":91 * self._process__copy_out(mtype) * * elif (state == PROTOCOL_COPY_OUT_DATA or # <<<<<<<<<<<<<< * state == PROTOCOL_COPY_OUT_DONE): * self._process__copy_out_data(mtype) */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA: /* "asyncpg/protocol/coreproto.pyx":92 * * elif (state == PROTOCOL_COPY_OUT_DATA or * state == PROTOCOL_COPY_OUT_DONE): # <<<<<<<<<<<<<< * self._process__copy_out_data(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE: /* "asyncpg/protocol/coreproto.pyx":93 * 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_8 = ((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_8)) __PYX_ERR(7, 93, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":91 * self._process__copy_out(mtype) * * elif (state == PROTOCOL_COPY_OUT_DATA or # <<<<<<<<<<<<<< * state == PROTOCOL_COPY_OUT_DONE): * self._process__copy_out_data(mtype) */ break; /* "asyncpg/protocol/coreproto.pyx":95 * self._process__copy_out_data(mtype) * * elif state == PROTOCOL_COPY_IN: # <<<<<<<<<<<<<< * self._process__copy_in(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN: /* "asyncpg/protocol/coreproto.pyx":96 * * elif state == PROTOCOL_COPY_IN: * self._process__copy_in(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_COPY_IN_DATA: */ __pyx_t_8 = ((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_8)) __PYX_ERR(7, 96, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":95 * self._process__copy_out_data(mtype) * * elif state == PROTOCOL_COPY_IN: # <<<<<<<<<<<<<< * self._process__copy_in(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":98 * self._process__copy_in(mtype) * * elif state == PROTOCOL_COPY_IN_DATA: # <<<<<<<<<<<<<< * self._process__copy_in_data(mtype) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA: /* "asyncpg/protocol/coreproto.pyx":99 * * elif state == PROTOCOL_COPY_IN_DATA: * self._process__copy_in_data(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_CANCELLED: */ __pyx_t_8 = ((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_8)) __PYX_ERR(7, 99, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":98 * self._process__copy_in(mtype) * * elif state == PROTOCOL_COPY_IN_DATA: # <<<<<<<<<<<<<< * self._process__copy_in_data(mtype) * */ break; /* "asyncpg/protocol/coreproto.pyx":101 * self._process__copy_in_data(mtype) * * elif state == PROTOCOL_CANCELLED: # <<<<<<<<<<<<<< * # discard all messages until the sync message * if mtype == b'E': */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED: /* "asyncpg/protocol/coreproto.pyx":103 * 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': */ __pyx_t_2 = ((__pyx_v_mtype == 'E') != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":104 * # 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_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(7, 104, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":103 * 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': */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":105 * if mtype == b'E': * self._parse_msg_error_response(True) * elif mtype == b'Z': # <<<<<<<<<<<<<< * self._parse_msg_ready_for_query() * self._push_result() */ __pyx_t_2 = ((__pyx_v_mtype == 'Z') != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":106 * self._parse_msg_error_response(True) * elif mtype == b'Z': * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * else: */ __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(7, 106, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":107 * elif mtype == b'Z': * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * else: * self.buffer.consume_message() */ __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(7, 107, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":105 * if mtype == b'E': * self._parse_msg_error_response(True) * elif mtype == b'Z': # <<<<<<<<<<<<<< * self._parse_msg_ready_for_query() * self._push_result() */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":109 * self._push_result() * else: * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif state == PROTOCOL_ERROR_CONSUME: */ /*else*/ { __pyx_t_8 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 109, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L18:; /* "asyncpg/protocol/coreproto.pyx":101 * self._process__copy_in_data(mtype) * * elif state == PROTOCOL_CANCELLED: # <<<<<<<<<<<<<< * # discard all messages until the sync message * if mtype == b'E': */ break; /* "asyncpg/protocol/coreproto.pyx":111 * self.buffer.consume_message() * * elif state == PROTOCOL_ERROR_CONSUME: # <<<<<<<<<<<<<< * # Error in protocol (on asyncpg side); * # discard all messages until sync message */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_ERROR_CONSUME: /* "asyncpg/protocol/coreproto.pyx":115 * # 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_2 = ((__pyx_v_mtype == 'Z') != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":117 * if mtype == b'Z': * # Sync point, self to push the result * if self.result_type != RESULT_FAILED: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = RuntimeError( */ __pyx_t_2 = ((__pyx_v_self->result_type != __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":118 * # Sync point, self to push the result * if self.result_type != RESULT_FAILED: * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = RuntimeError( * 'unknown error in protocol implementation') */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":119 * if self.result_type != RESULT_FAILED: * self.result_type = RESULT_FAILED * self.result = RuntimeError( # <<<<<<<<<<<<<< * 'unknown error in protocol implementation') * */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 119, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_8; __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":117 * if mtype == b'Z': * # Sync point, self to push the result * if self.result_type != RESULT_FAILED: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = RuntimeError( */ } /* "asyncpg/protocol/coreproto.pyx":122 * 'unknown error in protocol implementation') * * self._push_result() # <<<<<<<<<<<<<< * * else: */ __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(7, 122, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":115 * # 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":125 * * else: * self.buffer.consume_message() # <<<<<<<<<<<<<< * * else: */ /*else*/ { __pyx_t_8 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 125, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L19:; /* "asyncpg/protocol/coreproto.pyx":111 * self.buffer.consume_message() * * elif state == PROTOCOL_ERROR_CONSUME: # <<<<<<<<<<<<<< * # Error in protocol (on asyncpg side); * # discard all messages until sync message */ break; default: /* "asyncpg/protocol/coreproto.pyx":128 * * else: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'protocol is in an unknown state {}'.format(state)) * */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 128, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 128, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/coreproto.pyx":129 * else: * raise apg_exc.InternalClientError( * 'protocol is in an unknown state {}'.format(state)) # <<<<<<<<<<<<<< * * except Exception as ex: */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_protocol_is_in_an_unknown_state, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 129, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_state); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 129, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_12) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 129, __pyx_L10_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_11}; __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 129, __pyx_L10_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_11}; __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 129, __pyx_L10_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(7, 129, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 129, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_10) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 128, __pyx_L10_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_7}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 128, __pyx_L10_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_7}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 128, __pyx_L10_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(7, 128, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 128, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(7, 128, __pyx_L10_error) break; } /* "asyncpg/protocol/coreproto.pyx":50 * state = self.state * * try: # <<<<<<<<<<<<<< * if mtype == b'S': * # ParameterStatus */ } __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_L17_try_end; __pyx_L10_error:; __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_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":131 * 'protocol is in an unknown state {}'.format(state)) * * except Exception as ex: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = ex */ __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_14) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._read_server_messages", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_13) < 0) __PYX_ERR(7, 131, __pyx_L12_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_v_ex = __pyx_t_9; /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":132 * * 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":133 * 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":135 * self.result = ex * * if mtype == b'Z': # <<<<<<<<<<<<<< * self._push_result() * else: */ __pyx_t_2 = ((__pyx_v_mtype == 'Z') != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":136 * * if mtype == b'Z': * self._push_result() # <<<<<<<<<<<<<< * else: * self.state = PROTOCOL_ERROR_CONSUME */ __pyx_t_7 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 136, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/coreproto.pyx":135 * self.result = ex * * if mtype == b'Z': # <<<<<<<<<<<<<< * self._push_result() * else: */ goto __pyx_L28; } /* "asyncpg/protocol/coreproto.pyx":138 * 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":131 * 'protocol is in an unknown state {}'.format(state)) * * except Exception as ex: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = ex */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = NULL; goto __pyx_L27; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L26_error:; __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_PyThreadState_assign __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_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L12_except_error; } __pyx_L27:; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L11_exception_handled; } goto __pyx_L12_except_error; __pyx_L12_except_error:; /* "asyncpg/protocol/coreproto.pyx":50 * state = self.state * * try: # <<<<<<<<<<<<<< * if mtype == b'S': * # ParameterStatus */ __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_L8_error; __pyx_L16_try_continue:; __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_L5_continue; __pyx_L11_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_L17_try_end:; } } /* "asyncpg/protocol/coreproto.pyx":141 * * finally: * if self._skip_discard: # <<<<<<<<<<<<<< * self._skip_discard = False * else: */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = (__pyx_v_self->_skip_discard != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":142 * finally: * if self._skip_discard: * self._skip_discard = False # <<<<<<<<<<<<<< * else: * self.buffer.discard_message() */ __pyx_v_self->_skip_discard = 0; /* "asyncpg/protocol/coreproto.pyx":141 * * finally: * if self._skip_discard: # <<<<<<<<<<<<<< * self._skip_discard = False * else: */ goto __pyx_L33; } /* "asyncpg/protocol/coreproto.pyx":144 * self._skip_discard = False * else: * self.buffer.discard_message() # <<<<<<<<<<<<<< * * cdef _process__auth(self, char mtype): */ /*else*/ { __pyx_t_13 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_13)) __PYX_ERR(7, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __pyx_L33:; goto __pyx_L9; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L8_error:; __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __Pyx_PyThreadState_assign __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_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_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || 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_22); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_15 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_23 = __pyx_filename; { /* "asyncpg/protocol/coreproto.pyx":141 * * finally: * if self._skip_discard: # <<<<<<<<<<<<<< * self._skip_discard = False * else: */ __pyx_t_2 = (__pyx_v_self->_skip_discard != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":142 * finally: * if self._skip_discard: * self._skip_discard = False # <<<<<<<<<<<<<< * else: * self.buffer.discard_message() */ __pyx_v_self->_skip_discard = 0; /* "asyncpg/protocol/coreproto.pyx":141 * * finally: * if self._skip_discard: # <<<<<<<<<<<<<< * self._skip_discard = False * else: */ goto __pyx_L38; } /* "asyncpg/protocol/coreproto.pyx":144 * self._skip_discard = False * else: * self.buffer.discard_message() # <<<<<<<<<<<<<< * * cdef _process__auth(self, char mtype): */ /*else*/ { __pyx_t_13 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_13)) __PYX_ERR(7, 144, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __pyx_L38:; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_23; goto __pyx_L1_error; __pyx_L37_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20); } __Pyx_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_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; goto __pyx_L1_error; } __pyx_L5_continue: { /* "asyncpg/protocol/coreproto.pyx":141 * * finally: * if self._skip_discard: # <<<<<<<<<<<<<< * self._skip_discard = False * else: */ __pyx_t_2 = (__pyx_v_self->_skip_discard != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":142 * finally: * if self._skip_discard: * self._skip_discard = False # <<<<<<<<<<<<<< * else: * self.buffer.discard_message() */ __pyx_v_self->_skip_discard = 0; /* "asyncpg/protocol/coreproto.pyx":141 * * finally: * if self._skip_discard: # <<<<<<<<<<<<<< * self._skip_discard = False * else: */ goto __pyx_L39; } /* "asyncpg/protocol/coreproto.pyx":144 * self._skip_discard = False * else: * self.buffer.discard_message() # <<<<<<<<<<<<<< * * cdef _process__auth(self, char mtype): */ /*else*/ { __pyx_t_13 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_13)) __PYX_ERR(7, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __pyx_L39:; goto __pyx_L3_continue; } __pyx_L9:; } __pyx_L3_continue:; } /* "asyncpg/protocol/coreproto.pyx":41 * self.transport.write(SYNC_MESSAGE) * * 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_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_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":146 * self.buffer.discard_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_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_t_5; __Pyx_RefNannySetupContext("_process__auth", 0); /* "asyncpg/protocol/coreproto.pyx":147 * * cdef _process__auth(self, char mtype): * if mtype == b'R': # <<<<<<<<<<<<<< * # Authentication... * self._parse_msg_authentication() */ switch (__pyx_v_mtype) { case 'R': /* "asyncpg/protocol/coreproto.pyx":149 * if mtype == b'R': * # Authentication... * self._parse_msg_authentication() # <<<<<<<<<<<<<< * if self.result_type != RESULT_OK: * self.con_status = CONNECTION_BAD */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_authentication(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":150 * # Authentication... * self._parse_msg_authentication() * if self.result_type != RESULT_OK: # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._push_result() */ __pyx_t_2 = ((__pyx_v_self->result_type != __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":151 * self._parse_msg_authentication() * if self.result_type != RESULT_OK: * self.con_status = CONNECTION_BAD # <<<<<<<<<<<<<< * self._push_result() * self.transport.close() */ __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD; /* "asyncpg/protocol/coreproto.pyx":152 * if self.result_type != RESULT_OK: * self.con_status = CONNECTION_BAD * self._push_result() # <<<<<<<<<<<<<< * self.transport.close() * */ __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(7, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":153 * self.con_status = CONNECTION_BAD * self._push_result() * self.transport.close() # <<<<<<<<<<<<<< * * elif self.auth_msg is not None: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->transport, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 153, __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":150 * # Authentication... * self._parse_msg_authentication() * if self.result_type != RESULT_OK: # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._push_result() */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":155 * self.transport.close() * * elif self.auth_msg is not None: # <<<<<<<<<<<<<< * # Server wants us to send auth data, so do that. * self._write(self.auth_msg) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 155, __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; __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":157 * 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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 157, __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(7, 157, __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":158 * # Server wants us to send auth data, so do that. * self._write(self.auth_msg) * self.auth_msg = None # <<<<<<<<<<<<<< * * elif mtype == b'K': */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, Py_None) < 0) __PYX_ERR(7, 158, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":155 * self.transport.close() * * elif self.auth_msg is not None: # <<<<<<<<<<<<<< * # Server wants us to send auth data, so do that. * self._write(self.auth_msg) */ } __pyx_L3:; /* "asyncpg/protocol/coreproto.pyx":147 * * cdef _process__auth(self, char mtype): * if mtype == b'R': # <<<<<<<<<<<<<< * # Authentication... * self._parse_msg_authentication() */ break; /* "asyncpg/protocol/coreproto.pyx":160 * self.auth_msg = None * * elif mtype == b'K': # <<<<<<<<<<<<<< * # BackendKeyData * self._parse_msg_backend_key_data() */ case 'K': /* "asyncpg/protocol/coreproto.pyx":162 * elif mtype == b'K': * # BackendKeyData * self._parse_msg_backend_key_data() # <<<<<<<<<<<<<< * * elif mtype == b'E': */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_backend_key_data(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":160 * self.auth_msg = None * * elif mtype == b'K': # <<<<<<<<<<<<<< * # BackendKeyData * self._parse_msg_backend_key_data() */ break; /* "asyncpg/protocol/coreproto.pyx":164 * self._parse_msg_backend_key_data() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self.con_status = CONNECTION_BAD */ case 'E': /* "asyncpg/protocol/coreproto.pyx":166 * 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":167 * # ErrorResponse * self.con_status = CONNECTION_BAD * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_3 = ((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_3)) __PYX_ERR(7, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":168 * self.con_status = CONNECTION_BAD * self._parse_msg_error_response(True) * self._push_result() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":164 * self._parse_msg_backend_key_data() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self.con_status = CONNECTION_BAD */ break; /* "asyncpg/protocol/coreproto.pyx":170 * self._push_result() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":172 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self.con_status = CONNECTION_OK * self._push_result() */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":173 * # 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":174 * self._parse_msg_ready_for_query() * self.con_status = CONNECTION_OK * self._push_result() # <<<<<<<<<<<<<< * * cdef _process__prepare(self, char mtype): */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":170 * self._push_result() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":146 * self.buffer.discard_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_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__auth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":176 * 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; __Pyx_RefNannySetupContext("_process__prepare", 0); /* "asyncpg/protocol/coreproto.pyx":177 * * cdef _process__prepare(self, char mtype): * if mtype == b't': # <<<<<<<<<<<<<< * # Parameters description * self.result_param_desc = self.buffer.consume_message().as_bytes() */ switch (__pyx_v_mtype) { case 't': /* "asyncpg/protocol/coreproto.pyx":179 * if mtype == b't': * # Parameters description * self.result_param_desc = self.buffer.consume_message().as_bytes() # <<<<<<<<<<<<<< * * elif mtype == b'1': */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_6Memory_as_bytes(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 179, __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)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(7, 179, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_2); __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_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":177 * * cdef _process__prepare(self, char mtype): * if mtype == b't': # <<<<<<<<<<<<<< * # Parameters description * self.result_param_desc = self.buffer.consume_message().as_bytes() */ break; /* "asyncpg/protocol/coreproto.pyx":181 * self.result_param_desc = self.buffer.consume_message().as_bytes() * * elif mtype == b'1': # <<<<<<<<<<<<<< * # ParseComplete * self.buffer.consume_message() */ case '1': /* "asyncpg/protocol/coreproto.pyx":183 * elif mtype == b'1': * # ParseComplete * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'T': */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":181 * self.result_param_desc = self.buffer.consume_message().as_bytes() * * elif mtype == b'1': # <<<<<<<<<<<<<< * # ParseComplete * self.buffer.consume_message() */ break; /* "asyncpg/protocol/coreproto.pyx":185 * self.buffer.consume_message() * * elif mtype == b'T': # <<<<<<<<<<<<<< * # Row description * self.result_row_desc = self.buffer.consume_message().as_bytes() */ case 'T': /* "asyncpg/protocol/coreproto.pyx":187 * elif mtype == b'T': * # Row description * self.result_row_desc = self.buffer.consume_message().as_bytes() # <<<<<<<<<<<<<< * * elif mtype == b'E': */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_6Memory_as_bytes(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(7, 187, __pyx_L1_error) __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":185 * self.buffer.consume_message() * * elif mtype == b'T': # <<<<<<<<<<<<<< * # Row description * self.result_row_desc = self.buffer.consume_message().as_bytes() */ break; /* "asyncpg/protocol/coreproto.pyx":189 * self.result_row_desc = self.buffer.consume_message().as_bytes() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ case 'E': /* "asyncpg/protocol/coreproto.pyx":191 * 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(7, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":189 * self.result_row_desc = self.buffer.consume_message().as_bytes() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; /* "asyncpg/protocol/coreproto.pyx":193 * self._parse_msg_error_response(True) * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":195 * 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(7, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":196 * # ReadyForQuery * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * elif mtype == b'n': */ __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(7, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":193 * self._parse_msg_error_response(True) * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; /* "asyncpg/protocol/coreproto.pyx":198 * self._push_result() * * elif mtype == b'n': # <<<<<<<<<<<<<< * # NoData * self.buffer.consume_message() */ case 'n': /* "asyncpg/protocol/coreproto.pyx":200 * elif mtype == b'n': * # NoData * self.buffer.consume_message() # <<<<<<<<<<<<<< * * cdef _process__bind_execute(self, char mtype): */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":198 * self._push_result() * * elif mtype == b'n': # <<<<<<<<<<<<<< * # NoData * self.buffer.consume_message() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":176 * 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":202 * self.buffer.consume_message() * * 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; __Pyx_RefNannySetupContext("_process__bind_execute", 0); /* "asyncpg/protocol/coreproto.pyx":203 * * 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":205 * 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(7, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":203 * * cdef _process__bind_execute(self, char mtype): * if mtype == b'D': # <<<<<<<<<<<<<< * # DataRow * self._parse_data_msgs() */ break; /* "asyncpg/protocol/coreproto.pyx":207 * self._parse_data_msgs() * * elif mtype == b's': # <<<<<<<<<<<<<< * # PortalSuspended * self.buffer.consume_message() */ case 's': /* "asyncpg/protocol/coreproto.pyx":209 * elif mtype == b's': * # PortalSuspended * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'C': */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":207 * self._parse_data_msgs() * * elif mtype == b's': # <<<<<<<<<<<<<< * # PortalSuspended * self.buffer.consume_message() */ break; /* "asyncpg/protocol/coreproto.pyx":211 * self.buffer.consume_message() * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self.result_execute_completed = True */ case 'C': /* "asyncpg/protocol/coreproto.pyx":213 * 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":214 * # 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(7, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":211 * self.buffer.consume_message() * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self.result_execute_completed = True */ break; /* "asyncpg/protocol/coreproto.pyx":216 * self._parse_msg_command_complete() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ case 'E': /* "asyncpg/protocol/coreproto.pyx":218 * elif 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(7, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":216 * self._parse_msg_command_complete() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; /* "asyncpg/protocol/coreproto.pyx":220 * self._parse_msg_error_response(True) * * elif mtype == b'2': # <<<<<<<<<<<<<< * # BindComplete * self.buffer.consume_message() */ case '2': /* "asyncpg/protocol/coreproto.pyx":222 * elif mtype == b'2': * # BindComplete * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":220 * self._parse_msg_error_response(True) * * elif mtype == b'2': # <<<<<<<<<<<<<< * # BindComplete * self.buffer.consume_message() */ break; /* "asyncpg/protocol/coreproto.pyx":224 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":226 * 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(7, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":227 * # 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(7, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":224 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; /* "asyncpg/protocol/coreproto.pyx":229 * self._push_result() * * elif mtype == b'I': # <<<<<<<<<<<<<< * # EmptyQueryResponse * self.buffer.consume_message() */ case 'I': /* "asyncpg/protocol/coreproto.pyx":231 * elif mtype == b'I': * # EmptyQueryResponse * self.buffer.consume_message() # <<<<<<<<<<<<<< * * cdef _process__bind_execute_many(self, char mtype): */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":229 * self._push_result() * * elif mtype == b'I': # <<<<<<<<<<<<<< * # EmptyQueryResponse * self.buffer.consume_message() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":202 * self.buffer.consume_message() * * 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":233 * self.buffer.consume_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) { struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_v_e = 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; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; char const *__pyx_t_11; 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; __Pyx_RefNannySetupContext("_process__bind_execute_many", 0); /* "asyncpg/protocol/coreproto.pyx":236 * cdef WriteBuffer buf * * if mtype == b'D': # <<<<<<<<<<<<<< * # DataRow * self._parse_data_msgs() */ switch (__pyx_v_mtype) { case 'D': /* "asyncpg/protocol/coreproto.pyx":238 * 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(7, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":236 * cdef WriteBuffer buf * * if mtype == b'D': # <<<<<<<<<<<<<< * # DataRow * self._parse_data_msgs() */ break; /* "asyncpg/protocol/coreproto.pyx":240 * self._parse_data_msgs() * * elif mtype == b's': # <<<<<<<<<<<<<< * # PortalSuspended * self.buffer.consume_message() */ case 's': /* "asyncpg/protocol/coreproto.pyx":242 * elif mtype == b's': * # PortalSuspended * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'C': */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":240 * self._parse_data_msgs() * * elif mtype == b's': # <<<<<<<<<<<<<< * # PortalSuspended * self.buffer.consume_message() */ break; /* "asyncpg/protocol/coreproto.pyx":244 * self.buffer.consume_message() * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ case 'C': /* "asyncpg/protocol/coreproto.pyx":246 * elif mtype == b'C': * # CommandComplete * 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(7, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":244 * self.buffer.consume_message() * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ break; /* "asyncpg/protocol/coreproto.pyx":248 * self._parse_msg_command_complete() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ case 'E': /* "asyncpg/protocol/coreproto.pyx":250 * elif 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(7, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":248 * self._parse_msg_command_complete() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; /* "asyncpg/protocol/coreproto.pyx":252 * self._parse_msg_error_response(True) * * elif mtype == b'2': # <<<<<<<<<<<<<< * # BindComplete * self.buffer.consume_message() */ case '2': /* "asyncpg/protocol/coreproto.pyx":254 * elif mtype == b'2': * # BindComplete * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":252 * self._parse_msg_error_response(True) * * elif mtype == b'2': # <<<<<<<<<<<<<< * # BindComplete * self.buffer.consume_message() */ break; /* "asyncpg/protocol/coreproto.pyx":256 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":258 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * if self.result_type == RESULT_FAILED: * 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(7, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":259 * # ReadyForQuery * self._parse_msg_ready_for_query() * if self.result_type == RESULT_FAILED: # <<<<<<<<<<<<<< * self._push_result() * else: */ __pyx_t_2 = ((__pyx_v_self->result_type == __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":260 * self._parse_msg_ready_for_query() * if self.result_type == RESULT_FAILED: * self._push_result() # <<<<<<<<<<<<<< * else: * try: */ __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(7, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":259 * # ReadyForQuery * self._parse_msg_ready_for_query() * if self.result_type == RESULT_FAILED: # <<<<<<<<<<<<<< * self._push_result() * else: */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":262 * self._push_result() * else: * try: # <<<<<<<<<<<<<< * buf = next(self._execute_iter) * except StopIteration: */ /*else*/ { { __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/coreproto.pyx":263 * else: * try: * buf = next(self._execute_iter) # <<<<<<<<<<<<<< * except StopIteration: * self._push_result() */ __pyx_t_1 = __pyx_v_self->_execute_iter; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 263, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":262 * self._push_result() * else: * try: # <<<<<<<<<<<<<< * buf = next(self._execute_iter) * except StopIteration: */ } /* "asyncpg/protocol/coreproto.pyx":272 * else: * # Next iteration over the executemany() arg sequence * self._send_bind_message( # <<<<<<<<<<<<<< * self._execute_portal_name, self._execute_stmt_name, * buf, 0) */ /*else:*/ { /* "asyncpg/protocol/coreproto.pyx":273 * # Next iteration over the executemany() arg sequence * self._send_bind_message( * self._execute_portal_name, self._execute_stmt_name, # <<<<<<<<<<<<<< * buf, 0) * */ __pyx_t_1 = __pyx_v_self->_execute_portal_name; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = __pyx_v_self->_execute_stmt_name; __Pyx_INCREF(__pyx_t_6); /* "asyncpg/protocol/coreproto.pyx":272 * else: * # Next iteration over the executemany() arg sequence * self._send_bind_message( # <<<<<<<<<<<<<< * self._execute_portal_name, self._execute_stmt_name, * buf, 0) */ __pyx_t_7 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_send_bind_message(__pyx_v_self, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_6), __pyx_v_buf, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 272, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":264 * try: * buf = next(self._execute_iter) * except StopIteration: # <<<<<<<<<<<<<< * self._push_result() * except Exception as e: */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(7, 264, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/coreproto.pyx":265 * buf = next(self._execute_iter) * except StopIteration: * self._push_result() # <<<<<<<<<<<<<< * except Exception as e: * self.result_type = RESULT_FAILED */ __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(7, 265, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L5_exception_handled; } /* "asyncpg/protocol/coreproto.pyx":266 * except StopIteration: * self._push_result() * except Exception as e: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = e */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(7, 266, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":267 * self._push_result() * except Exception as e: * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = e * self._push_result() */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":268 * except Exception as e: * self.result_type = RESULT_FAILED * self.result = e # <<<<<<<<<<<<<< * self._push_result() * else: */ __Pyx_INCREF(__pyx_v_e); __Pyx_GIVEREF(__pyx_v_e); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_v_e; /* "asyncpg/protocol/coreproto.pyx":269 * self.result_type = RESULT_FAILED * self.result = e * self._push_result() # <<<<<<<<<<<<<< * else: * # Next iteration over the executemany() arg sequence */ __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(7, 269, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "asyncpg/protocol/coreproto.pyx":266 * except StopIteration: * self._push_result() * except Exception as e: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = e */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; goto __pyx_L18; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L17_error:; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __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_XGOTREF(__pyx_t_17); __pyx_t_8 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L6_except_error; } __pyx_L18:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "asyncpg/protocol/coreproto.pyx":262 * self._push_result() * else: * try: # <<<<<<<<<<<<<< * buf = next(self._execute_iter) * except StopIteration: */ __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_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L9_try_end:; } } __pyx_L3:; /* "asyncpg/protocol/coreproto.pyx":256 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; /* "asyncpg/protocol/coreproto.pyx":276 * buf, 0) * * elif mtype == b'I': # <<<<<<<<<<<<<< * # EmptyQueryResponse * self.buffer.consume_message() */ case 'I': /* "asyncpg/protocol/coreproto.pyx":278 * elif mtype == b'I': * # EmptyQueryResponse * self.buffer.consume_message() # <<<<<<<<<<<<<< * * cdef _process__bind(self, char mtype): */ __pyx_t_7 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/coreproto.pyx":276 * buf, 0) * * elif mtype == b'I': # <<<<<<<<<<<<<< * # EmptyQueryResponse * self.buffer.consume_message() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":233 * self.buffer.consume_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_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":280 * self.buffer.consume_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; __Pyx_RefNannySetupContext("_process__bind", 0); /* "asyncpg/protocol/coreproto.pyx":281 * * 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":283 * 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(7, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":281 * * cdef _process__bind(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; /* "asyncpg/protocol/coreproto.pyx":285 * self._parse_msg_error_response(True) * * elif mtype == b'2': # <<<<<<<<<<<<<< * # BindComplete * self.buffer.consume_message() */ case '2': /* "asyncpg/protocol/coreproto.pyx":287 * elif mtype == b'2': * # BindComplete * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":285 * self._parse_msg_error_response(True) * * elif mtype == b'2': # <<<<<<<<<<<<<< * # BindComplete * self.buffer.consume_message() */ break; /* "asyncpg/protocol/coreproto.pyx":289 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":291 * 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(7, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":292 * # 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(7, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":289 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":280 * self.buffer.consume_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":294 * 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; __Pyx_RefNannySetupContext("_process__close_stmt_portal", 0); /* "asyncpg/protocol/coreproto.pyx":295 * * 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":297 * 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(7, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":295 * * cdef _process__close_stmt_portal(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; /* "asyncpg/protocol/coreproto.pyx":299 * self._parse_msg_error_response(True) * * elif mtype == b'3': # <<<<<<<<<<<<<< * # CloseComplete * self.buffer.consume_message() */ case '3': /* "asyncpg/protocol/coreproto.pyx":301 * elif mtype == b'3': * # CloseComplete * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":299 * self._parse_msg_error_response(True) * * elif mtype == b'3': # <<<<<<<<<<<<<< * # CloseComplete * self.buffer.consume_message() */ break; /* "asyncpg/protocol/coreproto.pyx":303 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":305 * 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(7, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":306 * # 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(7, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":303 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":294 * 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":308 * 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; __Pyx_RefNannySetupContext("_process__simple_query", 0); /* "asyncpg/protocol/coreproto.pyx":309 * * 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":313 * # 'I' - EmptyQueryResponse * # 'T' - RowDescription * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'E': */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":309 * * cdef _process__simple_query(self, char mtype): * if mtype in {b'D', b'I', b'T'}: # <<<<<<<<<<<<<< * # 'D' - DataRow * # 'I' - EmptyQueryResponse */ break; /* "asyncpg/protocol/coreproto.pyx":315 * self.buffer.consume_message() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ case 'E': /* "asyncpg/protocol/coreproto.pyx":317 * 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(7, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":315 * self.buffer.consume_message() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; /* "asyncpg/protocol/coreproto.pyx":319 * self._parse_msg_error_response(True) * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":321 * 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(7, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":322 * # 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(7, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":319 * self._parse_msg_error_response(True) * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; /* "asyncpg/protocol/coreproto.pyx":324 * self._push_result() * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ case 'C': /* "asyncpg/protocol/coreproto.pyx":326 * 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(7, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":324 * self._push_result() * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ break; default: /* "asyncpg/protocol/coreproto.pyx":330 * else: * # We don't really care about COPY IN etc * self.buffer.consume_message() # <<<<<<<<<<<<<< * * cdef _process__copy_out(self, char mtype): */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; break; } /* "asyncpg/protocol/coreproto.pyx":308 * 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":332 * self.buffer.consume_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; __Pyx_RefNannySetupContext("_process__copy_out", 0); /* "asyncpg/protocol/coreproto.pyx":333 * * 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":334 * 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(7, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":333 * * cdef _process__copy_out(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ break; /* "asyncpg/protocol/coreproto.pyx":336 * self._parse_msg_error_response(True) * * elif mtype == b'H': # <<<<<<<<<<<<<< * # CopyOutResponse * self._set_state(PROTOCOL_COPY_OUT_DATA) */ case 'H': /* "asyncpg/protocol/coreproto.pyx":338 * elif mtype == b'H': * # CopyOutResponse * self._set_state(PROTOCOL_COPY_OUT_DATA) # <<<<<<<<<<<<<< * self.buffer.consume_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(7, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":339 * # CopyOutResponse * self._set_state(PROTOCOL_COPY_OUT_DATA) * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":336 * self._parse_msg_error_response(True) * * elif mtype == b'H': # <<<<<<<<<<<<<< * # CopyOutResponse * self._set_state(PROTOCOL_COPY_OUT_DATA) */ break; /* "asyncpg/protocol/coreproto.pyx":341 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":343 * 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(7, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":344 * # 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(7, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":341 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":332 * self.buffer.consume_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":346 * 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; __Pyx_RefNannySetupContext("_process__copy_out_data", 0); /* "asyncpg/protocol/coreproto.pyx":347 * * 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":348 * 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(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":347 * * cdef _process__copy_out_data(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ break; /* "asyncpg/protocol/coreproto.pyx":350 * self._parse_msg_error_response(True) * * elif mtype == b'd': # <<<<<<<<<<<<<< * # CopyData * self._parse_copy_data_msgs() */ case 'd': /* "asyncpg/protocol/coreproto.pyx":352 * 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(7, 352, __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'd': # <<<<<<<<<<<<<< * # CopyData * self._parse_copy_data_msgs() */ break; /* "asyncpg/protocol/coreproto.pyx":354 * self._parse_copy_data_msgs() * * elif mtype == b'c': # <<<<<<<<<<<<<< * # CopyDone * self.buffer.consume_message() */ case 'c': /* "asyncpg/protocol/coreproto.pyx":356 * elif mtype == b'c': * # CopyDone * self.buffer.consume_message() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_COPY_OUT_DONE) * */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":357 * # CopyDone * self.buffer.consume_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(7, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":354 * self._parse_copy_data_msgs() * * elif mtype == b'c': # <<<<<<<<<<<<<< * # CopyDone * self.buffer.consume_message() */ break; /* "asyncpg/protocol/coreproto.pyx":359 * self._set_state(PROTOCOL_COPY_OUT_DONE) * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ case 'C': /* "asyncpg/protocol/coreproto.pyx":361 * 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(7, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":359 * self._set_state(PROTOCOL_COPY_OUT_DONE) * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ break; /* "asyncpg/protocol/coreproto.pyx":363 * self._parse_msg_command_complete() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":365 * 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(7, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":366 * # 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(7, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":363 * self._parse_msg_command_complete() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":346 * 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":368 * 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; __Pyx_RefNannySetupContext("_process__copy_in", 0); /* "asyncpg/protocol/coreproto.pyx":369 * * 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":370 * 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(7, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":369 * * cdef _process__copy_in(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ break; /* "asyncpg/protocol/coreproto.pyx":372 * self._parse_msg_error_response(True) * * elif mtype == b'G': # <<<<<<<<<<<<<< * # CopyInResponse * self._set_state(PROTOCOL_COPY_IN_DATA) */ case 'G': /* "asyncpg/protocol/coreproto.pyx":374 * elif mtype == b'G': * # CopyInResponse * self._set_state(PROTOCOL_COPY_IN_DATA) # <<<<<<<<<<<<<< * self.buffer.consume_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(7, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":375 * # CopyInResponse * self._set_state(PROTOCOL_COPY_IN_DATA) * self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":372 * self._parse_msg_error_response(True) * * elif mtype == b'G': # <<<<<<<<<<<<<< * # CopyInResponse * self._set_state(PROTOCOL_COPY_IN_DATA) */ break; /* "asyncpg/protocol/coreproto.pyx":377 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":379 * 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(7, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":380 * # 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(7, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":377 * self.buffer.consume_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":368 * 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":382 * 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; __Pyx_RefNannySetupContext("_process__copy_in_data", 0); /* "asyncpg/protocol/coreproto.pyx":383 * * 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":384 * 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(7, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":383 * * cdef _process__copy_in_data(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ break; /* "asyncpg/protocol/coreproto.pyx":386 * self._parse_msg_error_response(True) * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ case 'C': /* "asyncpg/protocol/coreproto.pyx":388 * 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(7, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":386 * self._parse_msg_error_response(True) * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ break; /* "asyncpg/protocol/coreproto.pyx":390 * self._parse_msg_command_complete() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ case 'Z': /* "asyncpg/protocol/coreproto.pyx":392 * 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(7, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":393 * # 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(7, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":390 * self._parse_msg_command_complete() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":382 * 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":395 * 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 int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_parse_msg_command_complete", 0); /* "asyncpg/protocol/coreproto.pyx":400 * 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_v_cbuf = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_try_consume_message(__pyx_v_self->buffer, (&__pyx_v_cbuf_len)); /* "asyncpg/protocol/coreproto.pyx":401 * * 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_2 = ((__pyx_v_cbuf != NULL) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_cbuf_len > 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":402 * 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_cstr() */ __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_cbuf, (__pyx_v_cbuf_len - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":401 * * 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":404 * msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1) * else: * msg = self.buffer.read_cstr() # <<<<<<<<<<<<<< * self.result_status_msg = msg * */ /*else*/ { __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L3:; /* "asyncpg/protocol/coreproto.pyx":405 * else: * msg = self.buffer.read_cstr() * self.result_status_msg = msg # <<<<<<<<<<<<<< * * cdef _parse_copy_data_msgs(self): */ if (!(likely(PyBytes_CheckExact(__pyx_v_msg))||((__pyx_v_msg) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_msg)->tp_name), 0))) __PYX_ERR(7, 405, __pyx_L1_error) __pyx_t_3 = __pyx_v_msg; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __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_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":395 * 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_3); __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":407 * 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_8protocol_8protocol_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; __Pyx_RefNannySetupContext("_parse_copy_data_msgs", 0); /* "asyncpg/protocol/coreproto.pyx":409 * 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_8protocol_8protocol_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":411 * ReadBuffer buf = self.buffer * * self.result = buf.consume_messages(b'd') # <<<<<<<<<<<<<< * * self._skip_discard = True */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_messages(__pyx_v_buf, 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 411, __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":413 * self.result = buf.consume_messages(b'd') * * self._skip_discard = True # <<<<<<<<<<<<<< * * # By this point we have consumed all CopyData messages */ __pyx_v_self->_skip_discard = 1; /* "asyncpg/protocol/coreproto.pyx":422 * # we must not push the result here and let the * # _process__copy_out_data subprotocol do the job. * if not buf.has_message(): # <<<<<<<<<<<<<< * self._on_result() * self.result = None */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message(__pyx_v_buf); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(7, 422, __pyx_L1_error) __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":423 * # _process__copy_out_data subprotocol do the job. * if not buf.has_message(): * self._on_result() # <<<<<<<<<<<<<< * self.result = None * */ __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(7, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":424 * if not buf.has_message(): * self._on_result() * self.result = None # <<<<<<<<<<<<<< * * cdef _write_copy_data_msg(self, object data): */ __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":422 * # we must not push the result here and let the * # _process__copy_out_data subprotocol do the job. * if not buf.has_message(): # <<<<<<<<<<<<<< * self._on_result() * self.result = None */ } /* "asyncpg/protocol/coreproto.pyx":407 * 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":426 * self.result = None * * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_v_mview = 0; Py_buffer *__pyx_v_pybuf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; 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; __Pyx_RefNannySetupContext("_write_copy_data_msg", 0); /* "asyncpg/protocol/coreproto.pyx":432 * Py_buffer *pybuf * * mview = PyMemoryView_GetContiguous(data, cpython.PyBUF_SIMPLE, b'C') # <<<<<<<<<<<<<< * * try: */ __pyx_t_1 = PyMemoryView_GetContiguous(__pyx_v_data, PyBUF_SIMPLE, 'C'); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mview = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":434 * mview = PyMemoryView_GetContiguous(data, cpython.PyBUF_SIMPLE, b'C') * * try: # <<<<<<<<<<<<<< * pybuf = PyMemoryView_GET_BUFFER(mview) * */ /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":435 * * try: * pybuf = PyMemoryView_GET_BUFFER(mview) # <<<<<<<<<<<<<< * * buf = WriteBuffer.new_message(b'd') */ __pyx_v_pybuf = PyMemoryView_GET_BUFFER(__pyx_v_mview); /* "asyncpg/protocol/coreproto.pyx":437 * pybuf = 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_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('d')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 437, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":438 * * buf = WriteBuffer.new_message(b'd') * buf.write_cstr(pybuf.buf, pybuf.len) # <<<<<<<<<<<<<< * buf.end_message() * finally: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr(__pyx_v_buf, ((char const *)__pyx_v_pybuf->buf), __pyx_v_pybuf->len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 438, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":439 * buf = WriteBuffer.new_message(b'd') * buf.write_cstr(pybuf.buf, pybuf.len) * buf.end_message() # <<<<<<<<<<<<<< * finally: * mview.release() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 439, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "asyncpg/protocol/coreproto.pyx":441 * buf.end_message() * finally: * mview.release() # <<<<<<<<<<<<<< * * self._write(buf) */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mview, __pyx_n_s_release); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 441, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 441, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L5; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L4_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mview, __pyx_n_s_release); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 441, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 441, __pyx_L7_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 441, __pyx_L7_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_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:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_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":443 * 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(7, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":426 * self.result = None * * cdef _write_copy_data_msg(self, object data): # <<<<<<<<<<<<<< * cdef: * WriteBuffer buf */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._write_copy_data_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XDECREF(__pyx_v_mview); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":445 * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_write_copy_done_msg", 0); /* "asyncpg/protocol/coreproto.pyx":449 * WriteBuffer buf * * buf = WriteBuffer.new_message(b'c') # <<<<<<<<<<<<<< * buf.end_message() * self._write(buf) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('c')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":450 * * buf = WriteBuffer.new_message(b'c') * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":451 * 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(7, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":445 * 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":453 * 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_8protocol_8protocol_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; __Pyx_RefNannySetupContext("_write_copy_fail_msg", 0); /* "asyncpg/protocol/coreproto.pyx":457 * WriteBuffer buf * * buf = WriteBuffer.new_message(b'f') # <<<<<<<<<<<<<< * buf.write_str(cause or '', self.encoding) * buf.end_message() */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('f')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":458 * * 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(7, 458, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_cause); __pyx_t_1 = __pyx_v_cause; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_kp_u__22); __pyx_t_1 = __pyx_kp_u__22; __pyx_L3_bool_binop_done:; __pyx_t_3 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 458, __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":459 * buf = WriteBuffer.new_message(b'f') * buf.write_str(cause or '', self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":460 * 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(7, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":453 * 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":462 * 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_8protocol_8protocol_ReadBuffer *__pyx_v_buf = 0; PyObject *__pyx_v_rows = 0; __pyx_t_7asyncpg_8protocol_8protocol_decode_row_method __pyx_v_decoder; char const *__pyx_v_cbuf; Py_ssize_t __pyx_v_cbuf_len; PyObject *__pyx_v_row = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v_mem = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int32_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; int __pyx_t_10; __Pyx_RefNannySetupContext("_parse_data_msgs", 0); /* "asyncpg/protocol/coreproto.pyx":464 * cdef _parse_data_msgs(self): * cdef: * ReadBuffer buf = self.buffer # <<<<<<<<<<<<<< * list rows * decode_row_method decoder = self._decode_row */ __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer); __Pyx_INCREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":466 * ReadBuffer buf = self.buffer * list rows * decode_row_method decoder = self._decode_row # <<<<<<<<<<<<<< * * const char* cbuf */ __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":473 * Memory mem * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if buf.get_message_type() != b'D': * raise apg_exc.InternalClientError( */ __pyx_t_2 = (ASYNCPG_DEBUG != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":474 * * if ASYNCPG_DEBUG: * if buf.get_message_type() != b'D': # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_parse_data_msgs: first message is not "D"') */ __pyx_t_2 = ((__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_type(__pyx_v_buf) != 'D') != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":475 * if ASYNCPG_DEBUG: * if buf.get_message_type() != b'D': * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_parse_data_msgs: first message is not "D"') * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 475, __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_3, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(7, 475, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":474 * * if ASYNCPG_DEBUG: * if buf.get_message_type() != b'D': # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_parse_data_msgs: first message is not "D"') */ } /* "asyncpg/protocol/coreproto.pyx":473 * Memory mem * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if buf.get_message_type() != b'D': * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/coreproto.pyx":478 * '_parse_data_msgs: first message is not "D"') * * if self._discard_data: # <<<<<<<<<<<<<< * while True: * buf.consume_message() */ __pyx_t_2 = (__pyx_v_self->_discard_data != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":479 * * if self._discard_data: * while True: # <<<<<<<<<<<<<< * buf.consume_message() * if not buf.has_message() or buf.get_message_type() != b'D': */ while (1) { /* "asyncpg/protocol/coreproto.pyx":480 * if self._discard_data: * while True: * buf.consume_message() # <<<<<<<<<<<<<< * if not buf.has_message() or buf.get_message_type() != b'D': * self._skip_discard = True */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":481 * while True: * buf.consume_message() * if not buf.has_message() or buf.get_message_type() != b'D': # <<<<<<<<<<<<<< * self._skip_discard = True * return */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message(__pyx_v_buf); if (unlikely(__pyx_t_4 == ((int32_t)-1))) __PYX_ERR(7, 481, __pyx_L1_error) __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L9_bool_binop_done; } __pyx_t_5 = ((__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_type(__pyx_v_buf) != 'D') != 0); __pyx_t_2 = __pyx_t_5; __pyx_L9_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":482 * buf.consume_message() * if not buf.has_message() or buf.get_message_type() != b'D': * self._skip_discard = True # <<<<<<<<<<<<<< * return * */ __pyx_v_self->_skip_discard = 1; /* "asyncpg/protocol/coreproto.pyx":483 * if not buf.has_message() or buf.get_message_type() != b'D': * self._skip_discard = True * return # <<<<<<<<<<<<<< * * if ASYNCPG_DEBUG: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":481 * while True: * buf.consume_message() * if not buf.has_message() or buf.get_message_type() != b'D': # <<<<<<<<<<<<<< * self._skip_discard = True * return */ } } /* "asyncpg/protocol/coreproto.pyx":478 * '_parse_data_msgs: first message is not "D"') * * if self._discard_data: # <<<<<<<<<<<<<< * while True: * buf.consume_message() */ } /* "asyncpg/protocol/coreproto.pyx":485 * return * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if type(self.result) is not list: * raise apg_exc.InternalClientError( */ __pyx_t_2 = (ASYNCPG_DEBUG != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":486 * * if ASYNCPG_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))); __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":487 * if ASYNCPG_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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":488 * 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_parse_data_msgs_result_is_not_a, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/coreproto.pyx":489 * raise apg_exc.InternalClientError( * '_parse_data_msgs: result is not a list, but {!r}'. * format(self.result)) # <<<<<<<<<<<<<< * * rows = self.result */ __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_8) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->result); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_self->result}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 489, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_self->result}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 489, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_self->result); __Pyx_GIVEREF(__pyx_v_self->result); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_self->result); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_7) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 487, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 487, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(7, 487, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":486 * * if ASYNCPG_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":485 * return * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if type(self.result) is not list: * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/coreproto.pyx":491 * format(self.result)) * * rows = self.result # <<<<<<<<<<<<<< * while True: * cbuf = buf.try_consume_message(&cbuf_len) */ if (!(likely(PyList_CheckExact(__pyx_v_self->result))||((__pyx_v_self->result) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_self->result)->tp_name), 0))) __PYX_ERR(7, 491, __pyx_L1_error) __pyx_t_1 = __pyx_v_self->result; __Pyx_INCREF(__pyx_t_1); __pyx_v_rows = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":492 * * rows = self.result * while True: # <<<<<<<<<<<<<< * cbuf = buf.try_consume_message(&cbuf_len) * if cbuf != NULL: */ while (1) { /* "asyncpg/protocol/coreproto.pyx":493 * rows = self.result * while True: * cbuf = buf.try_consume_message(&cbuf_len) # <<<<<<<<<<<<<< * if cbuf != NULL: * row = decoder(self, cbuf, cbuf_len) */ __pyx_v_cbuf = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_try_consume_message(__pyx_v_buf, (&__pyx_v_cbuf_len)); /* "asyncpg/protocol/coreproto.pyx":494 * while True: * cbuf = buf.try_consume_message(&cbuf_len) * if cbuf != NULL: # <<<<<<<<<<<<<< * row = decoder(self, cbuf, cbuf_len) * else: */ __pyx_t_5 = ((__pyx_v_cbuf != NULL) != 0); if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":495 * cbuf = buf.try_consume_message(&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(7, 495, __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":494 * while True: * cbuf = buf.try_consume_message(&cbuf_len) * if cbuf != NULL: # <<<<<<<<<<<<<< * row = decoder(self, cbuf, cbuf_len) * else: */ goto __pyx_L15; } /* "asyncpg/protocol/coreproto.pyx":497 * row = decoder(self, cbuf, cbuf_len) * else: * mem = buf.consume_message() # <<<<<<<<<<<<<< * row = decoder(self, mem.buf, mem.length) * */ /*else*/ { __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_mem, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":498 * else: * mem = buf.consume_message() * row = decoder(self, mem.buf, mem.length) # <<<<<<<<<<<<<< * * cpython.PyList_Append(rows, row) */ __pyx_t_1 = __pyx_v_decoder(((PyObject *)__pyx_v_self), __pyx_v_mem->buf, __pyx_v_mem->length); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L15:; /* "asyncpg/protocol/coreproto.pyx":500 * row = decoder(self, mem.buf, mem.length) * * cpython.PyList_Append(rows, row) # <<<<<<<<<<<<<< * * if not buf.has_message() or buf.get_message_type() != b'D': */ __pyx_t_10 = PyList_Append(__pyx_v_rows, __pyx_v_row); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 500, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":502 * cpython.PyList_Append(rows, row) * * if not buf.has_message() or buf.get_message_type() != b'D': # <<<<<<<<<<<<<< * self._skip_discard = True * return */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message(__pyx_v_buf); if (unlikely(__pyx_t_4 == ((int32_t)-1))) __PYX_ERR(7, 502, __pyx_L1_error) __pyx_t_2 = ((!(__pyx_t_4 != 0)) != 0); if (!__pyx_t_2) { } else { __pyx_t_5 = __pyx_t_2; goto __pyx_L17_bool_binop_done; } __pyx_t_2 = ((__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_type(__pyx_v_buf) != 'D') != 0); __pyx_t_5 = __pyx_t_2; __pyx_L17_bool_binop_done:; if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":503 * * if not buf.has_message() or buf.get_message_type() != b'D': * self._skip_discard = True # <<<<<<<<<<<<<< * return * */ __pyx_v_self->_skip_discard = 1; /* "asyncpg/protocol/coreproto.pyx":504 * if not buf.has_message() or buf.get_message_type() != b'D': * self._skip_discard = True * return # <<<<<<<<<<<<<< * * cdef _parse_msg_backend_key_data(self): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":502 * cpython.PyList_Append(rows, row) * * if not buf.has_message() or buf.get_message_type() != b'D': # <<<<<<<<<<<<<< * self._skip_discard = True * return */ } } /* "asyncpg/protocol/coreproto.pyx":462 * 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_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.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((PyObject *)__pyx_v_mem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":506 * return * * 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 PyObject *__pyx_t_1 = NULL; int32_t __pyx_t_2; __Pyx_RefNannySetupContext("_parse_msg_backend_key_data", 0); /* "asyncpg/protocol/coreproto.pyx":507 * * cdef _parse_msg_backend_key_data(self): * self.backend_pid = self.buffer.read_int32() # <<<<<<<<<<<<<< * self.backend_secret = self.buffer.read_int32() * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->backend_pid = __pyx_t_2; /* "asyncpg/protocol/coreproto.pyx":508 * 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 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->backend_secret = __pyx_t_2; /* "asyncpg/protocol/coreproto.pyx":506 * return * * 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_XDECREF(__pyx_t_1); __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":510 * self.backend_secret = self.buffer.read_int32() * * cdef _parse_msg_parameter_status(self): # <<<<<<<<<<<<<< * name = self.buffer.read_cstr() * name = name.decode(self.encoding) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_parameter_status(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_parse_msg_parameter_status", 0); /* "asyncpg/protocol/coreproto.pyx":511 * * cdef _parse_msg_parameter_status(self): * name = self.buffer.read_cstr() # <<<<<<<<<<<<<< * name = name.decode(self.encoding) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":512 * cdef _parse_msg_parameter_status(self): * name = self.buffer.read_cstr() * name = name.decode(self.encoding) # <<<<<<<<<<<<<< * * val = self.buffer.read_cstr() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 512, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 512, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_self->encoding); __Pyx_GIVEREF(__pyx_v_self->encoding); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->encoding); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":514 * name = name.decode(self.encoding) * * val = self.buffer.read_cstr() # <<<<<<<<<<<<<< * val = val.decode(self.encoding) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_val = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":515 * * val = self.buffer.read_cstr() * val = val.decode(self.encoding) # <<<<<<<<<<<<<< * * self._set_server_parameter(name, val) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 515, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 515, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_self->encoding); __Pyx_GIVEREF(__pyx_v_self->encoding); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_self->encoding); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 515, __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; __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":517 * 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(7, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":510 * self.backend_secret = self.buffer.read_int32() * * cdef _parse_msg_parameter_status(self): # <<<<<<<<<<<<<< * name = self.buffer.read_cstr() * name = name.decode(self.encoding) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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":519 * self._set_server_parameter(name, val) * * cdef _parse_msg_notification(self): # <<<<<<<<<<<<<< * pid = self.buffer.read_int32() * channel = self.buffer.read_cstr().decode(self.encoding) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_notification(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_v_pid = NULL; PyObject *__pyx_v_channel = NULL; PyObject *__pyx_v_payload = 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; __Pyx_RefNannySetupContext("_parse_msg_notification", 0); /* "asyncpg/protocol/coreproto.pyx":520 * * cdef _parse_msg_notification(self): * pid = self.buffer.read_int32() # <<<<<<<<<<<<<< * channel = self.buffer.read_cstr().decode(self.encoding) * payload = self.buffer.read_cstr().decode(self.encoding) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_pid = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":521 * cdef _parse_msg_notification(self): * pid = self.buffer.read_int32() * channel = self.buffer.read_cstr().decode(self.encoding) # <<<<<<<<<<<<<< * payload = self.buffer.read_cstr().decode(self.encoding) * self._on_notification(pid, channel, payload) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 521, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 521, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_self->encoding); __Pyx_GIVEREF(__pyx_v_self->encoding); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->encoding); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_channel = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":522 * pid = self.buffer.read_int32() * channel = self.buffer.read_cstr().decode(self.encoding) * payload = self.buffer.read_cstr().decode(self.encoding) # <<<<<<<<<<<<<< * self._on_notification(pid, channel, payload) * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 522, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 522, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_self->encoding); __Pyx_GIVEREF(__pyx_v_self->encoding); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_self->encoding); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_payload = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":523 * channel = self.buffer.read_cstr().decode(self.encoding) * payload = self.buffer.read_cstr().decode(self.encoding) * self._on_notification(pid, channel, payload) # <<<<<<<<<<<<<< * * cdef _parse_msg_authentication(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_notification(__pyx_v_self, __pyx_v_pid, __pyx_v_channel, __pyx_v_payload); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":519 * self._set_server_parameter(name, val) * * cdef _parse_msg_notification(self): # <<<<<<<<<<<<<< * pid = self.buffer.read_int32() * channel = self.buffer.read_cstr().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.CoreProtocol._parse_msg_notification", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pid); __Pyx_XDECREF(__pyx_v_channel); __Pyx_XDECREF(__pyx_v_payload); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":525 * 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_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int32_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; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("_parse_msg_authentication", 0); /* "asyncpg/protocol/coreproto.pyx":530 * bytes md5_salt * * status = self.buffer.read_int32() # <<<<<<<<<<<<<< * * if status == AUTH_SUCCESSFUL: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_status = __pyx_t_2; /* "asyncpg/protocol/coreproto.pyx":532 * 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":534 * 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":532 * status = self.buffer.read_int32() * * if status == AUTH_SUCCESSFUL: # <<<<<<<<<<<<<< * # AuthenticationOk * self.result_type = RESULT_OK */ break; /* "asyncpg/protocol/coreproto.pyx":536 * self.result_type = RESULT_OK * * elif status == AUTH_REQUIRED_PASSWORD: # <<<<<<<<<<<<<< * # AuthenticationCleartextPassword * self.result_type = RESULT_OK */ case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORD: /* "asyncpg/protocol/coreproto.pyx":538 * 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":539 * # AuthenticationCleartextPassword * self.result_type = RESULT_OK * self.auth_msg = self._auth_password_message_cleartext() # <<<<<<<<<<<<<< * * elif status == AUTH_REQUIRED_PASSWORDMD5: */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_password_message_cleartext(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, __pyx_t_1) < 0) __PYX_ERR(7, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":536 * self.result_type = RESULT_OK * * elif status == AUTH_REQUIRED_PASSWORD: # <<<<<<<<<<<<<< * # AuthenticationCleartextPassword * self.result_type = RESULT_OK */ break; /* "asyncpg/protocol/coreproto.pyx":541 * self.auth_msg = self._auth_password_message_cleartext() * * elif status == AUTH_REQUIRED_PASSWORDMD5: # <<<<<<<<<<<<<< * # AuthenticationMD5Password * # Note: MD5 salt is passed as a four-byte sequence */ case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORDMD5: /* "asyncpg/protocol/coreproto.pyx":545 * # Note: MD5 salt is passed as a four-byte sequence * md5_salt = cpython.PyBytes_FromStringAndSize( * self.buffer.read_bytes(4), 4) # <<<<<<<<<<<<<< * self.auth_msg = self._auth_password_message_md5(md5_salt) * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_bytes(__pyx_v_self->buffer, 4); if (unlikely(__pyx_t_3 == ((char const *)NULL))) __PYX_ERR(7, 545, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":544 * # AuthenticationMD5Password * # Note: MD5 salt is passed as a four-byte sequence * md5_salt = cpython.PyBytes_FromStringAndSize( # <<<<<<<<<<<<<< * self.buffer.read_bytes(4), 4) * self.auth_msg = self._auth_password_message_md5(md5_salt) */ __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_t_3, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_md5_salt = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":546 * md5_salt = cpython.PyBytes_FromStringAndSize( * self.buffer.read_bytes(4), 4) * self.auth_msg = self._auth_password_message_md5(md5_salt) # <<<<<<<<<<<<<< * * elif status in (AUTH_REQUIRED_KERBEROS, AUTH_REQUIRED_SCMCRED, */ __pyx_t_1 = ((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_1)) __PYX_ERR(7, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, __pyx_t_1) < 0) __PYX_ERR(7, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":541 * 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; /* "asyncpg/protocol/coreproto.pyx":548 * self.auth_msg = self._auth_password_message_md5(md5_salt) * * elif status in (AUTH_REQUIRED_KERBEROS, AUTH_REQUIRED_SCMCRED, # <<<<<<<<<<<<<< * AUTH_REQUIRED_GSS, AUTH_REQUIRED_GSS_CONTINUE, * AUTH_REQUIRED_SSPI): */ case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_KERBEROS: case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SCMCRED: /* "asyncpg/protocol/coreproto.pyx":549 * * elif status in (AUTH_REQUIRED_KERBEROS, AUTH_REQUIRED_SCMCRED, * AUTH_REQUIRED_GSS, AUTH_REQUIRED_GSS_CONTINUE, # <<<<<<<<<<<<<< * AUTH_REQUIRED_SSPI): * self.result_type = RESULT_FAILED */ case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS: case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS_CONTINUE: /* "asyncpg/protocol/coreproto.pyx":550 * elif status in (AUTH_REQUIRED_KERBEROS, AUTH_REQUIRED_SCMCRED, * AUTH_REQUIRED_GSS, AUTH_REQUIRED_GSS_CONTINUE, * AUTH_REQUIRED_SSPI): # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( */ case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SSPI: /* "asyncpg/protocol/coreproto.pyx":551 * AUTH_REQUIRED_GSS, AUTH_REQUIRED_GSS_CONTINUE, * AUTH_REQUIRED_SSPI): * 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":552 * AUTH_REQUIRED_SSPI): * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'unsupported authentication method requested by the ' * 'server: {!r}'.format(AUTH_METHOD_NAME[status])) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":554 * self.result = apg_exc.InterfaceError( * 'unsupported authentication method requested by the ' * 'server: {!r}'.format(AUTH_METHOD_NAME[status])) # <<<<<<<<<<<<<< * * else: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unsupported_authentication_metho, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_AUTH_METHOD_NAME); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, __pyx_v_status, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 554, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 554, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 552, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 552, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":552 * AUTH_REQUIRED_SSPI): * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'unsupported authentication method requested by the ' * 'server: {!r}'.format(AUTH_METHOD_NAME[status])) */ __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":548 * self.auth_msg = self._auth_password_message_md5(md5_salt) * * elif status in (AUTH_REQUIRED_KERBEROS, AUTH_REQUIRED_SCMCRED, # <<<<<<<<<<<<<< * AUTH_REQUIRED_GSS, AUTH_REQUIRED_GSS_CONTINUE, * AUTH_REQUIRED_SSPI): */ break; default: /* "asyncpg/protocol/coreproto.pyx":557 * * 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":558 * else: * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'unsupported authentication method requested by the ' * 'server: {}'.format(status)) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":560 * self.result = apg_exc.InterfaceError( * 'unsupported authentication method requested by the ' * 'server: {}'.format(status)) # <<<<<<<<<<<<<< * * self.buffer.consume_message() */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unsupported_authentication_metho_2, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_status); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_8) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 560, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 560, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 558, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 558, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":558 * else: * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'unsupported authentication method requested by the ' * 'server: {}'.format(status)) */ __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; break; } /* "asyncpg/protocol/coreproto.pyx":562 * 'server: {}'.format(status)) * * self.buffer.consume_message() # <<<<<<<<<<<<<< * * cdef _auth_password_message_cleartext(self): */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message(__pyx_v_self->buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":525 * 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_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.CoreProtocol._parse_msg_authentication", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_md5_salt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":564 * self.buffer.consume_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_8protocol_8protocol_WriteBuffer *__pyx_v_msg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_auth_password_message_cleartext", 0); /* "asyncpg/protocol/coreproto.pyx":568 * WriteBuffer msg * * msg = WriteBuffer.new_message(b'p') # <<<<<<<<<<<<<< * msg.write_bytestring(self.password.encode('ascii')) * msg.end_message() */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_msg = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":569 * * msg = WriteBuffer.new_message(b'p') * msg.write_bytestring(self.password.encode('ascii')) # <<<<<<<<<<<<<< * msg.end_message() * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(7, 569, __pyx_L1_error) __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytestring(__pyx_v_msg, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 569, __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":570 * msg = WriteBuffer.new_message(b'p') * msg.write_bytestring(self.password.encode('ascii')) * msg.end_message() # <<<<<<<<<<<<<< * * return msg */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":572 * 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":564 * self.buffer.consume_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_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":574 * 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_8protocol_8protocol_WriteBuffer *__pyx_v_msg = 0; PyObject *__pyx_v_userpass = NULL; PyObject *__pyx_v_hash = 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; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("_auth_password_message_md5", 0); /* "asyncpg/protocol/coreproto.pyx":578 * WriteBuffer msg * * msg = WriteBuffer.new_message(b'p') # <<<<<<<<<<<<<< * * # 'md5' + md5(md5(password + username) + salt)) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_msg = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":581 * * # 'md5' + md5(md5(password + username) + salt)) * userpass = ((self.password or '') + (self.user or '')).encode('ascii') # <<<<<<<<<<<<<< * hash = hashlib_md5(hashlib_md5(userpass).hexdigest().\ * encode('ascii') + salt).hexdigest().encode('ascii') */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 581, __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(7, 581, __pyx_L1_error) if (!__pyx_t_3) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_kp_u__22); __pyx_t_1 = __pyx_kp_u__22; __pyx_L3_bool_binop_done:; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_user); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 581, __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(7, 581, __pyx_L1_error) if (!__pyx_t_3) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_bool_binop_done; } __Pyx_INCREF(__pyx_kp_u__22); __pyx_t_2 = __pyx_kp_u__22; __pyx_L5_bool_binop_done:; __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 581, __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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_userpass = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":582 * # 'md5' + md5(md5(password + username) + salt)) * userpass = ((self.password or '') + (self.user or '')).encode('ascii') * hash = hashlib_md5(hashlib_md5(userpass).hexdigest().\ # <<<<<<<<<<<<<< * encode('ascii') + salt).hexdigest().encode('ascii') * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hashlib_md5); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_hashlib_md5); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_8) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_userpass); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_userpass}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_userpass}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_userpass); __Pyx_GIVEREF(__pyx_v_userpass); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_userpass); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_hexdigest); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_6) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 582, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":583 * userpass = ((self.password or '') + (self.user or '')).encode('ascii') * hash = hashlib_md5(hashlib_md5(userpass).hexdigest().\ * encode('ascii') + salt).hexdigest().encode('ascii') # <<<<<<<<<<<<<< * * msg.write_bytestring(b'md5' + hash) */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v_salt); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hexdigest); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 583, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 583, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_hash = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":585 * encode('ascii') + salt).hexdigest().encode('ascii') * * msg.write_bytestring(b'md5' + hash) # <<<<<<<<<<<<<< * msg.end_message() * */ __pyx_t_4 = PyNumber_Add(__pyx_n_b_md5, __pyx_v_hash); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(7, 585, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytestring(__pyx_v_msg, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":586 * * msg.write_bytestring(b'md5' + hash) * msg.end_message() # <<<<<<<<<<<<<< * * return msg */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":588 * 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":574 * 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_XDECREF(__pyx_t_9); __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_hash); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":590 * 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 PyObject *__pyx_t_1 = NULL; char __pyx_t_2; __Pyx_RefNannySetupContext("_parse_msg_ready_for_query", 0); /* "asyncpg/protocol/coreproto.pyx":591 * * cdef _parse_msg_ready_for_query(self): * cdef char status = self.buffer.read_byte() # <<<<<<<<<<<<<< * * if status == b'I': */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_byte(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_char(__pyx_t_1); if (unlikely((__pyx_t_2 == (char)-1) && PyErr_Occurred())) __PYX_ERR(7, 591, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_status = __pyx_t_2; /* "asyncpg/protocol/coreproto.pyx":593 * 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":594 * * 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":593 * cdef char status = self.buffer.read_byte() * * if status == b'I': # <<<<<<<<<<<<<< * self.xact_status = PQTRANS_IDLE * elif status == b'T': */ break; /* "asyncpg/protocol/coreproto.pyx":595 * if status == b'I': * self.xact_status = PQTRANS_IDLE * elif status == b'T': # <<<<<<<<<<<<<< * self.xact_status = PQTRANS_INTRANS * elif status == b'E': */ case 'T': /* "asyncpg/protocol/coreproto.pyx":596 * 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":595 * if status == b'I': * self.xact_status = PQTRANS_IDLE * elif status == b'T': # <<<<<<<<<<<<<< * self.xact_status = PQTRANS_INTRANS * elif status == b'E': */ break; /* "asyncpg/protocol/coreproto.pyx":597 * elif status == b'T': * self.xact_status = PQTRANS_INTRANS * elif status == b'E': # <<<<<<<<<<<<<< * self.xact_status = PQTRANS_INERROR * else: */ case 'E': /* "asyncpg/protocol/coreproto.pyx":598 * 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":597 * 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":600 * 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":590 * 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_XDECREF(__pyx_t_1); __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":602 * self.xact_status = PQTRANS_UNKNOWN * * cdef _parse_msg_error_response(self, is_error): # <<<<<<<<<<<<<< * cdef: * char code */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_error_response(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_is_error) { char __pyx_v_code; PyObject *__pyx_v_message = 0; PyObject *__pyx_v_parsed = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_parse_msg_error_response", 0); /* "asyncpg/protocol/coreproto.pyx":606 * char code * bytes message * dict parsed = {} # <<<<<<<<<<<<<< * * while True: */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parsed = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":608 * dict parsed = {} * * while True: # <<<<<<<<<<<<<< * code = self.buffer.read_byte() * if code == 0: */ while (1) { /* "asyncpg/protocol/coreproto.pyx":609 * * while True: * code = self.buffer.read_byte() # <<<<<<<<<<<<<< * if code == 0: * break */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_byte(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_char(__pyx_t_1); if (unlikely((__pyx_t_2 == (char)-1) && PyErr_Occurred())) __PYX_ERR(7, 609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_code = __pyx_t_2; /* "asyncpg/protocol/coreproto.pyx":610 * while True: * code = self.buffer.read_byte() * if code == 0: # <<<<<<<<<<<<<< * break * */ __pyx_t_3 = ((__pyx_v_code == 0) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":611 * code = self.buffer.read_byte() * if code == 0: * break # <<<<<<<<<<<<<< * * message = self.buffer.read_cstr() */ goto __pyx_L4_break; /* "asyncpg/protocol/coreproto.pyx":610 * while True: * code = self.buffer.read_byte() * if code == 0: # <<<<<<<<<<<<<< * break * */ } /* "asyncpg/protocol/coreproto.pyx":613 * break * * message = self.buffer.read_cstr() # <<<<<<<<<<<<<< * * parsed[chr(code)] = message.decode() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(7, 613, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_message, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":615 * message = self.buffer.read_cstr() * * 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(7, 615, __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(7, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_char(__pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(PyDict_SetItem(__pyx_v_parsed, __pyx_t_4, __pyx_t_1) < 0)) __PYX_ERR(7, 615, __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":617 * 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(7, 617, __pyx_L1_error) if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":618 * * 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":619 * 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":617 * parsed[chr(code)] = message.decode() * * if is_error: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = parsed */ goto __pyx_L6; } /* "asyncpg/protocol/coreproto.pyx":621 * 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":602 * self.xact_status = PQTRANS_UNKNOWN * * cdef _parse_msg_error_response(self, is_error): # <<<<<<<<<<<<<< * cdef: * char code */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_error_response", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XDECREF(__pyx_v_parsed); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":623 * 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; __Pyx_RefNannySetupContext("_push_result", 0); /* "asyncpg/protocol/coreproto.pyx":624 * * cdef _push_result(self): * try: # <<<<<<<<<<<<<< * self._on_result() * finally: */ /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":625 * 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(7, 625, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "asyncpg/protocol/coreproto.pyx":627 * 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(7, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":628 * 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(7, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L5; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L4_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { /* "asyncpg/protocol/coreproto.pyx":627 * 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(7, 627, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":628 * 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(7, 628, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "asyncpg/protocol/coreproto.pyx":623 * 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":630 * 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":631 * * 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":632 * 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":633 * 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":634 * 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":635 * 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":636 * 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":637 * self.result_status_msg = None * self.result_execute_completed = False * self._discard_data = False # <<<<<<<<<<<<<< * * cdef _set_state(self, ProtocolState new_state): */ __pyx_v_self->_discard_data = 0; /* "asyncpg/protocol/coreproto.pyx":630 * 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":639 * self._discard_data = False * * 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 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; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("_set_state", 0); /* "asyncpg/protocol/coreproto.pyx":640 * * 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":641 * 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; ' */ __pyx_t_1 = ((__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":642 * 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 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 642, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":641 * 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; ' */ } /* "asyncpg/protocol/coreproto.pyx":645 * 'cannot switch to "idle" state; ' * 'protocol is in the "failed" state') * elif self.state == PROTOCOL_IDLE: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'protocol is already in the "idle" state') */ __pyx_t_1 = ((__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":646 * 'protocol is in the "failed" state') * elif self.state == PROTOCOL_IDLE: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'protocol is already in the "idle" state') * else: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 646, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":645 * 'cannot switch to "idle" state; ' * 'protocol is in the "failed" state') * elif self.state == PROTOCOL_IDLE: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'protocol is already in the "idle" state') */ } /* "asyncpg/protocol/coreproto.pyx":649 * 'protocol is already in the "idle" state') * else: * self.state = new_state # <<<<<<<<<<<<<< * * elif new_state == PROTOCOL_FAILED: */ /*else*/ { __pyx_v_self->state = __pyx_v_new_state; } /* "asyncpg/protocol/coreproto.pyx":640 * * cdef _set_state(self, ProtocolState new_state): * if new_state == PROTOCOL_IDLE: # <<<<<<<<<<<<<< * if self.state == PROTOCOL_FAILED: * raise apg_exc.InternalClientError( */ break; /* "asyncpg/protocol/coreproto.pyx":651 * self.state = new_state * * elif new_state == PROTOCOL_FAILED: # <<<<<<<<<<<<<< * self.state = PROTOCOL_FAILED * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED: /* "asyncpg/protocol/coreproto.pyx":652 * * 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":651 * self.state = new_state * * elif new_state == PROTOCOL_FAILED: # <<<<<<<<<<<<<< * self.state = PROTOCOL_FAILED * */ break; /* "asyncpg/protocol/coreproto.pyx":654 * self.state = PROTOCOL_FAILED * * elif new_state == PROTOCOL_CANCELLED: # <<<<<<<<<<<<<< * self.state = PROTOCOL_CANCELLED * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED: /* "asyncpg/protocol/coreproto.pyx":655 * * elif new_state == PROTOCOL_CANCELLED: * self.state = PROTOCOL_CANCELLED # <<<<<<<<<<<<<< * * else: */ __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED; /* "asyncpg/protocol/coreproto.pyx":654 * self.state = PROTOCOL_FAILED * * elif new_state == PROTOCOL_CANCELLED: # <<<<<<<<<<<<<< * self.state = PROTOCOL_CANCELLED * */ break; default: /* "asyncpg/protocol/coreproto.pyx":658 * * else: * if self.state == PROTOCOL_IDLE: # <<<<<<<<<<<<<< * self.state = new_state * */ __pyx_t_1 = ((__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":659 * 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":658 * * else: * if self.state == PROTOCOL_IDLE: # <<<<<<<<<<<<<< * self.state = new_state * */ goto __pyx_L4; } /* "asyncpg/protocol/coreproto.pyx":661 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DATA): * self.state = new_state */ __pyx_t_4 = ((__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT) != 0); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } /* "asyncpg/protocol/coreproto.pyx":662 * * elif (self.state == PROTOCOL_COPY_OUT and * new_state == PROTOCOL_COPY_OUT_DATA): # <<<<<<<<<<<<<< * self.state = new_state * */ __pyx_t_4 = ((__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L5_bool_binop_done:; /* "asyncpg/protocol/coreproto.pyx":661 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DATA): * self.state = new_state */ if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":663 * 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":661 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DATA): * self.state = new_state */ goto __pyx_L4; } /* "asyncpg/protocol/coreproto.pyx":665 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT_DATA and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DONE): * self.state = new_state */ __pyx_t_4 = ((__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA) != 0); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L7_bool_binop_done; } /* "asyncpg/protocol/coreproto.pyx":666 * * elif (self.state == PROTOCOL_COPY_OUT_DATA and * new_state == PROTOCOL_COPY_OUT_DONE): # <<<<<<<<<<<<<< * self.state = new_state * */ __pyx_t_4 = ((__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L7_bool_binop_done:; /* "asyncpg/protocol/coreproto.pyx":665 * 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_1) { /* "asyncpg/protocol/coreproto.pyx":667 * 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":665 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT_DATA and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DONE): * self.state = new_state */ goto __pyx_L4; } /* "asyncpg/protocol/coreproto.pyx":669 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_IN and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_IN_DATA): * self.state = new_state */ __pyx_t_4 = ((__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN) != 0); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L9_bool_binop_done; } /* "asyncpg/protocol/coreproto.pyx":670 * * elif (self.state == PROTOCOL_COPY_IN and * new_state == PROTOCOL_COPY_IN_DATA): # <<<<<<<<<<<<<< * self.state = new_state * */ __pyx_t_4 = ((__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA) != 0); __pyx_t_1 = __pyx_t_4; __pyx_L9_bool_binop_done:; /* "asyncpg/protocol/coreproto.pyx":669 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_IN and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_IN_DATA): * self.state = new_state */ if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":671 * 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":669 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_IN and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_IN_DATA): * self.state = new_state */ goto __pyx_L4; } /* "asyncpg/protocol/coreproto.pyx":673 * self.state = new_state * * elif self.state == PROTOCOL_FAILED: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'cannot switch to state {}; ' */ __pyx_t_1 = ((__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":674 * * elif self.state == PROTOCOL_FAILED: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'cannot switch to state {}; ' * 'protocol is in the "failed" state'.format(new_state)) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":676 * raise apg_exc.InternalClientError( * 'cannot switch to state {}; ' * 'protocol is in the "failed" state'.format(new_state)) # <<<<<<<<<<<<<< * else: * raise apg_exc.InternalClientError( */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_switch_to_state_protocol, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_new_state); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_8) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 676, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 676, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 676, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 674, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 674, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 674, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 674, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":673 * self.state = new_state * * elif self.state == PROTOCOL_FAILED: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'cannot switch to state {}; ' */ } /* "asyncpg/protocol/coreproto.pyx":678 * '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_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":680 * raise apg_exc.InternalClientError( * 'cannot switch to state {}; ' * 'another operation ({}) is in progress'.format( # <<<<<<<<<<<<<< * new_state, self.state)) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_switch_to_state_another_o, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/coreproto.pyx":681 * 'cannot switch to state {}; ' * 'another operation ({}) is in progress'.format( * new_state, self.state)) # <<<<<<<<<<<<<< * * cdef _ensure_connected(self): */ __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_new_state); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->state); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 680, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 680, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 678, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 678, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 678, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 678, __pyx_L1_error) } __pyx_L4:; break; } /* "asyncpg/protocol/coreproto.pyx":639 * self._discard_data = False * * 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_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_11); __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":683 * 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; __Pyx_RefNannySetupContext("_ensure_connected", 0); /* "asyncpg/protocol/coreproto.pyx":684 * * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":685 * cdef _ensure_connected(self): * if self.con_status != CONNECTION_OK: * raise apg_exc.InternalClientError('not connected') # <<<<<<<<<<<<<< * * cdef WriteBuffer _build_bind_message(self, str portal_name, */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 685, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":684 * * cdef _ensure_connected(self): * if self.con_status != CONNECTION_OK: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('not connected') * */ } /* "asyncpg/protocol/coreproto.pyx":683 * 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_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":687 * raise apg_exc.InternalClientError('not connected') * * cdef WriteBuffer _build_bind_message(self, str portal_name, # <<<<<<<<<<<<<< * str stmt_name, * WriteBuffer bind_data): */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_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_8protocol_8protocol_WriteBuffer *__pyx_v_bind_data) { struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_build_bind_message", 0); /* "asyncpg/protocol/coreproto.pyx":692 * 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_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('B')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":693 * * 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 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_portal_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 693, __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":694 * 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 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_stmt_name, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 694, __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":697 * * # Arguments * buf.write_buffer(bind_data) # <<<<<<<<<<<<<< * * buf.end_message() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(__pyx_v_buf, __pyx_v_bind_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":699 * buf.write_buffer(bind_data) * * buf.end_message() # <<<<<<<<<<<<<< * return buf * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":700 * * 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":687 * raise apg_exc.InternalClientError('not connected') * * 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":704 * # 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_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; int __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; __Pyx_RefNannySetupContext("_connect", 0); /* "asyncpg/protocol/coreproto.pyx":709 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":710 * * if self.con_status != CONNECTION_BAD: * raise apg_exc.InternalClientError('already connected') # <<<<<<<<<<<<<< * * self._set_state(PROTOCOL_AUTH) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 710, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":709 * WriteBuffer outbuf * * if self.con_status != CONNECTION_BAD: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('already connected') * */ } /* "asyncpg/protocol/coreproto.pyx":712 * 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(7, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":713 * * 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":716 * * # Assemble a startup message * buf = WriteBuffer() # <<<<<<<<<<<<<< * * # protocol version */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_WriteBuffer), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":719 * * # protocol version * buf.write_int16(3) # <<<<<<<<<<<<<< * buf.write_int16(0) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_buf, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":720 * # protocol version * buf.write_int16(3) * buf.write_int16(0) # <<<<<<<<<<<<<< * * buf.write_bytestring(b'client_encoding') */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":722 * buf.write_int16(0) * * buf.write_bytestring(b'client_encoding') # <<<<<<<<<<<<<< * buf.write_bytestring("'{}'".format(self.encoding).encode('ascii')) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytestring(__pyx_v_buf, __pyx_n_b_client_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":723 * * buf.write_bytestring(b'client_encoding') * buf.write_bytestring("'{}'".format(self.encoding).encode('ascii')) # <<<<<<<<<<<<<< * * buf.write_str('user', self.encoding) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__87, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->encoding}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 723, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->encoding}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 723, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_self->encoding); __Pyx_GIVEREF(__pyx_v_self->encoding); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->encoding); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(7, 723, __pyx_L1_error) __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytestring(__pyx_v_buf, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 723, __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":725 * buf.write_bytestring("'{}'".format(self.encoding).encode('ascii')) * * buf.write_str('user', self.encoding) # <<<<<<<<<<<<<< * buf.write_str(self.con_params.user, self.encoding) * */ __pyx_t_3 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_n_u_user, ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 725, __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":726 * * buf.write_str('user', self.encoding) * buf.write_str(self.con_params.user, self.encoding) # <<<<<<<<<<<<<< * * buf.write_str('database', self.encoding) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_n_s_user); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(7, 726, __pyx_L1_error) __pyx_t_3 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, ((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 726, __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":728 * 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_5 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_n_u_database, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 728, __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/coreproto.pyx":729 * * buf.write_str('database', self.encoding) * buf.write_str(self.con_params.database, self.encoding) # <<<<<<<<<<<<<< * * if self.con_params.server_settings is not None: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_n_s_database); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(7, 729, __pyx_L1_error) __pyx_t_5 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":731 * buf.write_str(self.con_params.database, self.encoding) * * if self.con_params.server_settings is not None: # <<<<<<<<<<<<<< * for k, v in self.con_params.server_settings.items(): * buf.write_str(k, self.encoding) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_n_s_server_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "asyncpg/protocol/coreproto.pyx":732 * * 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_n_s_server_settings); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_t_5 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(7, 732, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, &__pyx_t_3, &__pyx_t_5, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(7, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":733 * if self.con_params.server_settings is not None: * for k, v in self.con_params.server_settings.items(): * buf.write_str(k, self.encoding) # <<<<<<<<<<<<<< * buf.write_str(v, self.encoding) * */ if (!(likely(PyUnicode_CheckExact(__pyx_v_k))||((__pyx_v_k) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_k)->tp_name), 0))) __PYX_ERR(7, 733, __pyx_L1_error) __pyx_t_5 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, ((PyObject*)__pyx_v_k), ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 733, __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/coreproto.pyx":734 * for k, v in self.con_params.server_settings.items(): * buf.write_str(k, self.encoding) * buf.write_str(v, self.encoding) # <<<<<<<<<<<<<< * * buf.write_bytestring(b'') */ if (!(likely(PyUnicode_CheckExact(__pyx_v_v))||((__pyx_v_v) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_v)->tp_name), 0))) __PYX_ERR(7, 734, __pyx_L1_error) __pyx_t_3 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, ((PyObject*)__pyx_v_v), ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":731 * 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":736 * buf.write_str(v, self.encoding) * * buf.write_bytestring(b'') # <<<<<<<<<<<<<< * * # Send the buffer */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytestring(__pyx_v_buf, __pyx_kp_b__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":739 * * # Send the buffer * outbuf = WriteBuffer() # <<<<<<<<<<<<<< * outbuf.write_int32(buf.len() + 4) * outbuf.write_buffer(buf) */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_WriteBuffer), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_outbuf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":740 * # Send the buffer * outbuf = WriteBuffer() * outbuf.write_int32(buf.len() + 4) # <<<<<<<<<<<<<< * outbuf.write_buffer(buf) * self._write(outbuf) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_len(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyInt_As_int32_t(__pyx_t_5); if (unlikely((__pyx_t_11 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_outbuf, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":741 * outbuf = WriteBuffer() * outbuf.write_int32(buf.len() + 4) * outbuf.write_buffer(buf) # <<<<<<<<<<<<<< * self._write(outbuf) * */ __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(__pyx_v_outbuf, __pyx_v_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":742 * outbuf.write_int32(buf.len() + 4) * outbuf.write_buffer(buf) * self._write(outbuf) # <<<<<<<<<<<<<< * * cdef _prepare(self, str stmt_name, str query): */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_outbuf)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":704 * # 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":744 * self._write(outbuf) * * cdef _prepare(self, str stmt_name, str query): # <<<<<<<<<<<<<< * cdef: * WriteBuffer packet */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query) { struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_packet = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 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; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_prepare", 0); /* "asyncpg/protocol/coreproto.pyx":749 * 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(7, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":750 * * self._ensure_connected() * self._set_state(PROTOCOL_PREPARE) # <<<<<<<<<<<<<< * * packet = WriteBuffer.new() */ __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(7, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":752 * self._set_state(PROTOCOL_PREPARE) * * packet = WriteBuffer.new() # <<<<<<<<<<<<<< * * buf = WriteBuffer.new_message(b'P') */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_packet = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":754 * packet = WriteBuffer.new() * * buf = WriteBuffer.new_message(b'P') # <<<<<<<<<<<<<< * buf.write_str(stmt_name, self.encoding) * buf.write_str(query, self.encoding) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('P')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":755 * * 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 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_stmt_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 755, __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":756 * 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() */ __pyx_t_2 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_query, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 756, __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":757 * buf.write_str(stmt_name, self.encoding) * buf.write_str(query, self.encoding) * buf.write_int16(0) # <<<<<<<<<<<<<< * buf.end_message() * packet.write_buffer(buf) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":758 * buf.write_str(query, self.encoding) * buf.write_int16(0) * buf.end_message() # <<<<<<<<<<<<<< * packet.write_buffer(buf) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":759 * buf.write_int16(0) * buf.end_message() * packet.write_buffer(buf) # <<<<<<<<<<<<<< * * buf = WriteBuffer.new_message(b'D') */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(__pyx_v_packet, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":761 * packet.write_buffer(buf) * * buf = WriteBuffer.new_message(b'D') # <<<<<<<<<<<<<< * buf.write_byte(b'S') * buf.write_str(stmt_name, self.encoding) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('D')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":762 * * buf = WriteBuffer.new_message(b'D') * buf.write_byte(b'S') # <<<<<<<<<<<<<< * buf.write_str(stmt_name, self.encoding) * buf.end_message() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_buf, 'S'); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":763 * 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 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_stmt_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 763, __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":764 * buf.write_byte(b'S') * buf.write_str(stmt_name, self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * packet.write_buffer(buf) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":765 * buf.write_str(stmt_name, self.encoding) * buf.end_message() * packet.write_buffer(buf) # <<<<<<<<<<<<<< * * packet.write_bytes(SYNC_MESSAGE) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer(__pyx_v_packet, __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":767 * packet.write_buffer(buf) * * packet.write_bytes(SYNC_MESSAGE) # <<<<<<<<<<<<<< * * self.transport.write(memoryview(packet)) */ __pyx_t_2 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytes(__pyx_v_packet, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 767, __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":769 * packet.write_bytes(SYNC_MESSAGE) * * self.transport.write(memoryview(packet)) # <<<<<<<<<<<<<< * * cdef _send_bind_message(self, str portal_name, str stmt_name, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->transport, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_packet)); __Pyx_GIVEREF(((PyObject *)__pyx_v_packet)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_packet)); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_memoryview, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 769, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 769, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 769, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":744 * self._write(outbuf) * * cdef _prepare(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_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._prepare", __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":771 * self.transport.write(memoryview(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_8protocol_8protocol_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit) { struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_send_bind_message", 0); /* "asyncpg/protocol/coreproto.pyx":776 * cdef WriteBuffer buf * * buf = self._build_bind_message(portal_name, stmt_name, bind_data) # <<<<<<<<<<<<<< * self._write(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(7, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":777 * * buf = self._build_bind_message(portal_name, stmt_name, bind_data) * self._write(buf) # <<<<<<<<<<<<<< * * buf = WriteBuffer.new_message(b'E') */ __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(7, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":779 * self._write(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_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('E')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":780 * * 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_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_portal_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 780, __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":781 * 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() * self._write(buf) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_limit); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":782 * 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() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":783 * buf.write_int32(limit) # number of rows to return; 0 - all * buf.end_message() * self._write(buf) # <<<<<<<<<<<<<< * * self._write_sync_message() */ __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(7, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":785 * self._write(buf) * * self._write_sync_message() # <<<<<<<<<<<<<< * * cdef _bind_execute(self, str portal_name, str stmt_name, */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_sync_message(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":771 * self.transport.write(memoryview(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_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":787 * self._write_sync_message() * * 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_8protocol_8protocol_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_bind_execute", 0); /* "asyncpg/protocol/coreproto.pyx":792 * 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(7, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":793 * * 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(7, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":795 * 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(7, 795, __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":797 * self.result = [] * * self._send_bind_message(portal_name, stmt_name, bind_data, limit) # <<<<<<<<<<<<<< * * cdef _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(7, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":787 * self._write_sync_message() * * 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":799 * self._send_bind_message(portal_name, stmt_name, bind_data, limit) * * cdef _bind_execute_many(self, str portal_name, str stmt_name, # <<<<<<<<<<<<<< * object bind_data): * */ static PyObject *__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) { struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_v_e = 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; 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; __Pyx_RefNannySetupContext("_bind_execute_many", 0); /* "asyncpg/protocol/coreproto.pyx":804 * cdef WriteBuffer buf * * 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(7, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":805 * * self._ensure_connected() * self._set_state(PROTOCOL_BIND_EXECUTE_MANY) # <<<<<<<<<<<<<< * * self.result = 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(7, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":807 * self._set_state(PROTOCOL_BIND_EXECUTE_MANY) * * self.result = None # <<<<<<<<<<<<<< * self._discard_data = True * self._execute_iter = bind_data */ __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":808 * * self.result = None * self._discard_data = True # <<<<<<<<<<<<<< * self._execute_iter = bind_data * self._execute_portal_name = portal_name */ __pyx_v_self->_discard_data = 1; /* "asyncpg/protocol/coreproto.pyx":809 * self.result = None * self._discard_data = True * 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":810 * self._discard_data = True * self._execute_iter = bind_data * self._execute_portal_name = portal_name # <<<<<<<<<<<<<< * self._execute_stmt_name = stmt_name * */ __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":811 * self._execute_iter = bind_data * self._execute_portal_name = portal_name * self._execute_stmt_name = stmt_name # <<<<<<<<<<<<<< * * try: */ __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":813 * self._execute_stmt_name = stmt_name * * try: # <<<<<<<<<<<<<< * buf = next(bind_data) * except StopIteration: */ { __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/coreproto.pyx":814 * * try: * buf = next(bind_data) # <<<<<<<<<<<<<< * except StopIteration: * self._push_result() */ __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_bind_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 814, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":813 * self._execute_stmt_name = stmt_name * * try: # <<<<<<<<<<<<<< * buf = next(bind_data) * except StopIteration: */ } /* "asyncpg/protocol/coreproto.pyx":822 * self._push_result() * else: * self._send_bind_message(portal_name, stmt_name, buf, 0) # <<<<<<<<<<<<<< * * cdef _execute(self, str portal_name, int32_t limit): */ /*else:*/ { __pyx_t_5 = ((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_buf, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 822, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":815 * try: * buf = next(bind_data) * except StopIteration: # <<<<<<<<<<<<<< * self._push_result() * except Exception as e: */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_6) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(7, 815, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/coreproto.pyx":816 * buf = next(bind_data) * except StopIteration: * self._push_result() # <<<<<<<<<<<<<< * except Exception as e: * self.result_type = RESULT_FAILED */ __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(7, 816, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_exception_handled; } /* "asyncpg/protocol/coreproto.pyx":817 * except StopIteration: * self._push_result() * except Exception as e: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = e */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_6) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_5) < 0) __PYX_ERR(7, 817, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_v_e = __pyx_t_1; /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":818 * self._push_result() * except Exception as e: * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = e * self._push_result() */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":819 * except Exception as e: * self.result_type = RESULT_FAILED * self.result = e # <<<<<<<<<<<<<< * self._push_result() * else: */ __Pyx_INCREF(__pyx_v_e); __Pyx_GIVEREF(__pyx_v_e); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_v_e; /* "asyncpg/protocol/coreproto.pyx":820 * self.result_type = RESULT_FAILED * self.result = e * self._push_result() # <<<<<<<<<<<<<< * else: * self._send_bind_message(portal_name, stmt_name, buf, 0) */ __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(7, 820, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* "asyncpg/protocol/coreproto.pyx":817 * except StopIteration: * self._push_result() * except Exception as e: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = e */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; goto __pyx_L17; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L16_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_6 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L5_except_error; } __pyx_L17:; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "asyncpg/protocol/coreproto.pyx":813 * self._execute_stmt_name = stmt_name * * try: # <<<<<<<<<<<<<< * buf = next(bind_data) * except StopIteration: */ __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_L4_exception_handled:; __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); __pyx_L8_try_end:; } /* "asyncpg/protocol/coreproto.pyx":799 * self._send_bind_message(portal_name, stmt_name, bind_data, limit) * * cdef _bind_execute_many(self, str portal_name, str stmt_name, # <<<<<<<<<<<<<< * object 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_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":824 * self._send_bind_message(portal_name, stmt_name, buf, 0) * * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_execute", 0); /* "asyncpg/protocol/coreproto.pyx":827 * 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(7, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":828 * * 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(7, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":830 * self._set_state(PROTOCOL_EXECUTE) * * self.result = [] # <<<<<<<<<<<<<< * * buf = WriteBuffer.new_message(b'E') */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 830, __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":832 * self.result = [] * * 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_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('E')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":833 * * 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_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_portal_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 833, __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":834 * 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() * self._write(buf) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_limit); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":835 * 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() # <<<<<<<<<<<<<< * self._write(buf) * self._write_sync_message() */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":836 * buf.write_int32(limit) # number of rows to return; 0 - all * buf.end_message() * self._write(buf) # <<<<<<<<<<<<<< * self._write_sync_message() * */ __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(7, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":837 * buf.end_message() * self._write(buf) * self._write_sync_message() # <<<<<<<<<<<<<< * * cdef _bind(self, str portal_name, str stmt_name, */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_sync_message(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":824 * self._send_bind_message(portal_name, stmt_name, buf, 0) * * 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":839 * self._write_sync_message() * * 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_8protocol_8protocol_WriteBuffer *__pyx_v_bind_data) { struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_bind", 0); /* "asyncpg/protocol/coreproto.pyx":844 * 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(7, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":845 * * 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(7, 845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":847 * self._set_state(PROTOCOL_BIND) * * buf = self._build_bind_message(portal_name, stmt_name, bind_data) # <<<<<<<<<<<<<< * self._write(buf) * self._write_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(7, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":848 * * buf = self._build_bind_message(portal_name, stmt_name, bind_data) * self._write(buf) # <<<<<<<<<<<<<< * self._write_sync_message() * */ __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(7, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":849 * buf = self._build_bind_message(portal_name, stmt_name, bind_data) * self._write(buf) * self._write_sync_message() # <<<<<<<<<<<<<< * * cdef _close(self, str name, bint is_portal): */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_sync_message(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":839 * self._write_sync_message() * * 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_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":851 * self._write_sync_message() * * 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_8protocol_8protocol_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; __Pyx_RefNannySetupContext("_close", 0); /* "asyncpg/protocol/coreproto.pyx":854 * 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(7, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":855 * * 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(7, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":857 * self._set_state(PROTOCOL_CLOSE_STMT_PORTAL) * * buf = WriteBuffer.new_message(b'C') # <<<<<<<<<<<<<< * * if is_portal: */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('C')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":859 * buf = WriteBuffer.new_message(b'C') * * if is_portal: # <<<<<<<<<<<<<< * buf.write_byte(b'P') * else: */ __pyx_t_2 = (__pyx_v_is_portal != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":860 * * if is_portal: * buf.write_byte(b'P') # <<<<<<<<<<<<<< * else: * buf.write_byte(b'S') */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_buf, 'P'); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":859 * buf = WriteBuffer.new_message(b'C') * * if is_portal: # <<<<<<<<<<<<<< * buf.write_byte(b'P') * else: */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":862 * buf.write_byte(b'P') * else: * buf.write_byte(b'S') # <<<<<<<<<<<<<< * * buf.write_str(name, self.encoding) */ /*else*/ { __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte(__pyx_v_buf, 'S'); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/coreproto.pyx":864 * buf.write_byte(b'S') * * buf.write_str(name, self.encoding) # <<<<<<<<<<<<<< * buf.end_message() * self._write(buf) */ __pyx_t_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 864, __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":865 * * buf.write_str(name, self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":866 * buf.write_str(name, self.encoding) * buf.end_message() * self._write(buf) # <<<<<<<<<<<<<< * * self._write_sync_message() */ __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(7, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":868 * self._write(buf) * * self._write_sync_message() # <<<<<<<<<<<<<< * * cdef _simple_query(self, str query): */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_sync_message(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":851 * self._write_sync_message() * * 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_3); __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":870 * self._write_sync_message() * * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_simple_query", 0); /* "asyncpg/protocol/coreproto.pyx":872 * 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(7, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":873 * 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(7, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":874 * 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_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('Q')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":875 * 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 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_query, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 875, __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":876 * buf = WriteBuffer.new_message(b'Q') * buf.write_str(query, self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":877 * 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(7, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":870 * self._write_sync_message() * * 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":879 * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_copy_out", 0); /* "asyncpg/protocol/coreproto.pyx":882 * 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(7, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":883 * * 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(7, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":886 * * # 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_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('Q')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":887 * # 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 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_copy_stmt, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 887, __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":888 * buf = WriteBuffer.new_message(b'Q') * buf.write_str(copy_stmt, self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":889 * 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(7, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":879 * 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":891 * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_copy_in", 0); /* "asyncpg/protocol/coreproto.pyx":894 * 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(7, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":895 * * 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(7, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":897 * 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_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('Q')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":898 * * 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 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str(__pyx_v_buf, __pyx_v_copy_stmt, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 898, __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":899 * buf = WriteBuffer.new_message(b'Q') * buf.write_str(copy_stmt, self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":900 * 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(7, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":891 * 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":902 * 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_8protocol_8protocol_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_terminate", 0); /* "asyncpg/protocol/coreproto.pyx":904 * cdef _terminate(self): * cdef WriteBuffer buf * self._ensure_connected() # <<<<<<<<<<<<<< * buf = WriteBuffer.new_message(b'X') * buf.end_message() */ __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(7, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":905 * cdef WriteBuffer buf * self._ensure_connected() * buf = WriteBuffer.new_message(b'X') # <<<<<<<<<<<<<< * buf.end_message() * self._write(buf) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('X')); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":906 * self._ensure_connected() * buf = WriteBuffer.new_message(b'X') * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":907 * buf = WriteBuffer.new_message(b'X') * buf.end_message() * self._write(buf) # <<<<<<<<<<<<<< * * cdef _decode_row(self, const char* buf, ssize_t buf_len): */ __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(7, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":902 * 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":909 * self._write(buf) * * 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":912 * 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":915 * 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":918 * 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":921 * 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":924 * 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.pyx":929 * # 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_12CoreProtocol_3data_received(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3data_received(PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("data_received (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_2data_received(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_data)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_2data_received(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("data_received", 0); /* "asyncpg/protocol/coreproto.pyx":930 * * def data_received(self, data): * self.buffer.feed_data(data) # <<<<<<<<<<<<<< * self._read_server_messages() * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_feed_data(__pyx_v_self->buffer, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":931 * 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_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_read_server_messages(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":929 * # 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.CoreProtocol.data_received", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":933 * self._read_server_messages() * * def connection_made(self, transport): # <<<<<<<<<<<<<< * self.transport = transport * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5connection_made(PyObject *__pyx_v_self, PyObject *__pyx_v_transport); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5connection_made(PyObject *__pyx_v_self, PyObject *__pyx_v_transport) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("connection_made (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_4connection_made(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_transport)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_4connection_made(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__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; int __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; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; __Pyx_RefNannySetupContext("connection_made", 0); /* "asyncpg/protocol/coreproto.pyx":934 * * 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->transport); __Pyx_DECREF(__pyx_v_self->transport); __pyx_v_self->transport = __pyx_v_transport; /* "asyncpg/protocol/coreproto.pyx":936 * self.transport = transport * * sock = transport.get_extra_info('socket') # <<<<<<<<<<<<<< * if (sock is not None and * (not hasattr(socket, 'AF_UNIX') */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_transport, __pyx_n_s_get_extra_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sock = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":937 * * 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_4 = (__pyx_v_sock != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } /* "asyncpg/protocol/coreproto.pyx":938 * 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_u_AF_UNIX); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 938, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0); if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } /* "asyncpg/protocol/coreproto.pyx":939 * 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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sock, __pyx_n_s_family); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AF_UNIX); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 939, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 939, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; /* "asyncpg/protocol/coreproto.pyx":937 * * 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_3) { /* "asyncpg/protocol/coreproto.pyx":940 * (not hasattr(socket, 'AF_UNIX') * or sock.family != socket.AF_UNIX)): * sock.setsockopt(socket.IPPROTO_TCP, # <<<<<<<<<<<<<< * socket.TCP_NODELAY, 1) * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sock, __pyx_n_s_setsockopt); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_IPPROTO_TCP); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":941 * or sock.family != socket.AF_UNIX)): * sock.setsockopt(socket.IPPROTO_TCP, * socket.TCP_NODELAY, 1) # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TCP_NODELAY); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_t_7, __pyx_t_8, __pyx_int_1}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 940, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_t_7, __pyx_t_8, __pyx_int_1}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 940, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_8); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_int_1); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":937 * * 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/coreproto.pyx":943 * socket.TCP_NODELAY, 1) * * try: # <<<<<<<<<<<<<< * self._connect() * except Exception as ex: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":944 * * try: * self._connect() # <<<<<<<<<<<<<< * except Exception as ex: * transport.abort() */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_connect(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 944, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":943 * socket.TCP_NODELAY, 1) * * try: # <<<<<<<<<<<<<< * self._connect() * except Exception as ex: */ } __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_L12_try_end; __pyx_L7_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; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":945 * try: * self._connect() * except Exception as ex: # <<<<<<<<<<<<<< * transport.abort() * self.con_status = CONNECTION_BAD */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.connection_made", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_10) < 0) __PYX_ERR(7, 945, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_v_ex = __pyx_t_6; /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":946 * self._connect() * except Exception as ex: * transport.abort() # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_transport, __pyx_n_s_abort); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 946, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 946, __pyx_L18_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 946, __pyx_L18_error) } __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":947 * except Exception as ex: * transport.abort() * self.con_status = CONNECTION_BAD # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_FAILED) * self._on_error(ex) */ __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD; /* "asyncpg/protocol/coreproto.pyx":948 * transport.abort() * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) # <<<<<<<<<<<<<< * self._on_error(ex) * */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 948, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":949 * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) * self._on_error(ex) # <<<<<<<<<<<<<< * * def connection_lost(self, exc): */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 949, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_2) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_ex); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 949, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_ex}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 949, __pyx_L18_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_ex}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 949, __pyx_L18_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif { __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(7, 949, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_ex); __Pyx_GIVEREF(__pyx_v_ex); PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_ex); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 949, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* "asyncpg/protocol/coreproto.pyx":945 * 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 = NULL; goto __pyx_L19; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L18_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_9 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L9_except_error; } __pyx_L19:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L8_exception_handled; } goto __pyx_L9_except_error; __pyx_L9_except_error:; /* "asyncpg/protocol/coreproto.pyx":943 * socket.TCP_NODELAY, 1) * * try: # <<<<<<<<<<<<<< * self._connect() * except Exception as ex: */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L8_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_L12_try_end:; } /* "asyncpg/protocol/coreproto.pyx":933 * 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_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.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/coreproto.pyx":951 * 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_12CoreProtocol_7connection_lost(PyObject *__pyx_v_self, PyObject *__pyx_v_exc); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_7connection_lost(PyObject *__pyx_v_self, PyObject *__pyx_v_exc) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("connection_lost (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_6connection_lost(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_exc)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_6connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("connection_lost", 0); /* "asyncpg/protocol/coreproto.pyx":952 * * def connection_lost(self, exc): * self.con_status = CONNECTION_BAD # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_FAILED) * self._on_connection_lost(exc) */ __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD; /* "asyncpg/protocol/coreproto.pyx":953 * 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_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":954 * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) * self._on_connection_lost(exc) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_connection_lost(__pyx_v_self, __pyx_v_exc); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":951 * 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.CoreProtocol.connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pxd":94 * object con_params * * 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) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __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; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->backend_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 94, __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":95 * * 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) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __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; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->backend_secret); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 95, __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 bint use_setstate * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.state, self.transport, self.xact_status) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_8__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_8__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { int __pyx_v_use_setstate; PyObject *__pyx_v_state = NULL; PyObject *__pyx_v__dict = 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; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":3 * def __reduce_cython__(self): * cdef bint use_setstate * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.state, self.transport, self.xact_status) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_discard_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_skip_discard); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_self->backend_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_self->backend_secret); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_v_self->con_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->result_execute_completed); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_v_self->result_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->state); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_v_self->xact_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(20); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_self->_execute_iter); __Pyx_GIVEREF(__pyx_v_self->_execute_iter); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_self->_execute_iter); __Pyx_INCREF(__pyx_v_self->_execute_portal_name); __Pyx_GIVEREF(__pyx_v_self->_execute_portal_name); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_self->_execute_portal_name); __Pyx_INCREF(__pyx_v_self->_execute_stmt_name); __Pyx_GIVEREF(__pyx_v_self->_execute_stmt_name); PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_v_self->_execute_stmt_name); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->buffer)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->buffer)); PyTuple_SET_ITEM(__pyx_t_10, 7, ((PyObject *)__pyx_v_self->buffer)); __Pyx_INCREF(__pyx_v_self->con_params); __Pyx_GIVEREF(__pyx_v_self->con_params); PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_v_self->con_params); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 9, __pyx_t_5); __Pyx_INCREF(__pyx_v_self->encoding); __Pyx_GIVEREF(__pyx_v_self->encoding); PyTuple_SET_ITEM(__pyx_t_10, 10, __pyx_v_self->encoding); __Pyx_INCREF(__pyx_v_self->result); __Pyx_GIVEREF(__pyx_v_self->result); PyTuple_SET_ITEM(__pyx_t_10, 11, __pyx_v_self->result); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 12, __pyx_t_6); __Pyx_INCREF(__pyx_v_self->result_param_desc); __Pyx_GIVEREF(__pyx_v_self->result_param_desc); PyTuple_SET_ITEM(__pyx_t_10, 13, __pyx_v_self->result_param_desc); __Pyx_INCREF(__pyx_v_self->result_row_desc); __Pyx_GIVEREF(__pyx_v_self->result_row_desc); PyTuple_SET_ITEM(__pyx_t_10, 14, __pyx_v_self->result_row_desc); __Pyx_INCREF(__pyx_v_self->result_status_msg); __Pyx_GIVEREF(__pyx_v_self->result_status_msg); PyTuple_SET_ITEM(__pyx_t_10, 15, __pyx_v_self->result_status_msg); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 16, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 17, __pyx_t_8); __Pyx_INCREF(__pyx_v_self->transport); __Pyx_GIVEREF(__pyx_v_self->transport); PyTuple_SET_ITEM(__pyx_t_10, 18, __pyx_v_self->transport); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 19, __pyx_t_9); __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)":4 * cdef bint use_setstate * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.state, self.transport, self.xact_status) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_10 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_v__dict = __pyx_t_10; __pyx_t_10 = 0; /* "(tree fragment)":5 * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.state, self.transport, self.xact_status) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_11 = (__pyx_v__dict != Py_None); __pyx_t_12 = (__pyx_t_11 != 0); if (__pyx_t_12) { /* "(tree fragment)":6 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v__dict); __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 6, __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)":7 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.buffer is not None or self.con_params is not None or self.encoding 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.transport is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":5 * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.state, self.transport, self.xact_status) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":9 * 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.buffer is not None or self.con_params is not None or self.encoding 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.transport is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_CoreProtocol, (type(self), 0x197884c, None), state */ /*else*/ { __pyx_t_11 = (__pyx_v_self->_execute_iter != Py_None); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->_execute_portal_name != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->_execute_stmt_name != ((PyObject*)Py_None)); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (((PyObject *)__pyx_v_self->buffer) != Py_None); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->con_params != Py_None); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->encoding != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->result != Py_None); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->result_param_desc != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->result_row_desc != ((PyObject*)Py_None)); __pyx_t_13 = (__pyx_t_11 != 0); if (!__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L4_bool_binop_done; } __pyx_t_13 = (__pyx_v_self->result_status_msg != ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_13 != 0); if (!__pyx_t_11) { } else { __pyx_t_12 = __pyx_t_11; goto __pyx_L4_bool_binop_done; } __pyx_t_11 = (__pyx_v_self->transport != Py_None); __pyx_t_13 = (__pyx_t_11 != 0); __pyx_t_12 = __pyx_t_13; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_12; } __pyx_L3:; /* "(tree fragment)":10 * 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.buffer is not None or self.con_params is not None or self.encoding 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.transport is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_CoreProtocol, (type(self), 0x197884c, None), state * else: */ __pyx_t_12 = (__pyx_v_use_setstate != 0); if (__pyx_t_12) { /* "(tree fragment)":11 * 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.buffer is not None or self.con_params is not None or self.encoding 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.transport is not None * if use_setstate: * return __pyx_unpickle_CoreProtocol, (type(self), 0x197884c, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_CoreProtocol, (type(self), 0x197884c, state) */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CoreProtocol); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 11, __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)))); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_26708044); __Pyx_GIVEREF(__pyx_int_26708044); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_26708044); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "(tree fragment)":10 * 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.buffer is not None or self.con_params is not None or self.encoding 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.transport is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_CoreProtocol, (type(self), 0x197884c, None), state * else: */ } /* "(tree fragment)":13 * return __pyx_unpickle_CoreProtocol, (type(self), 0x197884c, None), state * else: * return __pyx_unpickle_CoreProtocol, (type(self), 0x197884c, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_CoreProtocol); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_26708044); __Pyx_GIVEREF(__pyx_int_26708044); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_26708044); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); __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 bint use_setstate * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.state, self.transport, self.xact_status) */ /* 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)":14 * else: * return __pyx_unpickle_CoreProtocol, (type(self), 0x197884c, 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_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_10__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_10__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; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":15 * return __pyx_unpickle_CoreProtocol, (type(self), 0x197884c, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 15, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":14 * else: * return __pyx_unpickle_CoreProtocol, (type(self), 0x197884c, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":14 * cdef class PreparedStatementState: * * def __cinit__(self, str name, str query, BaseProtocol protocol): # <<<<<<<<<<<<<< * self.name = name * self.query = query */ /* 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; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_query,&__pyx_n_s_protocol,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(27, 14, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_protocol)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(27, 14, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(27, 14, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_name = ((PyObject*)values[0]); __pyx_v_query = ((PyObject*)values[1]); __pyx_v_protocol = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(27, 14, __pyx_L3_error) __pyx_L3_error:; __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(27, 14, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(27, 14, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_protocol), __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, 1, "protocol", 0))) __PYX_ERR(27, 14, __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); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __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) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "asyncpg/protocol/prepared_stmt.pyx":15 * * def __cinit__(self, str name, str query, BaseProtocol protocol): * self.name = name # <<<<<<<<<<<<<< * self.query = query * self.protocol = protocol */ __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":16 * def __cinit__(self, str name, str query, BaseProtocol protocol): * self.name = name * self.query = query # <<<<<<<<<<<<<< * self.protocol = protocol * self.settings = protocol.settings */ __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":17 * self.name = name * self.query = query * self.protocol = protocol # <<<<<<<<<<<<<< * self.settings = protocol.settings * self.row_desc = self.parameters_desc = None */ __Pyx_INCREF(((PyObject *)__pyx_v_protocol)); __Pyx_GIVEREF(((PyObject *)__pyx_v_protocol)); __Pyx_GOTREF(__pyx_v_self->protocol); __Pyx_DECREF(((PyObject *)__pyx_v_self->protocol)); __pyx_v_self->protocol = __pyx_v_protocol; /* "asyncpg/protocol/prepared_stmt.pyx":18 * self.query = query * self.protocol = protocol * 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(__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":19 * self.protocol = protocol * 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":20 * 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":21 * 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":22 * self.args_codecs = self.rows_codecs = None * self.args_num = self.cols_num = 0 * self.cols_desc = None # <<<<<<<<<<<<<< * self.closed = False * self.refs = 0 */ __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":23 * self.args_num = self.cols_num = 0 * self.cols_desc = None * self.closed = False # <<<<<<<<<<<<<< * self.refs = 0 * self.buffer = FastReadBuffer.new() */ __pyx_v_self->closed = 0; /* "asyncpg/protocol/prepared_stmt.pyx":24 * self.cols_desc = None * self.closed = False * self.refs = 0 # <<<<<<<<<<<<<< * self.buffer = FastReadBuffer.new() * */ __pyx_v_self->refs = 0; /* "asyncpg/protocol/prepared_stmt.pyx":25 * self.closed = False * self.refs = 0 * self.buffer = FastReadBuffer.new() # <<<<<<<<<<<<<< * * def _get_parameters(self): */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->buffer); __Pyx_DECREF(((PyObject *)__pyx_v_self->buffer)); __pyx_v_self->buffer = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":14 * cdef class PreparedStatementState: * * def __cinit__(self, str name, str query, BaseProtocol protocol): # <<<<<<<<<<<<<< * self.name = name * self.query = query */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":27 * self.buffer = FastReadBuffer.new() * * def _get_parameters(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_parameters (wrapper)", 0); __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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; __Pyx_RefNannySetupContext("_get_parameters", 0); /* "asyncpg/protocol/prepared_stmt.pyx":30 * 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(27, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":31 * * 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(27, 31, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->parameters_desc; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(27, 31, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":32 * result = [] * for oid in self.parameters_desc: * codec = self.settings.get_data_codec(oid) # <<<<<<<<<<<<<< * if codec is None: * raise RuntimeError */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 32, __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(27, 32, __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":33 * for oid in self.parameters_desc: * codec = self.settings.get_data_codec(oid) * if codec is None: # <<<<<<<<<<<<<< * raise RuntimeError * result.append(apg_types.Type( */ __pyx_t_5 = (((PyObject *)__pyx_v_codec) == Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "asyncpg/protocol/prepared_stmt.pyx":34 * codec = self.settings.get_data_codec(oid) * if codec is None: * raise RuntimeError # <<<<<<<<<<<<<< * result.append(apg_types.Type( * oid, codec.name, codec.kind, codec.schema)) */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); __PYX_ERR(27, 34, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":33 * for oid in self.parameters_desc: * codec = self.settings.get_data_codec(oid) * if codec is None: # <<<<<<<<<<<<<< * raise RuntimeError * result.append(apg_types.Type( */ } /* "asyncpg/protocol/prepared_stmt.pyx":35 * if codec is None: * raise RuntimeError * result.append(apg_types.Type( # <<<<<<<<<<<<<< * oid, codec.name, codec.kind, codec.schema)) * */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Type); if (unlikely(!__pyx_t_8)) __PYX_ERR(27, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":36 * raise RuntimeError * result.append(apg_types.Type( * oid, codec.name, codec.kind, codec.schema)) # <<<<<<<<<<<<<< * * return tuple(result) */ __pyx_t_7 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_oid, __pyx_v_codec->name, __pyx_v_codec->kind, __pyx_v_codec->schema}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 35, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_oid, __pyx_v_codec->name, __pyx_v_codec->kind, __pyx_v_codec->schema}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 35, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_10 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(27, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_oid); __Pyx_INCREF(__pyx_v_codec->name); __Pyx_GIVEREF(__pyx_v_codec->name); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_codec->name); __Pyx_INCREF(__pyx_v_codec->kind); __Pyx_GIVEREF(__pyx_v_codec->kind); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_v_codec->kind); __Pyx_INCREF(__pyx_v_codec->schema); __Pyx_GIVEREF(__pyx_v_codec->schema); PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_v_codec->schema); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":35 * if codec is None: * raise RuntimeError * 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(27, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":31 * * 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":38 * 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(27, 38, __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":27 * self.buffer = FastReadBuffer.new() * * 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_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __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":40 * 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, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_attributes (wrapper)", 0); __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; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; __Pyx_RefNannySetupContext("_get_attributes", 0); /* "asyncpg/protocol/prepared_stmt.pyx":43 * cdef Codec codec * * if not self.row_desc: # <<<<<<<<<<<<<< * return () * */ __pyx_t_1 = (__pyx_v_self->row_desc != Py_None) && (PyList_GET_SIZE(__pyx_v_self->row_desc) != 0); __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":44 * * if not self.row_desc: * return () # <<<<<<<<<<<<<< * * result = [] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":43 * cdef Codec codec * * if not self.row_desc: # <<<<<<<<<<<<<< * return () * */ } /* "asyncpg/protocol/prepared_stmt.pyx":46 * return () * * result = [] # <<<<<<<<<<<<<< * for d in self.row_desc: * name = d[0] */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":47 * * 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(27, 47, __pyx_L1_error) } __pyx_t_3 = __pyx_v_self->row_desc; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; for (;;) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(27, 47, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":48 * result = [] * for d in self.row_desc: * name = d[0] # <<<<<<<<<<<<<< * oid = d[3] * */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 48, __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":49 * for d in self.row_desc: * name = d[0] * oid = d[3] # <<<<<<<<<<<<<< * * codec = self.settings.get_data_codec(oid) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_d, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 49, __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":51 * oid = d[3] * * codec = self.settings.get_data_codec(oid) # <<<<<<<<<<<<<< * if codec is None: * raise RuntimeError */ __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_6 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 51, __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(27, 51, __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":52 * * codec = self.settings.get_data_codec(oid) * if codec is None: # <<<<<<<<<<<<<< * raise RuntimeError * */ __pyx_t_2 = (((PyObject *)__pyx_v_codec) == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":53 * codec = self.settings.get_data_codec(oid) * if codec is None: * raise RuntimeError # <<<<<<<<<<<<<< * * name = name.decode(self.settings._encoding) */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); __PYX_ERR(27, 53, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":52 * * codec = self.settings.get_data_codec(oid) * if codec is None: # <<<<<<<<<<<<<< * raise RuntimeError * */ } /* "asyncpg/protocol/prepared_stmt.pyx":55 * raise RuntimeError * * name = name.decode(self.settings._encoding) # <<<<<<<<<<<<<< * * result.append( */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_8) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->settings->_encoding); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_self->settings->_encoding}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 55, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_self->settings->_encoding}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 55, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(27, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_self->settings->_encoding); __Pyx_GIVEREF(__pyx_v_self->settings->_encoding); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_self->settings->_encoding); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":58 * * result.append( * apg_types.Attribute(name, # <<<<<<<<<<<<<< * apg_types.Type(oid, codec.name, codec.kind, codec.schema))) * */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Attribute); if (unlikely(!__pyx_t_9)) __PYX_ERR(27, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":59 * result.append( * apg_types.Attribute(name, * apg_types.Type(oid, codec.name, codec.kind, codec.schema))) # <<<<<<<<<<<<<< * * return tuple(result) */ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_types); if (unlikely(!__pyx_t_8)) __PYX_ERR(27, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Type); if (unlikely(!__pyx_t_10)) __PYX_ERR(27, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_oid, __pyx_v_codec->name, __pyx_v_codec->kind, __pyx_v_codec->schema}; __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 59, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_7); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_oid, __pyx_v_codec->name, __pyx_v_codec->kind, __pyx_v_codec->schema}; __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 59, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_7); } else #endif { __pyx_t_12 = PyTuple_New(4+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(27, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_v_oid); __Pyx_INCREF(__pyx_v_codec->name); __Pyx_GIVEREF(__pyx_v_codec->name); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_v_codec->name); __Pyx_INCREF(__pyx_v_codec->kind); __Pyx_GIVEREF(__pyx_v_codec->kind); PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_v_codec->kind); __Pyx_INCREF(__pyx_v_codec->schema); __Pyx_GIVEREF(__pyx_v_codec->schema); PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_v_codec->schema); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_name, __pyx_t_7}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 58, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_name, __pyx_t_7}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 58, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(27, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":57 * name = name.decode(self.settings._encoding) * * result.append( # <<<<<<<<<<<<<< * apg_types.Attribute(name, * apg_types.Type(oid, codec.name, codec.kind, codec.schema))) */ __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(27, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":47 * * 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":61 * 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(27, 61, __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":40 * 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_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":63 * 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, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_types (wrapper)", 0); __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_result = 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; __Pyx_RefNannySetupContext("_init_types", 0); /* "asyncpg/protocol/prepared_stmt.pyx":66 * cdef: * Codec codec * set result = set() # <<<<<<<<<<<<<< * * if self.parameters_desc: */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":68 * set result = set() * * if self.parameters_desc: # <<<<<<<<<<<<<< * for p_oid in self.parameters_desc: * codec = self.settings.get_data_codec(p_oid) */ __pyx_t_2 = (__pyx_v_self->parameters_desc != Py_None) && (PyList_GET_SIZE(__pyx_v_self->parameters_desc) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":69 * * 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(27, 69, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->parameters_desc; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(27, 69, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_p_oid, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":70 * 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(): * result.add(p_oid) */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_p_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 70, __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(27, 70, __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":71 * for p_oid in self.parameters_desc: * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): # <<<<<<<<<<<<<< * result.add(p_oid) * */ __pyx_t_6 = (((PyObject *)__pyx_v_codec) == Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (!__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; 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(27, 71, __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(27, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = ((!__pyx_t_7) != 0); __pyx_t_2 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":72 * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): * result.add(p_oid) # <<<<<<<<<<<<<< * * if self.row_desc: */ __pyx_t_8 = PySet_Add(__pyx_v_result, __pyx_v_p_oid); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(27, 72, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":71 * for p_oid in self.parameters_desc: * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): # <<<<<<<<<<<<<< * result.add(p_oid) * */ } /* "asyncpg/protocol/prepared_stmt.pyx":69 * * 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":68 * set result = 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":74 * result.add(p_oid) * * if self.row_desc: # <<<<<<<<<<<<<< * for rdesc in self.row_desc: * codec = self.settings.get_data_codec((rdesc[3])) */ __pyx_t_2 = (__pyx_v_self->row_desc != Py_None) && (PyList_GET_SIZE(__pyx_v_self->row_desc) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":75 * * 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(27, 75, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->row_desc; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(27, 75, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_rdesc, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":76 * 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(): * result.add(rdesc[3]) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rdesc, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 76, __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(27, 76, __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":77 * for rdesc in self.row_desc: * codec = self.settings.get_data_codec((rdesc[3])) * if codec is None or not codec.has_decoder(): # <<<<<<<<<<<<<< * result.add(rdesc[3]) * */ __pyx_t_6 = (((PyObject *)__pyx_v_codec) == Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (!__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L13_bool_binop_done; } __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 77, __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(27, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = ((!__pyx_t_7) != 0); __pyx_t_2 = __pyx_t_6; __pyx_L13_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":78 * codec = self.settings.get_data_codec((rdesc[3])) * if codec is None or not codec.has_decoder(): * result.add(rdesc[3]) # <<<<<<<<<<<<<< * * if len(result): */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rdesc, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PySet_Add(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(27, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":77 * for rdesc in self.row_desc: * codec = self.settings.get_data_codec((rdesc[3])) * if codec is None or not codec.has_decoder(): # <<<<<<<<<<<<<< * result.add(rdesc[3]) * */ } /* "asyncpg/protocol/prepared_stmt.pyx":75 * * 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":74 * result.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":80 * result.add(rdesc[3]) * * if len(result): # <<<<<<<<<<<<<< * return result * else: */ __pyx_t_3 = PySet_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(27, 80, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":81 * * if len(result): * return result # <<<<<<<<<<<<<< * else: * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":80 * result.add(rdesc[3]) * * if len(result): # <<<<<<<<<<<<<< * return result * else: */ } /* "asyncpg/protocol/prepared_stmt.pyx":83 * return result * else: * return True # <<<<<<<<<<<<<< * * def attach(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; } /* "asyncpg/protocol/prepared_stmt.pyx":63 * 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_result); __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":85 * return True * * def attach(self): # <<<<<<<<<<<<<< * self.refs += 1 * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9attach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9attach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("attach (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8attach(((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_8attach(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":86 * * def attach(self): * self.refs += 1 # <<<<<<<<<<<<<< * * def detach(self): */ __pyx_v_self->refs = (__pyx_v_self->refs + 1); /* "asyncpg/protocol/prepared_stmt.pyx":85 * return True * * 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":88 * self.refs += 1 * * def detach(self): # <<<<<<<<<<<<<< * self.refs -= 1 * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("detach (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_10detach(((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_10detach(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":89 * * def detach(self): * self.refs -= 1 # <<<<<<<<<<<<<< * * def mark_closed(self): */ __pyx_v_self->refs = (__pyx_v_self->refs - 1); /* "asyncpg/protocol/prepared_stmt.pyx":88 * 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":91 * self.refs -= 1 * * def mark_closed(self): # <<<<<<<<<<<<<< * self.closed = True * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13mark_closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13mark_closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mark_closed (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12mark_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_12mark_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":92 * * def mark_closed(self): * self.closed = True # <<<<<<<<<<<<<< * * cdef _encode_bind_msg(self, args): */ __pyx_v_self->closed = 1; /* "asyncpg/protocol/prepared_stmt.pyx":91 * 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":94 * self.closed = True * * cdef _encode_bind_msg(self, args): # <<<<<<<<<<<<<< * 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) { int __pyx_v_idx; struct __pyx_obj_7asyncpg_8protocol_8protocol_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_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; int16_t __pyx_t_7; int __pyx_t_8; __Pyx_RefNannySetupContext("_encode_bind_msg", 0); /* "asyncpg/protocol/prepared_stmt.pyx":100 * Codec codec * * if len(args) > 32767: # <<<<<<<<<<<<<< * raise exceptions.InterfaceError( * 'the number of query arguments cannot exceed 32767') */ __pyx_t_1 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(27, 100, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 > 0x7FFF) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":101 * * if len(args) > 32767: * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * 'the number of query arguments cannot exceed 32767') * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(27, 101, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":100 * Codec codec * * if len(args) > 32767: # <<<<<<<<<<<<<< * raise exceptions.InterfaceError( * 'the number of query arguments cannot exceed 32767') */ } /* "asyncpg/protocol/prepared_stmt.pyx":104 * 'the number of query arguments cannot exceed 32767') * * self._ensure_args_encoder() # <<<<<<<<<<<<<< * self._ensure_rows_decoder() * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":105 * * self._ensure_args_encoder() * self._ensure_rows_decoder() # <<<<<<<<<<<<<< * * writer = WriteBuffer.new() */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":107 * self._ensure_rows_decoder() * * writer = WriteBuffer.new() # <<<<<<<<<<<<<< * * num_args_passed = len(args) */ __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_writer = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":109 * 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_1 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(27, 109, __pyx_L1_error) __pyx_v_num_args_passed = __pyx_t_1; /* "asyncpg/protocol/prepared_stmt.pyx":110 * * num_args_passed = len(args) * if self.args_num != num_args_passed: # <<<<<<<<<<<<<< * hint = 'Check the query against the passed list of arguments.' * */ __pyx_t_2 = ((__pyx_v_self->args_num != __pyx_v_num_args_passed) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":111 * num_args_passed = len(args) * if self.args_num != num_args_passed: * hint = 'Check the query against the passed list of arguments.' # <<<<<<<<<<<<<< * * if self.args_num == 0: */ __Pyx_INCREF(__pyx_kp_u_Check_the_query_against_the_pass); __pyx_v_hint = __pyx_kp_u_Check_the_query_against_the_pass; /* "asyncpg/protocol/prepared_stmt.pyx":113 * 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_2 = ((__pyx_v_self->args_num == 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":117 * # 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, and VALUES' * r' statements, and will *not* work in statements ' */ __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_v_hint, __pyx_kp_u_Note_that_parameters_are_suppor); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_hint, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":113 * 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":122 * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":124 * raise exceptions.InterfaceError( * 'the server expects {x} argument{s} for this query, ' * '{y} {w} passed'.format( # <<<<<<<<<<<<<< * x=self.args_num, s='s' if self.args_num != 1 else '', * y=num_args_passed, */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_server_expects_x_argument_s, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/prepared_stmt.pyx":125 * '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_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int16_t(__pyx_v_self->args_num); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_x, __pyx_t_6) < 0) __PYX_ERR(27, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (((__pyx_v_self->args_num != 1) != 0)) { __Pyx_INCREF(__pyx_n_u_s); __pyx_t_6 = __pyx_n_u_s; } else { __Pyx_INCREF(__pyx_kp_u__22); __pyx_t_6 = __pyx_kp_u__22; } if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_s, __pyx_t_6) < 0) __PYX_ERR(27, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":126 * '{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_6 = PyInt_FromSsize_t(__pyx_v_num_args_passed); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_y, __pyx_t_6) < 0) __PYX_ERR(27, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":127 * 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 (((__pyx_v_num_args_passed == 1) != 0)) { __Pyx_INCREF(__pyx_n_u_was); __pyx_t_6 = __pyx_n_u_was; } else { __Pyx_INCREF(__pyx_n_u_were); __pyx_t_6 = __pyx_n_u_were; } if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_w, __pyx_t_6) < 0) __PYX_ERR(27, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":124 * 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_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":122 * 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 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":128 * y=num_args_passed, * w='was' if num_args_passed == 1 else 'were'), * hint=hint) # <<<<<<<<<<<<<< * * if self.have_text_args: */ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_hint, __pyx_v_hint) < 0) __PYX_ERR(27, 128, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":122 * 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_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(27, 122, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":110 * * 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":130 * hint=hint) * * if self.have_text_args: # <<<<<<<<<<<<<< * writer.write_int16(self.args_num) * for idx from 0 <= idx < self.args_num: */ __pyx_t_2 = (__pyx_v_self->have_text_args != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":131 * * if self.have_text_args: * writer.write_int16(self.args_num) # <<<<<<<<<<<<<< * for idx from 0 <= idx < self.args_num: * codec = (self.args_codecs[idx]) */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_writer, __pyx_v_self->args_num); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":132 * if self.have_text_args: * writer.write_int16(self.args_num) * for idx from 0 <= idx < self.args_num: # <<<<<<<<<<<<<< * codec = (self.args_codecs[idx]) * writer.write_int16(codec.format) */ __pyx_t_7 = __pyx_v_self->args_num; for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_7; __pyx_v_idx++) { /* "asyncpg/protocol/prepared_stmt.pyx":133 * writer.write_int16(self.args_num) * for idx from 0 <= idx < 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(27, 133, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->args_codecs, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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":134 * for idx from 0 <= idx < self.args_num: * codec = (self.args_codecs[idx]) * writer.write_int16(codec.format) # <<<<<<<<<<<<<< * else: * # All arguments are in binary format */ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_writer, __pyx_v_codec->format); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":130 * hint=hint) * * if self.have_text_args: # <<<<<<<<<<<<<< * writer.write_int16(self.args_num) * for idx from 0 <= idx < self.args_num: */ goto __pyx_L6; } /* "asyncpg/protocol/prepared_stmt.pyx":137 * else: * # All arguments are in binary format * writer.write_int32(0x00010001) # <<<<<<<<<<<<<< * * writer.write_int16(self.args_num) */ /*else*/ { __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_writer, 0x00010001); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L6:; /* "asyncpg/protocol/prepared_stmt.pyx":139 * writer.write_int32(0x00010001) * * writer.write_int16(self.args_num) # <<<<<<<<<<<<<< * * for idx from 0 <= idx < self.args_num: */ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_writer, __pyx_v_self->args_num); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":141 * writer.write_int16(self.args_num) * * for idx from 0 <= idx < self.args_num: # <<<<<<<<<<<<<< * arg = args[idx] * if arg is None: */ __pyx_t_7 = __pyx_v_self->args_num; for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_7; __pyx_v_idx++) { /* "asyncpg/protocol/prepared_stmt.pyx":142 * * for idx from 0 <= idx < 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_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 142, __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":143 * for idx from 0 <= idx < self.args_num: * arg = args[idx] * if arg is None: # <<<<<<<<<<<<<< * writer.write_int32(-1) * else: */ __pyx_t_2 = (__pyx_v_arg == Py_None); __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "asyncpg/protocol/prepared_stmt.pyx":144 * arg = args[idx] * if arg is None: * writer.write_int32(-1) # <<<<<<<<<<<<<< * else: * codec = (self.args_codecs[idx]) */ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_writer, -1); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":143 * for idx from 0 <= idx < self.args_num: * arg = args[idx] * if arg is None: # <<<<<<<<<<<<<< * writer.write_int32(-1) * else: */ goto __pyx_L11; } /* "asyncpg/protocol/prepared_stmt.pyx":146 * writer.write_int32(-1) * else: * codec = (self.args_codecs[idx]) # <<<<<<<<<<<<<< * 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(27, 146, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_self->args_codecs, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":147 * else: * codec = (self.args_codecs[idx]) * codec.encode(self.settings, writer, arg) # <<<<<<<<<<<<<< * * if self.have_text_cols: */ __pyx_t_3 = ((PyObject *)__pyx_v_self->settings); __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_3), __pyx_v_writer, __pyx_v_arg); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 147, __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; } __pyx_L11:; } /* "asyncpg/protocol/prepared_stmt.pyx":149 * codec.encode(self.settings, writer, arg) * * if self.have_text_cols: # <<<<<<<<<<<<<< * writer.write_int16(self.cols_num) * for idx from 0 <= idx < self.cols_num: */ __pyx_t_8 = (__pyx_v_self->have_text_cols != 0); if (__pyx_t_8) { /* "asyncpg/protocol/prepared_stmt.pyx":150 * * if self.have_text_cols: * writer.write_int16(self.cols_num) # <<<<<<<<<<<<<< * for idx from 0 <= idx < self.cols_num: * codec = (self.rows_codecs[idx]) */ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_writer, __pyx_v_self->cols_num); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":151 * if self.have_text_cols: * writer.write_int16(self.cols_num) * for idx from 0 <= idx < self.cols_num: # <<<<<<<<<<<<<< * codec = (self.rows_codecs[idx]) * writer.write_int16(codec.format) */ __pyx_t_7 = __pyx_v_self->cols_num; for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_7; __pyx_v_idx++) { /* "asyncpg/protocol/prepared_stmt.pyx":152 * writer.write_int16(self.cols_num) * for idx from 0 <= idx < 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(27, 152, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_self->rows_codecs, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":153 * for idx from 0 <= idx < self.cols_num: * codec = (self.rows_codecs[idx]) * writer.write_int16(codec.format) # <<<<<<<<<<<<<< * else: * # All columns are in binary format */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_v_writer, __pyx_v_codec->format); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":149 * codec.encode(self.settings, writer, arg) * * if self.have_text_cols: # <<<<<<<<<<<<<< * writer.write_int16(self.cols_num) * for idx from 0 <= idx < self.cols_num: */ goto __pyx_L12; } /* "asyncpg/protocol/prepared_stmt.pyx":156 * else: * # All columns are in binary format * writer.write_int32(0x00010001) # <<<<<<<<<<<<<< * * return writer */ /*else*/ { __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_v_writer, 0x00010001); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L12:; /* "asyncpg/protocol/prepared_stmt.pyx":158 * 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":94 * self.closed = True * * cdef _encode_bind_msg(self, args): # <<<<<<<<<<<<<< * cdef: * int idx */ /* 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.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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":160 * 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; int __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; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int16_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("_ensure_rows_decoder", 0); /* "asyncpg/protocol/prepared_stmt.pyx":169 * list codecs * * if self.cols_desc is not None: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = (__pyx_v_self->cols_desc != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":170 * * 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":169 * list codecs * * if self.cols_desc is not None: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/prepared_stmt.pyx":172 * return * * if self.cols_num == 0: # <<<<<<<<<<<<<< * self.cols_desc = record.ApgRecordDesc_New({}, ()) * return */ __pyx_t_2 = ((__pyx_v_self->cols_num == 0) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":173 * * if self.cols_num == 0: * self.cols_desc = record.ApgRecordDesc_New({}, ()) # <<<<<<<<<<<<<< * return * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ApgRecordDesc_New(__pyx_t_3, __pyx_empty_tuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->cols_desc); __Pyx_DECREF(__pyx_v_self->cols_desc); __pyx_v_self->cols_desc = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":174 * if self.cols_num == 0: * self.cols_desc = record.ApgRecordDesc_New({}, ()) * return # <<<<<<<<<<<<<< * * cols_mapping = collections.OrderedDict() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":172 * return * * if self.cols_num == 0: # <<<<<<<<<<<<<< * self.cols_desc = record.ApgRecordDesc_New({}, ()) * return */ } /* "asyncpg/protocol/prepared_stmt.pyx":176 * return * * cols_mapping = collections.OrderedDict() # <<<<<<<<<<<<<< * cols_names = [] * codecs = [] */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 176, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_cols_mapping = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":177 * * cols_mapping = collections.OrderedDict() * cols_names = [] # <<<<<<<<<<<<<< * codecs = [] * for i from 0 <= i < self.cols_num: */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_cols_names = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":178 * cols_mapping = collections.OrderedDict() * cols_names = [] * codecs = [] # <<<<<<<<<<<<<< * for i from 0 <= i < self.cols_num: * row = self.row_desc[i] */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_codecs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":179 * cols_names = [] * codecs = [] * for i from 0 <= i < self.cols_num: # <<<<<<<<<<<<<< * row = self.row_desc[i] * col_name = row[0].decode(self.settings._encoding) */ __pyx_t_6 = __pyx_v_self->cols_num; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { /* "asyncpg/protocol/prepared_stmt.pyx":180 * 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(27, 180, __pyx_L1_error) } __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->row_desc, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(27, 180, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":181 * 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(27, 181, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->settings->_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_self->settings->_encoding}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 181, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_self->settings->_encoding}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 181, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_self->settings->_encoding); __Pyx_GIVEREF(__pyx_v_self->settings->_encoding); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_self->settings->_encoding); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_col_name, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":182 * 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_4 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(PyObject_SetItem(__pyx_v_cols_mapping, __pyx_v_col_name, __pyx_t_4) < 0)) __PYX_ERR(27, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":183 * 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) */ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_cols_names, __pyx_v_col_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(27, 183, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":184 * cols_mapping[col_name] = i * cols_names.append(col_name) * oid = row[3] # <<<<<<<<<<<<<< * codec = self.settings.get_data_codec(oid) * if codec is None or not codec.has_decoder(): */ if (unlikely(__pyx_v_row == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(27, 184, __pyx_L1_error) } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_row, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(27, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_oid = __pyx_t_9; /* "asyncpg/protocol/prepared_stmt.pyx":185 * cols_names.append(col_name) * oid = row[3] * codec = self.settings.get_data_codec(oid) # <<<<<<<<<<<<<< * if codec is None or not codec.has_decoder(): * raise RuntimeError('no decoder for OID {}'.format(oid)) */ __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_self->settings, ((uint32_t)__pyx_v_oid), 0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 185, __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":186 * oid = row[3] * codec = self.settings.get_data_codec(oid) * if codec is None or not codec.has_decoder(): # <<<<<<<<<<<<<< * raise RuntimeError('no decoder for OID {}'.format(oid)) * if not codec.is_binary(): */ __pyx_t_1 = (((PyObject *)__pyx_v_codec) == Py_None); __pyx_t_10 = (__pyx_t_1 != 0); if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L8_bool_binop_done; } __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(27, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = ((!__pyx_t_10) != 0); __pyx_t_2 = __pyx_t_1; __pyx_L8_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":187 * codec = self.settings.get_data_codec(oid) * if codec is None or not codec.has_decoder(): * raise RuntimeError('no decoder for OID {}'.format(oid)) # <<<<<<<<<<<<<< * if not codec.is_binary(): * self.have_text_cols = True */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_no_decoder_for_OID, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_oid); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 187, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 187, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(27, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(27, 187, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":186 * oid = row[3] * codec = self.settings.get_data_codec(oid) * if codec is None or not codec.has_decoder(): # <<<<<<<<<<<<<< * raise RuntimeError('no decoder for OID {}'.format(oid)) * if not codec.is_binary(): */ } /* "asyncpg/protocol/prepared_stmt.pyx":188 * if codec is None or not codec.has_decoder(): * raise RuntimeError('no decoder for OID {}'.format(oid)) * if not codec.is_binary(): # <<<<<<<<<<<<<< * self.have_text_cols = True * */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary(__pyx_v_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":189 * raise RuntimeError('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":188 * if codec is None or not codec.has_decoder(): * raise RuntimeError('no decoder for OID {}'.format(oid)) * if not codec.is_binary(): # <<<<<<<<<<<<<< * self.have_text_cols = True * */ } /* "asyncpg/protocol/prepared_stmt.pyx":191 * self.have_text_cols = True * * codecs.append(codec) # <<<<<<<<<<<<<< * * self.cols_desc = record.ApgRecordDesc_New( */ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_codecs, ((PyObject *)__pyx_v_codec)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(27, 191, __pyx_L1_error) } /* "asyncpg/protocol/prepared_stmt.pyx":194 * * self.cols_desc = record.ApgRecordDesc_New( * cols_mapping, tuple(cols_names)) # <<<<<<<<<<<<<< * * self.rows_codecs = tuple(codecs) */ __pyx_t_4 = PyList_AsTuple(__pyx_v_cols_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/prepared_stmt.pyx":193 * codecs.append(codec) * * self.cols_desc = record.ApgRecordDesc_New( # <<<<<<<<<<<<<< * cols_mapping, tuple(cols_names)) * */ __pyx_t_3 = ApgRecordDesc_New(__pyx_v_cols_mapping, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->cols_desc); __Pyx_DECREF(__pyx_v_self->cols_desc); __pyx_v_self->cols_desc = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":196 * cols_mapping, tuple(cols_names)) * * self.rows_codecs = tuple(codecs) # <<<<<<<<<<<<<< * * cdef _ensure_args_encoder(self): */ __pyx_t_3 = PyList_AsTuple(__pyx_v_codecs); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->rows_codecs); __Pyx_DECREF(__pyx_v_self->rows_codecs); __pyx_v_self->rows_codecs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":160 * 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_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __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":198 * self.rows_codecs = tuple(codecs) * * cdef _ensure_args_encoder(self): # <<<<<<<<<<<<<< * cdef: * int p_oid */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { int __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; int __pyx_t_4; int16_t __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; __Pyx_RefNannySetupContext("_ensure_args_encoder", 0); /* "asyncpg/protocol/prepared_stmt.pyx":202 * int 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(27, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_codecs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":204 * list codecs = [] * * if self.args_num == 0 or self.args_codecs is not None: # <<<<<<<<<<<<<< * return * */ __pyx_t_3 = ((__pyx_v_self->args_num == 0) != 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_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":205 * * 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":204 * list codecs = [] * * if self.args_num == 0 or self.args_codecs is not None: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/prepared_stmt.pyx":207 * return * * for i from 0 <= i < self.args_num: # <<<<<<<<<<<<<< * p_oid = self.parameters_desc[i] * codec = self.settings.get_data_codec(p_oid) */ __pyx_t_5 = __pyx_v_self->args_num; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "asyncpg/protocol/prepared_stmt.pyx":208 * * for i from 0 <= i < self.args_num: * p_oid = self.parameters_desc[i] # <<<<<<<<<<<<<< * 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 subscriptable"); __PYX_ERR(27, 208, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->parameters_desc, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(27, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_p_oid = __pyx_t_6; /* "asyncpg/protocol/prepared_stmt.pyx":209 * for i from 0 <= i < self.args_num: * p_oid = self.parameters_desc[i] * codec = self.settings.get_data_codec(p_oid) # <<<<<<<<<<<<<< * if codec is None or not codec.has_encoder(): * raise RuntimeError('no encoder for OID {}'.format(p_oid)) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_self->settings, ((uint32_t)__pyx_v_p_oid), 0, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 209, __pyx_L1_error) __Pyx_GOTREF(__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":210 * p_oid = self.parameters_desc[i] * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): # <<<<<<<<<<<<<< * raise RuntimeError('no encoder for OID {}'.format(p_oid)) * if codec.type not in {}: */ __pyx_t_4 = (((PyObject *)__pyx_v_codec) == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); 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(27, 210, __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(27, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L9_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":211 * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): * raise RuntimeError('no encoder for OID {}'.format(p_oid)) # <<<<<<<<<<<<<< * if codec.type not in {}: * self.have_text_args = True */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_no_encoder_for_OID, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_p_oid); if (unlikely(!__pyx_t_8)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_9) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_8}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_8}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(27, 211, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":210 * p_oid = self.parameters_desc[i] * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): # <<<<<<<<<<<<<< * raise RuntimeError('no encoder for OID {}'.format(p_oid)) * if codec.type not in {}: */ } /* "asyncpg/protocol/prepared_stmt.pyx":212 * if codec is None or not codec.has_encoder(): * raise RuntimeError('no encoder for OID {}'.format(p_oid)) * if codec.type not in {}: # <<<<<<<<<<<<<< * self.have_text_args = True * */ __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(__pyx_v_codec->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 212, __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(27, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { /* "asyncpg/protocol/prepared_stmt.pyx":213 * raise RuntimeError('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":212 * if codec is None or not codec.has_encoder(): * raise RuntimeError('no encoder for OID {}'.format(p_oid)) * if codec.type not in {}: # <<<<<<<<<<<<<< * self.have_text_args = True * */ } /* "asyncpg/protocol/prepared_stmt.pyx":215 * self.have_text_args = True * * codecs.append(codec) # <<<<<<<<<<<<<< * * self.args_codecs = tuple(codecs) */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_codecs, ((PyObject *)__pyx_v_codec)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(27, 215, __pyx_L1_error) } /* "asyncpg/protocol/prepared_stmt.pyx":217 * 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(27, 217, __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":198 * self.rows_codecs = tuple(codecs) * * cdef _ensure_args_encoder(self): # <<<<<<<<<<<<<< * cdef: * int 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_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __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":219 * 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; __Pyx_RefNannySetupContext("_set_row_desc", 0); /* "asyncpg/protocol/prepared_stmt.pyx":220 * * 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(27, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(27, 220, __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":221 * 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(27, 221, __pyx_L1_error) } __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(27, 221, __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":219 * 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":223 * 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; __Pyx_RefNannySetupContext("_set_args_desc", 0); /* "asyncpg/protocol/prepared_stmt.pyx":224 * * 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(27, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(27, 224, __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":225 * 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(27, 225, __pyx_L1_error) } __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(27, 225, __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":223 * 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":227 * 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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v_rbuf = 0; 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; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; Py_ssize_t __pyx_t_12; int16_t __pyx_t_13; int32_t __pyx_t_14; Py_ssize_t __pyx_t_15; PyObject *__pyx_t_16; PyObject *__pyx_t_17 = NULL; __Pyx_RefNannySetupContext("_decode_row", 0); /* "asyncpg/protocol/prepared_stmt.pyx":233 * 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":234 * object dec_row * tuple rows_codecs = self.rows_codecs * ConnectionSettings settings = self.settings # <<<<<<<<<<<<<< * int32_t i * FastReadBuffer rbuf = self.buffer */ __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":236 * ConnectionSettings settings = self.settings * int32_t i * FastReadBuffer rbuf = self.buffer # <<<<<<<<<<<<<< * ssize_t bl * */ __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer); __Pyx_INCREF(__pyx_t_1); __pyx_v_rbuf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":239 * ssize_t bl * * rbuf.buf = cbuf # <<<<<<<<<<<<<< * rbuf.len = buf_len * */ __pyx_v_rbuf->buf = __pyx_v_cbuf; /* "asyncpg/protocol/prepared_stmt.pyx":240 * * rbuf.buf = cbuf * rbuf.len = buf_len # <<<<<<<<<<<<<< * * fnum = hton.unpack_int16(rbuf.read(2)) */ __pyx_v_rbuf->len = __pyx_v_buf_len; /* "asyncpg/protocol/prepared_stmt.pyx":242 * rbuf.len = buf_len * * fnum = hton.unpack_int16(rbuf.read(2)) # <<<<<<<<<<<<<< * * if fnum != self.cols_num: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_rbuf, 2); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(27, 242, __pyx_L1_error) __pyx_v_fnum = __pyx_f_7asyncpg_8protocol_4hton_unpack_int16(__pyx_t_2); /* "asyncpg/protocol/prepared_stmt.pyx":244 * fnum = hton.unpack_int16(rbuf.read(2)) * * if fnum != self.cols_num: # <<<<<<<<<<<<<< * raise RuntimeError( * 'number of columns in result ({}) is ' */ __pyx_t_3 = ((__pyx_v_fnum != __pyx_v_self->cols_num) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/prepared_stmt.pyx":247 * raise RuntimeError( * 'number of columns in result ({}) is ' * 'different from what was described ({})'.format( # <<<<<<<<<<<<<< * fnum, self.cols_num)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_number_of_columns_in_result_is_d, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/prepared_stmt.pyx":248 * 'number of columns in result ({}) is ' * 'different from what was described ({})'.format( * fnum, self.cols_num)) # <<<<<<<<<<<<<< * * if rows_codecs is None or len(rows_codecs) < fnum: */ __pyx_t_5 = __Pyx_PyInt_From_int16_t(__pyx_v_fnum); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int16_t(__pyx_v_self->cols_num); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(27, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":245 * * if fnum != self.cols_num: * raise RuntimeError( # <<<<<<<<<<<<<< * 'number of columns in result ({}) is ' * 'different from what was described ({})'.format( */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(27, 245, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":244 * fnum = hton.unpack_int16(rbuf.read(2)) * * if fnum != self.cols_num: # <<<<<<<<<<<<<< * raise RuntimeError( * 'number of columns in result ({}) is ' */ } /* "asyncpg/protocol/prepared_stmt.pyx":250 * fnum, self.cols_num)) * * if rows_codecs is None or len(rows_codecs) < fnum: # <<<<<<<<<<<<<< * if fnum > 0: * # It's OK to have no rows_codecs for empty records */ __pyx_t_10 = (__pyx_v_rows_codecs == ((PyObject*)Py_None)); __pyx_t_11 = (__pyx_t_10 != 0); if (!__pyx_t_11) { } else { __pyx_t_3 = __pyx_t_11; goto __pyx_L5_bool_binop_done; } if (unlikely(__pyx_v_rows_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(27, 250, __pyx_L1_error) } __pyx_t_12 = PyTuple_GET_SIZE(__pyx_v_rows_codecs); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(27, 250, __pyx_L1_error) __pyx_t_11 = ((__pyx_t_12 < __pyx_v_fnum) != 0); __pyx_t_3 = __pyx_t_11; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "asyncpg/protocol/prepared_stmt.pyx":251 * * if rows_codecs is None or len(rows_codecs) < fnum: * if fnum > 0: # <<<<<<<<<<<<<< * # It's OK to have no rows_codecs for empty records * raise RuntimeError('invalid rows_codecs') */ __pyx_t_3 = ((__pyx_v_fnum > 0) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/prepared_stmt.pyx":253 * if fnum > 0: * # It's OK to have no rows_codecs for empty records * raise RuntimeError('invalid rows_codecs') # <<<<<<<<<<<<<< * * dec_row = record.ApgRecord_New(self.cols_desc, fnum) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 253, __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(27, 253, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":251 * * if rows_codecs is None or len(rows_codecs) < fnum: * if fnum > 0: # <<<<<<<<<<<<<< * # It's OK to have no rows_codecs for empty records * raise RuntimeError('invalid rows_codecs') */ } /* "asyncpg/protocol/prepared_stmt.pyx":250 * fnum, self.cols_num)) * * if rows_codecs is None or len(rows_codecs) < fnum: # <<<<<<<<<<<<<< * if fnum > 0: * # It's OK to have no rows_codecs for empty records */ } /* "asyncpg/protocol/prepared_stmt.pyx":255 * raise RuntimeError('invalid rows_codecs') * * dec_row = record.ApgRecord_New(self.cols_desc, fnum) # <<<<<<<<<<<<<< * for i in range(fnum): * flen = hton.unpack_int32(rbuf.read(4)) */ __pyx_t_1 = __pyx_v_self->cols_desc; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = ApgRecord_New(__pyx_t_1, __pyx_v_fnum); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dec_row = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":256 * * dec_row = record.ApgRecord_New(self.cols_desc, fnum) * for i in range(fnum): # <<<<<<<<<<<<<< * flen = hton.unpack_int32(rbuf.read(4)) * */ __pyx_t_13 = __pyx_v_fnum; for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; /* "asyncpg/protocol/prepared_stmt.pyx":257 * dec_row = record.ApgRecord_New(self.cols_desc, fnum) * for i in range(fnum): * flen = hton.unpack_int32(rbuf.read(4)) # <<<<<<<<<<<<<< * * if flen == -1: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read(__pyx_v_rbuf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(27, 257, __pyx_L1_error) __pyx_v_flen = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_t_2); /* "asyncpg/protocol/prepared_stmt.pyx":259 * flen = hton.unpack_int32(rbuf.read(4)) * * if flen == -1: # <<<<<<<<<<<<<< * val = None * else: */ __pyx_t_3 = ((__pyx_v_flen == -1L) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/prepared_stmt.pyx":260 * * 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":259 * flen = hton.unpack_int32(rbuf.read(4)) * * if flen == -1: # <<<<<<<<<<<<<< * val = None * else: */ goto __pyx_L10; } /* "asyncpg/protocol/prepared_stmt.pyx":265 * # to make sure that codecs can rely on read_all() working * # properly. * bl = rbuf.len # <<<<<<<<<<<<<< * if flen > bl: * # Check for overflow */ /*else*/ { __pyx_t_15 = __pyx_v_rbuf->len; __pyx_v_bl = __pyx_t_15; /* "asyncpg/protocol/prepared_stmt.pyx":266 * # properly. * bl = rbuf.len * if flen > bl: # <<<<<<<<<<<<<< * # Check for overflow * rbuf._raise_ins_err(flen, bl) */ __pyx_t_3 = ((__pyx_v_flen > __pyx_v_bl) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/prepared_stmt.pyx":268 * if flen > bl: * # Check for overflow * rbuf._raise_ins_err(flen, bl) # <<<<<<<<<<<<<< * rbuf.len = flen * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer__raise_ins_err(__pyx_v_rbuf, __pyx_v_flen, __pyx_v_bl); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":266 * # properly. * bl = rbuf.len * if flen > bl: # <<<<<<<<<<<<<< * # Check for overflow * rbuf._raise_ins_err(flen, bl) */ } /* "asyncpg/protocol/prepared_stmt.pyx":269 * # Check for overflow * rbuf._raise_ins_err(flen, bl) * rbuf.len = flen # <<<<<<<<<<<<<< * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) * val = codec.decode(settings, rbuf) */ __pyx_v_rbuf->len = __pyx_v_flen; /* "asyncpg/protocol/prepared_stmt.pyx":270 * rbuf._raise_ins_err(flen, bl) * rbuf.len = flen * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) # <<<<<<<<<<<<<< * val = codec.decode(settings, rbuf) * if rbuf.len != 0: */ __pyx_t_16 = PyTuple_GET_ITEM(__pyx_v_rows_codecs, __pyx_v_i); __pyx_t_4 = ((PyObject *)__pyx_t_16); __Pyx_INCREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":271 * rbuf.len = flen * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) * val = codec.decode(settings, rbuf) # <<<<<<<<<<<<<< * if rbuf.len != 0: * raise BufferError( */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_codec, __pyx_v_settings, __pyx_v_rbuf); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":272 * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) * val = codec.decode(settings, rbuf) * if rbuf.len != 0: # <<<<<<<<<<<<<< * raise BufferError( * 'unexpected trailing {} bytes in buffer'.format( */ __pyx_t_3 = ((__pyx_v_rbuf->len != 0) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/prepared_stmt.pyx":273 * val = codec.decode(settings, rbuf) * if rbuf.len != 0: * raise BufferError( # <<<<<<<<<<<<<< * 'unexpected trailing {} bytes in buffer'.format( * rbuf.len)) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/prepared_stmt.pyx":274 * if rbuf.len != 0: * raise BufferError( * 'unexpected trailing {} bytes in buffer'.format( # <<<<<<<<<<<<<< * rbuf.len)) * rbuf.len = bl - flen */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_trailing_bytes_in_buf, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/prepared_stmt.pyx":275 * raise BufferError( * 'unexpected trailing {} bytes in buffer'.format( * rbuf.len)) # <<<<<<<<<<<<<< * rbuf.len = bl - flen * */ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_rbuf->len); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_7) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(27, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_9); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(27, 274, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(27, 274, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(27, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_17, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(27, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_9}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 273, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_9}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 273, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(27, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(27, 273, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":272 * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) * val = codec.decode(settings, rbuf) * if rbuf.len != 0: # <<<<<<<<<<<<<< * raise BufferError( * 'unexpected trailing {} bytes in buffer'.format( */ } /* "asyncpg/protocol/prepared_stmt.pyx":276 * 'unexpected trailing {} bytes in buffer'.format( * rbuf.len)) * rbuf.len = bl - flen # <<<<<<<<<<<<<< * * cpython.Py_INCREF(val) */ __pyx_v_rbuf->len = (__pyx_v_bl - __pyx_v_flen); } __pyx_L10:; /* "asyncpg/protocol/prepared_stmt.pyx":278 * rbuf.len = bl - flen * * cpython.Py_INCREF(val) # <<<<<<<<<<<<<< * record.ApgRecord_SET_ITEM(dec_row, i, val) * */ Py_INCREF(__pyx_v_val); /* "asyncpg/protocol/prepared_stmt.pyx":279 * * cpython.Py_INCREF(val) * record.ApgRecord_SET_ITEM(dec_row, i, val) # <<<<<<<<<<<<<< * * if rbuf.len != 0: */ ApgRecord_SET_ITEM(__pyx_v_dec_row, __pyx_v_i, __pyx_v_val); } /* "asyncpg/protocol/prepared_stmt.pyx":281 * record.ApgRecord_SET_ITEM(dec_row, i, val) * * if rbuf.len != 0: # <<<<<<<<<<<<<< * raise BufferError('unexpected trailing {} bytes in buffer'.format( * rbuf.len)) */ __pyx_t_3 = ((__pyx_v_rbuf->len != 0) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/prepared_stmt.pyx":282 * * if rbuf.len != 0: * raise BufferError('unexpected trailing {} bytes in buffer'.format( # <<<<<<<<<<<<<< * rbuf.len)) * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_BufferError); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_trailing_bytes_in_buf, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/prepared_stmt.pyx":283 * if rbuf.len != 0: * raise BufferError('unexpected trailing {} bytes in buffer'.format( * rbuf.len)) # <<<<<<<<<<<<<< * * return dec_row */ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_rbuf->len); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_5) { __pyx_t_17 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_17); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_17 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_17 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_9) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_17); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_17}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_17}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_17); __pyx_t_17 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(27, 282, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":281 * record.ApgRecord_SET_ITEM(dec_row, i, val) * * if rbuf.len != 0: # <<<<<<<<<<<<<< * raise BufferError('unexpected trailing {} bytes in buffer'.format( * rbuf.len)) */ } /* "asyncpg/protocol/prepared_stmt.pyx":285 * rbuf.len)) * * 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":227 * 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_9); __Pyx_XDECREF(__pyx_t_17); __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((PyObject *)__pyx_v_rbuf); __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) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __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 int refs */ /* 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) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __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 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) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __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; __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(28, 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 int refs # <<<<<<<<<<<<<< * * FastReadBuffer buffer */ /* 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) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __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; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->refs); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 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.refs.__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_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_14__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_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __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, 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_XDECREF(__pyx_t_1); __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_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_16__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_16__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 PyObject *__pyx_t_1 = NULL; __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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __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, 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_XDECREF(__pyx_t_1); __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":288 * * * 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_8protocol_8protocol_ReadBuffer *__pyx_v_reader = 0; int16_t __pyx_v_nparams; int32_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; __Pyx_RefNannySetupContext("_decode_parameters_desc", 0); /* "asyncpg/protocol/prepared_stmt.pyx":293 * int16_t nparams * int32_t p_oid * list result = [] # <<<<<<<<<<<<<< * * reader = ReadBuffer.new_message_parser(desc) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":295 * list result = [] * * reader = ReadBuffer.new_message_parser(desc) # <<<<<<<<<<<<<< * nparams = reader.read_int16() * */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_new_message_parser(__pyx_v_desc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_reader = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":296 * * reader = ReadBuffer.new_message_parser(desc) * nparams = reader.read_int16() # <<<<<<<<<<<<<< * * for i from 0 <= i < nparams: */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int16(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nparams = __pyx_t_2; /* "asyncpg/protocol/prepared_stmt.pyx":298 * 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":299 * * for i from 0 <= i < nparams: * p_oid = reader.read_int32() # <<<<<<<<<<<<<< * result.append(p_oid) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_p_oid = __pyx_t_3; /* "asyncpg/protocol/prepared_stmt.pyx":300 * for i from 0 <= i < nparams: * p_oid = reader.read_int32() * result.append(p_oid) # <<<<<<<<<<<<<< * * return result */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_p_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 300, __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(27, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":302 * 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":288 * * * 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":305 * * * 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_8protocol_8protocol_ReadBuffer *__pyx_v_reader = 0; int16_t __pyx_v_nfields; PyObject *__pyx_v_f_name = 0; int32_t __pyx_v_f_table_oid; int16_t __pyx_v_f_column_num; int32_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; __Pyx_RefNannySetupContext("_decode_row_desc", 0); /* "asyncpg/protocol/prepared_stmt.pyx":321 * list result * * reader = ReadBuffer.new_message_parser(desc) # <<<<<<<<<<<<<< * nfields = reader.read_int16() * result = [] */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_new_message_parser(__pyx_v_desc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_reader = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":322 * * reader = ReadBuffer.new_message_parser(desc) * nfields = reader.read_int16() # <<<<<<<<<<<<<< * result = [] * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int16(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nfields = __pyx_t_2; /* "asyncpg/protocol/prepared_stmt.pyx":323 * 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(27, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":325 * result = [] * * for i from 0 <= i < nfields: # <<<<<<<<<<<<<< * f_name = reader.read_cstr() * 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":326 * * for i from 0 <= i < nfields: * f_name = reader.read_cstr() # <<<<<<<<<<<<<< * f_table_oid = reader.read_int32() * f_column_num = reader.read_int16() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(27, 326, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_f_name, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":327 * for i from 0 <= i < nfields: * f_name = reader.read_cstr() * f_table_oid = reader.read_int32() # <<<<<<<<<<<<<< * f_column_num = reader.read_int16() * f_dt_oid = reader.read_int32() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_f_table_oid = __pyx_t_3; /* "asyncpg/protocol/prepared_stmt.pyx":328 * f_name = reader.read_cstr() * 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int16(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_f_column_num = __pyx_t_4; /* "asyncpg/protocol/prepared_stmt.pyx":329 * 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_f_dt_oid = __pyx_t_3; /* "asyncpg/protocol/prepared_stmt.pyx":330 * 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int16(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_f_dt_size = __pyx_t_4; /* "asyncpg/protocol/prepared_stmt.pyx":331 * 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_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_f_dt_mod = __pyx_t_3; /* "asyncpg/protocol/prepared_stmt.pyx":332 * f_dt_size = reader.read_int16() * f_dt_mod = reader.read_int32() * f_format = reader.read_int16() # <<<<<<<<<<<<<< * * result.append( */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int16(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(27, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_f_format = __pyx_t_4; /* "asyncpg/protocol/prepared_stmt.pyx":335 * * result.append( * (f_name, f_table_oid, f_column_num, f_dt_oid, # <<<<<<<<<<<<<< * f_dt_size, f_dt_mod, f_format)) * */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_f_table_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int16_t(__pyx_v_f_column_num); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_f_dt_oid); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/prepared_stmt.pyx":336 * result.append( * (f_name, f_table_oid, f_column_num, f_dt_oid, * f_dt_size, f_dt_mod, f_format)) # <<<<<<<<<<<<<< * * return result */ __pyx_t_7 = __Pyx_PyInt_From_int16_t(__pyx_v_f_dt_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_f_dt_mod); if (unlikely(!__pyx_t_8)) __PYX_ERR(27, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int16_t(__pyx_v_f_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(27, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/prepared_stmt.pyx":335 * * 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(27, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_f_name); __Pyx_GIVEREF(__pyx_v_f_name); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_f_name); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_9); __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":334 * 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(27, 334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":338 * 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":305 * * * 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":92 * * cdef class BaseProtocol(CoreProtocol): * def __init__(self, addr, connected_fut, con_params, loop): # <<<<<<<<<<<<<< * # type of `con_params` is `_ConnectionParameters` * CoreProtocol.__init__(self, 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; PyObject *__pyx_v_loop = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addr,&__pyx_n_s_connected_fut,&__pyx_n_s_con_params,&__pyx_n_s_loop,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_addr)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_connected_fut)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_con_params)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 92, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 92, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 92, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_addr = values[0]; __pyx_v_connected_fut = values[1]; __pyx_v_con_params = values[2]; __pyx_v_loop = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 92, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __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_loop); /* function exit code */ __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, PyObject *__pyx_v_loop) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("__init__", 0); /* "asyncpg/protocol/protocol.pyx":94 * def __init__(self, addr, connected_fut, con_params, loop): * # type of `con_params` is `_ConnectionParameters` * CoreProtocol.__init__(self, con_params) # <<<<<<<<<<<<<< * * self.loop = loop */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_con_params}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_con_params}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_con_params); __Pyx_GIVEREF(__pyx_v_con_params); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_con_params); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":96 * CoreProtocol.__init__(self, con_params) * * self.loop = loop # <<<<<<<<<<<<<< * self.waiter = connected_fut * self.cancel_waiter = None */ __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":97 * * self.loop = loop * 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":98 * self.loop = loop * 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":99 * self.waiter = connected_fut * self.cancel_waiter = None * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self.address = addr */ __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":101 * self.cancel_sent_waiter = None * * self.address = addr # <<<<<<<<<<<<<< * self.settings = ConnectionSettings((self.address, con_params.database)) * */ __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/protocol.pyx":102 * * self.address = addr * self.settings = ConnectionSettings((self.address, con_params.database)) # <<<<<<<<<<<<<< * * self.statement = None */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_con_params, __pyx_n_s_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->address); __Pyx_GIVEREF(__pyx_v_self->address); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->address); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->settings); __Pyx_DECREF(((PyObject *)__pyx_v_self->settings)); __pyx_v_self->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":104 * self.settings = ConnectionSettings((self.address, con_params.database)) * * self.statement = None # <<<<<<<<<<<<<< * self.return_extra = False * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__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":105 * * self.statement = None * self.return_extra = False # <<<<<<<<<<<<<< * * self.last_query = None */ __pyx_v_self->return_extra = 0; /* "asyncpg/protocol/protocol.pyx":107 * 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":109 * self.last_query = None * * self.closing = False # <<<<<<<<<<<<<< * self.is_reading = True * self.writing_allowed = asyncio.Event(loop=self.loop) */ __pyx_v_self->closing = 0; /* "asyncpg/protocol/protocol.pyx":110 * * self.closing = False * self.is_reading = True # <<<<<<<<<<<<<< * self.writing_allowed = asyncio.Event(loop=self.loop) * self.writing_allowed.set() */ __pyx_v_self->is_reading = 1; /* "asyncpg/protocol/protocol.pyx":111 * self.closing = False * self.is_reading = True * self.writing_allowed = asyncio.Event(loop=self.loop) # <<<<<<<<<<<<<< * self.writing_allowed.set() * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Event); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_loop, __pyx_v_self->loop) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_writing_allowed, __pyx_t_5) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":112 * self.is_reading = True * self.writing_allowed = asyncio.Event(loop=self.loop) * self.writing_allowed.set() # <<<<<<<<<<<<<< * * self.timeout_handle = None */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":114 * self.writing_allowed.set() * * self.timeout_handle = None # <<<<<<<<<<<<<< * self.timeout_callback = self._on_timeout * self.completed_callback = self._on_waiter_completed */ __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":115 * * self.timeout_handle = None * self.timeout_callback = self._on_timeout # <<<<<<<<<<<<<< * self.completed_callback = self._on_waiter_completed * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_timeout); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->timeout_callback); __Pyx_DECREF(__pyx_v_self->timeout_callback); __pyx_v_self->timeout_callback = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":116 * self.timeout_handle = None * self.timeout_callback = self._on_timeout * self.completed_callback = self._on_waiter_completed # <<<<<<<<<<<<<< * * self.queries_count = 0 */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_waiter_completed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->completed_callback); __Pyx_DECREF(__pyx_v_self->completed_callback); __pyx_v_self->completed_callback = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":118 * self.completed_callback = self._on_waiter_completed * * self.queries_count = 0 # <<<<<<<<<<<<<< * * try: */ __pyx_v_self->queries_count = 0; /* "asyncpg/protocol/protocol.pyx":120 * self.queries_count = 0 * * 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":121 * * try: * self.create_future = loop.create_future # <<<<<<<<<<<<<< * except AttributeError: * self.create_future = self._create_future_fallback */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_create_future); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->create_future); __Pyx_DECREF(__pyx_v_self->create_future); __pyx_v_self->create_future = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":120 * self.queries_count = 0 * * 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_3); __pyx_t_3 = 0; __Pyx_XDECREF(__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; /* "asyncpg/protocol/protocol.pyx":122 * try: * self.create_future = loop.create_future * except AttributeError: # <<<<<<<<<<<<<< * self.create_future = self._create_future_fallback * */ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_4) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/protocol.pyx":123 * self.create_future = loop.create_future * except AttributeError: * self.create_future = self._create_future_fallback # <<<<<<<<<<<<<< * * def set_connection(self, connection): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_future_fallback); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->create_future); __Pyx_DECREF(__pyx_v_self->create_future); __pyx_v_self->create_future = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "asyncpg/protocol/protocol.pyx":120 * self.queries_count = 0 * * try: # <<<<<<<<<<<<<< * self.create_future = loop.create_future * except AttributeError: */ __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":92 * * cdef class BaseProtocol(CoreProtocol): * def __init__(self, addr, connected_fut, con_params, loop): # <<<<<<<<<<<<<< * # type of `con_params` is `_ConnectionParameters` * CoreProtocol.__init__(self, con_params) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_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":125 * self.create_future = self._create_future_fallback * * def set_connection(self, connection): # <<<<<<<<<<<<<< * self.connection = connection * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection(PyObject *__pyx_v_self, PyObject *__pyx_v_connection); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection(PyObject *__pyx_v_self, PyObject *__pyx_v_connection) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_connection (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_2set_connection(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_connection)); /* function exit code */ __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 __Pyx_RefNannySetupContext("set_connection", 0); /* "asyncpg/protocol/protocol.pyx":126 * * def set_connection(self, connection): * self.connection = connection # <<<<<<<<<<<<<< * * def get_server_pid(self): */ __Pyx_INCREF(__pyx_v_connection); __Pyx_GIVEREF(__pyx_v_connection); __Pyx_GOTREF(__pyx_v_self->connection); __Pyx_DECREF(__pyx_v_self->connection); __pyx_v_self->connection = __pyx_v_connection; /* "asyncpg/protocol/protocol.pyx":125 * self.create_future = self._create_future_fallback * * def set_connection(self, connection): # <<<<<<<<<<<<<< * self.connection = connection * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":128 * self.connection = connection * * 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, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_server_pid (wrapper)", 0); __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; __Pyx_RefNannySetupContext("get_server_pid", 0); /* "asyncpg/protocol/protocol.pyx":129 * * def get_server_pid(self): * return self.backend_pid # <<<<<<<<<<<<<< * * def get_settings(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->__pyx_base.backend_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":128 * self.connection = connection * * 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":131 * 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, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_settings (wrapper)", 0); __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":132 * * def get_settings(self): * return self.settings # <<<<<<<<<<<<<< * * def is_in_transaction(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":131 * 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":134 * return self.settings * * def is_in_transaction(self): # <<<<<<<<<<<<<< * # PQTRANS_INTRANS = idle, within transaction block * # PQTRANS_INERROR = idle, within failed transaction */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9is_in_transaction(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9is_in_transaction(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_in_transaction (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_8is_in_transaction(((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_8is_in_transaction(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; __Pyx_RefNannySetupContext("is_in_transaction", 0); /* "asyncpg/protocol/protocol.pyx":137 * # PQTRANS_INTRANS = idle, within transaction block * # PQTRANS_INERROR = idle, within failed transaction * return self.xact_status in (PQTRANS_INTRANS, PQTRANS_INERROR) # <<<<<<<<<<<<<< * * cdef inline resume_reading(self): */ __Pyx_XDECREF(__pyx_r); switch (__pyx_v_self->__pyx_base.xact_status) { case __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INTRANS: case __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INERROR: __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":134 * return self.settings * * def 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_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.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/protocol.pyx":139 * return self.xact_status in (PQTRANS_INTRANS, PQTRANS_INERROR) * * cdef inline resume_reading(self): # <<<<<<<<<<<<<< * if not self.is_reading: * self.is_reading = True */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("resume_reading", 0); /* "asyncpg/protocol/protocol.pyx":140 * * 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 != 0)) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":141 * 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":142 * if not self.is_reading: * self.is_reading = True * self.transport.resume_reading() # <<<<<<<<<<<<<< * * cdef inline pause_reading(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.transport, __pyx_n_s_resume_reading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":140 * * cdef inline resume_reading(self): * if not self.is_reading: # <<<<<<<<<<<<<< * self.is_reading = True * self.transport.resume_reading() */ } /* "asyncpg/protocol/protocol.pyx":139 * return self.xact_status in (PQTRANS_INTRANS, PQTRANS_INERROR) * * cdef inline resume_reading(self): # <<<<<<<<<<<<<< * if not self.is_reading: * self.is_reading = True */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.resume_reading", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":144 * 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 int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("pause_reading", 0); /* "asyncpg/protocol/protocol.pyx":145 * * cdef inline pause_reading(self): * if self.is_reading: # <<<<<<<<<<<<<< * self.is_reading = False * self.transport.pause_reading() */ __pyx_t_1 = (__pyx_v_self->is_reading != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":146 * 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":147 * if self.is_reading: * self.is_reading = False * self.transport.pause_reading() # <<<<<<<<<<<<<< * * async def prepare(self, stmt_name, query, timeout): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.transport, __pyx_n_s_pause_reading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":145 * * cdef inline pause_reading(self): * if self.is_reading: # <<<<<<<<<<<<<< * self.is_reading = False * self.transport.pause_reading() */ } /* "asyncpg/protocol/protocol.pyx":144 * 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_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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":149 * self.transport.pause_reading() * * async def prepare(self, stmt_name, query, timeout): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_stmt_name = 0; PyObject *__pyx_v_query = 0; PyObject *__pyx_v_timeout = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("prepare (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stmt_name,&__pyx_n_s_query,&__pyx_n_s_timeout,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stmt_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("prepare", 1, 3, 3, 1); __PYX_ERR(0, 149, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("prepare", 1, 3, 3, 2); __PYX_ERR(0, 149, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prepare") < 0)) __PYX_ERR(0, 149, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_stmt_name = values[0]; __pyx_v_query = values[1]; __pyx_v_timeout = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("prepare", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 149, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __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); /* function exit code */ __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___pyx_scope_struct__prepare *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("prepare", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 149, __pyx_L1_error) } else { __Pyx_GOTREF(__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_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_12generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_prepare, __pyx_n_s_BaseProtocol_prepare, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 149, __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__prepare *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare *)__pyx_generator->closure); PyObject *__pyx_r = NULL; 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; PyObject *__pyx_t_7 = NULL; 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; 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; __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_L28_resume_from_await; case 4: goto __pyx_L31_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 149, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":150 * * async def prepare(self, stmt_name, 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":151 * async def prepare(self, stmt_name, query, timeout): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 151, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 151, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":150 * * async def prepare(self, stmt_name, 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":152 * 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_2 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":153 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 153, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 153, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":154 * 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":152 * 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":156 * 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, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":157 * * 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, 157, __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":159 * timeout = self._get_timeout_impl(timeout) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._prepare(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, 159, __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":160 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._prepare(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":161 * waiter = self._new_waiter(timeout) * try: * self._prepare(stmt_name, query) # network op # <<<<<<<<<<<<<< * self.last_query = query * self.statement = PreparedStatementState(stmt_name, query, self) */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_stmt_name))||((__pyx_cur_scope->__pyx_v_stmt_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_cur_scope->__pyx_v_stmt_name)->tp_name), 0))) __PYX_ERR(0, 161, __pyx_L11_error) if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_query))||((__pyx_cur_scope->__pyx_v_query) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_cur_scope->__pyx_v_query)->tp_name), 0))) __PYX_ERR(0, 161, __pyx_L11_error) __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._prepare(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_cur_scope->__pyx_v_stmt_name), ((PyObject*)__pyx_cur_scope->__pyx_v_query)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":162 * try: * self._prepare(stmt_name, query) # network op * self.last_query = query # <<<<<<<<<<<<<< * self.statement = PreparedStatementState(stmt_name, query, self) * except Exception as ex: */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_query))||((__pyx_cur_scope->__pyx_v_query) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_cur_scope->__pyx_v_query)->tp_name), 0))) __PYX_ERR(0, 162, __pyx_L11_error) __pyx_t_3 = __pyx_cur_scope->__pyx_v_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":163 * self._prepare(stmt_name, query) # network op * self.last_query = query * self.statement = PreparedStatementState(stmt_name, query, self) # <<<<<<<<<<<<<< * except Exception as ex: * waiter.set_exception(ex) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stmt_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stmt_name); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_stmt_name); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_query); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_query); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_query); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_cur_scope->__pyx_v_self)); __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState), __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_7); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->statement); __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->statement)); __pyx_cur_scope->__pyx_v_self->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":160 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._prepare(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; /* "asyncpg/protocol/protocol.pyx":164 * self.last_query = query * self.statement = PreparedStatementState(stmt_name, query, self) * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(0, 164, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__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":165 * self.statement = PreparedStatementState(stmt_name, query, self) * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_12) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_cur_scope->__pyx_v_ex); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 165, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 165, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 165, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 165, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ex); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_cur_scope->__pyx_v_ex); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 165, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":166 * 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, 166, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":164 * self.last_query = query * self.statement = PreparedStatementState(stmt_name, query, self) * 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 = NULL; goto __pyx_L23; } /*exception exit:*/{ __pyx_L22_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_8 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L13_except_error; } __pyx_L23:; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; __pyx_L13_except_error:; /* "asyncpg/protocol/protocol.pyx":160 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._prepare(stmt_name, query) # network op * self.last_query = query */ __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":168 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def bind_execute(self, PreparedStatementState state, args, */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L28_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 168, __pyx_L1_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L0; } /*exception exit:*/{ __pyx_L9_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __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; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_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_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_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_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_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, 168, __pyx_L30_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 168, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L29_return; } __pyx_L29_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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_L30_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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":149 * self.transport.pause_reading() * * async def prepare(self, stmt_name, 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_7); __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("prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __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":170 * return await waiter * * async def bind_execute(self, PreparedStatementState state, args, # <<<<<<<<<<<<<< * str portal_name, int limit, return_extra, * timeout): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_portal_name = 0; int __pyx_v_limit; PyObject *__pyx_v_return_extra = 0; PyObject *__pyx_v_timeout = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind_execute (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_args,&__pyx_n_s_portal_name,&__pyx_n_s_limit,&__pyx_n_s_return_extra,&__pyx_n_s_timeout,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, 1); __PYX_ERR(0, 170, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_portal_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, 2); __PYX_ERR(0, 170, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, 3); __PYX_ERR(0, 170, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_return_extra)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, 4); __PYX_ERR(0, 170, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, 5); __PYX_ERR(0, 170, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bind_execute") < 0)) __PYX_ERR(0, 170, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_args = values[1]; __pyx_v_portal_name = ((PyObject*)values[2]); __pyx_v_limit = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L3_error) __pyx_v_return_extra = values[4]; __pyx_v_timeout = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 170, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 170, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 171, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13bind_execute(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_args, __pyx_v_portal_name, __pyx_v_limit, __pyx_v_return_extra, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __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, int __pyx_v_limit, PyObject *__pyx_v_return_extra, PyObject *__pyx_v_timeout) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind_execute", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 170, __pyx_L1_error) } else { __Pyx_GOTREF(__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_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_15generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_bind_execute, __pyx_n_s_BaseProtocol_bind_execute, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 170, __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_1_bind_execute *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute *)__pyx_generator->closure); PyObject *__pyx_r = NULL; 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; PyObject *__pyx_t_7 = NULL; 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; 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; __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_L28_resume_from_await; case 4: goto __pyx_L31_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 170, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":174 * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":175 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 175, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 175, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":174 * timeout): * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":176 * 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_2 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":177 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 177, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 177, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":178 * 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":176 * 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":180 * 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, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":181 * * 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, 181, __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":182 * 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); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __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":184 * args_buf = state._encode_bind_msg(args) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._bind_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, 184, __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":185 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind_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":188 * self._bind_execute( * portal_name, * state.name, # <<<<<<<<<<<<<< * args_buf, * limit) # network op */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_3); /* "asyncpg/protocol/protocol.pyx":189 * portal_name, * state.name, * args_buf, # <<<<<<<<<<<<<< * limit) # network op * */ if (!(likely(((__pyx_cur_scope->__pyx_v_args_buf) == Py_None) || likely(__Pyx_TypeTest(__pyx_cur_scope->__pyx_v_args_buf, __pyx_ptype_7asyncpg_8protocol_8protocol_WriteBuffer))))) __PYX_ERR(0, 189, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":186 * waiter = self._new_waiter(timeout) * try: * 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_3), ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_cur_scope->__pyx_v_args_buf), __pyx_cur_scope->__pyx_v_limit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __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":192 * 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":193 * * 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(__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":194 * 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, 194, __pyx_L11_error) __pyx_cur_scope->__pyx_v_self->return_extra = __pyx_t_1; /* "asyncpg/protocol/protocol.pyx":195 * 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":185 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind_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; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":196 * self.return_extra = return_extra * self.queries_count += 1 * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(0, 196, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__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":197 * self.queries_count += 1 * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 197, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_12) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_cur_scope->__pyx_v_ex); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 197, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 197, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 197, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 197, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ex); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_cur_scope->__pyx_v_ex); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 197, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":198 * 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, 198, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":196 * 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 = NULL; goto __pyx_L23; } /*exception exit:*/{ __pyx_L22_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_8 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L13_except_error; } __pyx_L23:; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; __pyx_L13_except_error:; /* "asyncpg/protocol/protocol.pyx":185 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind_execute( * portal_name, */ __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":200 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def bind_execute_many(self, PreparedStatementState state, args, */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L28_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 200, __pyx_L1_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L0; } /*exception exit:*/{ __pyx_L9_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __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; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_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_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_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_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_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, 200, __pyx_L30_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 200, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L29_return; } __pyx_L29_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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_L30_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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":170 * return await waiter * * async def bind_execute(self, PreparedStatementState state, args, # <<<<<<<<<<<<<< * str portal_name, int limit, return_extra, * 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); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __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":202 * return await waiter * * async def bind_execute_many(self, PreparedStatementState state, args, # <<<<<<<<<<<<<< * str portal_name, timeout): * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_portal_name = 0; PyObject *__pyx_v_timeout = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind_execute_many (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_args,&__pyx_n_s_portal_name,&__pyx_n_s_timeout,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 4, 4, 1); __PYX_ERR(0, 202, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_portal_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 4, 4, 2); __PYX_ERR(0, 202, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 4, 4, 3); __PYX_ERR(0, 202, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bind_execute_many") < 0)) __PYX_ERR(0, 202, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_args = values[1]; __pyx_v_portal_name = ((PyObject*)values[2]); __pyx_v_timeout = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 202, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 202, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 203, __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); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":217 * # this generator expression to keep the memory pressure under * # control. * data_gen = (state._encode_bind_msg(b) for b in args) # <<<<<<<<<<<<<< * arg_bufs = iter(data_gen) * */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_genexpr(PyObject *__pyx_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 217, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator10, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_bind_execute_many_locals_genexpr, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 217, __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_2generator10(__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; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 217, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); __PYX_ERR(0, 217, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_args; __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_outer_scope->__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 217, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 217, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 217, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_b); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_b, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_state)) { __Pyx_RaiseClosureNameError("state"); __PYX_ERR(0, 217, __pyx_L1_error) } __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_state, __pyx_cur_scope->__pyx_v_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __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_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_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 217, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":202 * return await waiter * * async def bind_execute_many(self, PreparedStatementState state, args, # <<<<<<<<<<<<<< * str portal_name, timeout): * */ 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) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind_execute_many", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 202, __pyx_L1_error) } else { __Pyx_GOTREF(__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_18generator2, (PyObject *) __pyx_cur_scope, __pyx_n_s_bind_execute_many, __pyx_n_s_BaseProtocol_bind_execute_many, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 202, __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_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_2_bind_execute_many *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *)__pyx_generator->closure); PyObject *__pyx_r = NULL; 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; PyObject *__pyx_t_7 = NULL; 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; 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; __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_L28_resume_from_await; case 4: goto __pyx_L31_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 202, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":205 * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":206 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 206, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 206, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":205 * 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":207 * 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_2 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":208 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 208, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 208, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":209 * 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":207 * 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":211 * 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, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":212 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * * # Make sure the argument sequence is encoded lazily with */ __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, 212, __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":217 * # this generator expression to keep the memory pressure under * # control. * data_gen = (state._encode_bind_msg(b) for b in args) # <<<<<<<<<<<<<< * arg_bufs = iter(data_gen) * */ __pyx_t_3 = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __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":218 * # control. * data_gen = (state._encode_bind_msg(b) for b in 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, 218, __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":220 * arg_bufs = iter(data_gen) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._bind_execute_many( */ __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, 220, __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":221 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind_execute_many( * 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":224 * self._bind_execute_many( * portal_name, * state.name, # <<<<<<<<<<<<<< * arg_bufs) # network op * */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_3); /* "asyncpg/protocol/protocol.pyx":222 * waiter = self._new_waiter(timeout) * try: * self._bind_execute_many( # <<<<<<<<<<<<<< * 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_many(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, ((PyObject*)__pyx_t_3), __pyx_cur_scope->__pyx_v_arg_bufs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 222, __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":227 * arg_bufs) # network op * * self.last_query = state.query # <<<<<<<<<<<<<< * self.statement = state * self.return_extra = False */ __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":228 * * 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(__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":229 * self.last_query = state.query * self.statement = state * self.return_extra = False # <<<<<<<<<<<<<< * self.queries_count += 1 * except Exception as ex: */ __pyx_cur_scope->__pyx_v_self->return_extra = 0; /* "asyncpg/protocol/protocol.pyx":230 * self.statement = state * self.return_extra = False * 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":221 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind_execute_many( * 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":231 * self.return_extra = False * self.queries_count += 1 * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(0, 231, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__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":232 * self.queries_count += 1 * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 232, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_12) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_cur_scope->__pyx_v_ex); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 232, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 232, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 232, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 232, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ex); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_cur_scope->__pyx_v_ex); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 232, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":233 * 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, 233, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":231 * self.return_extra = False * 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 = NULL; goto __pyx_L23; } /*exception exit:*/{ __pyx_L22_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_8 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L13_except_error; } __pyx_L23:; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; __pyx_L13_except_error:; /* "asyncpg/protocol/protocol.pyx":221 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind_execute_many( * portal_name, */ __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":235 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def bind(self, PreparedStatementState state, args, */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L28_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 235, __pyx_L1_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L0; } /*exception exit:*/{ __pyx_L9_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __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; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_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_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_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_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_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, 235, __pyx_L30_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 235, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L29_return; } __pyx_L29_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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_L30_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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":202 * return await waiter * * async def bind_execute_many(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); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __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":237 * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_portal_name = 0; PyObject *__pyx_v_timeout = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_args,&__pyx_n_s_portal_name,&__pyx_n_s_timeout,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, 1); __PYX_ERR(0, 237, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_portal_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, 2); __PYX_ERR(0, 237, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, 3); __PYX_ERR(0, 237, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bind") < 0)) __PYX_ERR(0, 237, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_args = values[1]; __pyx_v_portal_name = ((PyObject*)values[2]); __pyx_v_timeout = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 237, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 237, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_19bind(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_args, __pyx_v_portal_name, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __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_4_bind *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 237, __pyx_L1_error) } else { __Pyx_GOTREF(__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_cur_scope, __pyx_n_s_bind, __pyx_n_s_BaseProtocol_bind, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 237, __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_4_bind *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind *)__pyx_generator->closure); PyObject *__pyx_r = NULL; 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; PyObject *__pyx_t_7 = NULL; 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; 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; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L28_resume_from_await; case 4: goto __pyx_L31_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 237, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":240 * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":241 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 241, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 241, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":240 * 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":242 * 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_2 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":243 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 243, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 243, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":244 * 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":242 * 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":246 * 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, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":247 * * 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, 247, __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":248 * 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); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __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":250 * 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, 250, __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":251 * * 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":254 * 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":255 * portal_name, * state.name, * args_buf) # network op # <<<<<<<<<<<<<< * * self.last_query = state.query */ if (!(likely(((__pyx_cur_scope->__pyx_v_args_buf) == Py_None) || likely(__Pyx_TypeTest(__pyx_cur_scope->__pyx_v_args_buf, __pyx_ptype_7asyncpg_8protocol_8protocol_WriteBuffer))))) __PYX_ERR(0, 255, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":252 * 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_8protocol_8protocol_WriteBuffer *)__pyx_cur_scope->__pyx_v_args_buf)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __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":257 * 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":258 * * 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(__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":251 * * 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":259 * 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)[0]))); 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, 259, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__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":260 * self.statement = state * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_12) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_cur_scope->__pyx_v_ex); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 260, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 260, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 260, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 260, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ex); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_cur_scope->__pyx_v_ex); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 260, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":261 * 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, 261, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":259 * 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 = NULL; goto __pyx_L23; } /*exception exit:*/{ __pyx_L22_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_8 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L13_except_error; } __pyx_L23:; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; __pyx_L13_except_error:; /* "asyncpg/protocol/protocol.pyx":251 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind( * portal_name, */ __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":263 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def execute(self, PreparedStatementState state, */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L28_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 263, __pyx_L1_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L0; } /*exception exit:*/{ __pyx_L9_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __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; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_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_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_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_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_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, 263, __pyx_L30_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 263, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L29_return; } __pyx_L29_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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_L30_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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":237 * 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); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("bind", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __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":265 * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { 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; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("execute (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_portal_name,&__pyx_n_s_limit,&__pyx_n_s_return_extra,&__pyx_n_s_timeout,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_portal_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, 1); __PYX_ERR(0, 265, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, 2); __PYX_ERR(0, 265, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_return_extra)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, 3); __PYX_ERR(0, 265, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, 4); __PYX_ERR(0, 265, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(0, 265, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_portal_name = ((PyObject*)values[1]); __pyx_v_limit = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L3_error) __pyx_v_return_extra = values[3]; __pyx_v_timeout = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 265, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 265, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 266, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_22execute(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_portal_name, __pyx_v_limit, __pyx_v_return_extra, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __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_5_execute *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("execute", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 265, __pyx_L1_error) } else { __Pyx_GOTREF(__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_cur_scope, __pyx_n_s_execute, __pyx_n_s_BaseProtocol_execute, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 265, __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_5_execute *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute *)__pyx_generator->closure); PyObject *__pyx_r = NULL; 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; 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; 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; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("execute", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L28_resume_from_await; case 4: goto __pyx_L31_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 265, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":269 * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":270 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 270, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 270, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":269 * timeout): * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":271 * 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_2 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":272 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 272, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 272, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":273 * 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":271 * 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":275 * 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, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":276 * * 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, 276, __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":278 * 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, 278, __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":279 * * 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":280 * 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, 280, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":284 * 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":285 * * 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(__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":286 * 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, 286, __pyx_L11_error) __pyx_cur_scope->__pyx_v_self->return_extra = __pyx_t_1; /* "asyncpg/protocol/protocol.pyx":287 * 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":279 * * 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":288 * 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)[0]))); 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, 288, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__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":289 * self.queries_count += 1 * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 289, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_12) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_cur_scope->__pyx_v_ex); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 289, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 289, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 289, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 289, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ex); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_cur_scope->__pyx_v_ex); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 289, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":290 * 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, 290, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":288 * 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 = NULL; goto __pyx_L23; } /*exception exit:*/{ __pyx_L22_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_7 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L13_except_error; } __pyx_L23:; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; __pyx_L13_except_error:; /* "asyncpg/protocol/protocol.pyx":279 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._execute( * portal_name, */ __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":292 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def query(self, query, timeout): */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L28_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 292, __pyx_L1_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L0; } /*exception exit:*/{ __pyx_L9_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 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; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_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_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_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_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_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, 292, __pyx_L30_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 292, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L29_return; } __pyx_L29_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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_L30_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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":265 * 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); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __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":294 * 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_26query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_query = 0; PyObject *__pyx_v_timeout = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("query (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,&__pyx_n_s_timeout,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("query", 1, 2, 2, 1); __PYX_ERR(0, 294, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "query") < 0)) __PYX_ERR(0, 294, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_query = values[0]; __pyx_v_timeout = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("query", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 294, __pyx_L3_error) __pyx_L3_error:; __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_25query(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_query, __pyx_v_timeout); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_25query(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_6_query *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("query", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 294, __pyx_L1_error) } else { __Pyx_GOTREF(__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_27generator5, (PyObject *) __pyx_cur_scope, __pyx_n_s_query, __pyx_n_s_BaseProtocol_query, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 294, __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_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_6_query *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query *)__pyx_generator->closure); PyObject *__pyx_r = NULL; 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; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; 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; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("query", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L28_resume_from_await; case 4: goto __pyx_L31_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 294, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":295 * * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":296 * async def query(self, query, timeout): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 296, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 296, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":295 * * 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":297 * 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_2 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":298 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 298, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 298, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":299 * 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":297 * 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":301 * 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, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":305 * # 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_get_timeout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_cur_scope->__pyx_v_timeout); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __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":307 * 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, 307, __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":308 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._simple_query(query) # network op * self.last_query = 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":309 * waiter = self._new_waiter(timeout) * try: * self._simple_query(query) # network op # <<<<<<<<<<<<<< * self.last_query = query * self.queries_count += 1 */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_query))||((__pyx_cur_scope->__pyx_v_query) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_cur_scope->__pyx_v_query)->tp_name), 0))) __PYX_ERR(0, 309, __pyx_L11_error) __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._simple_query(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_cur_scope->__pyx_v_query)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":310 * try: * self._simple_query(query) # network op * self.last_query = query # <<<<<<<<<<<<<< * self.queries_count += 1 * except Exception as ex: */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_query))||((__pyx_cur_scope->__pyx_v_query) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_cur_scope->__pyx_v_query)->tp_name), 0))) __PYX_ERR(0, 310, __pyx_L11_error) __pyx_t_3 = __pyx_cur_scope->__pyx_v_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":311 * 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":308 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._simple_query(query) # network op * self.last_query = 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_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":312 * self.last_query = query * 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)[0]))); if (__pyx_t_10) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.query", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(0, 312, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_ex = __pyx_t_4; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":313 * self.queries_count += 1 * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 313, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_12) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_cur_scope->__pyx_v_ex); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L22_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 313, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ex); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_cur_scope->__pyx_v_ex); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":314 * 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, 314, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "asyncpg/protocol/protocol.pyx":312 * 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 = NULL; goto __pyx_L23; } /*exception exit:*/{ __pyx_L22_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_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 = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L13_except_error; } __pyx_L23:; } __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; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; __pyx_L13_except_error:; /* "asyncpg/protocol/protocol.pyx":308 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._simple_query(query) # network op * self.last_query = query */ __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":316 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * async def copy_out(self, copy_stmt, sink, timeout): */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L28_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 316, __pyx_L1_error) __pyx_t_6 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_6); } else { __pyx_t_6 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_6) < 0) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = 0; goto __pyx_L0; } /*exception exit:*/{ __pyx_L9_error:; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_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_21); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); { __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_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_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_L31_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_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, 316, __pyx_L30_error) __pyx_t_6 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_6); } else { __pyx_t_6 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_6) < 0) __PYX_ERR(0, 316, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = 0; goto __pyx_L29_return; } __pyx_L29_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; goto __pyx_L0; __pyx_L30_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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_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":294 * 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_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("query", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __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":318 * 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_29copy_out(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29copy_out(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_copy_stmt = 0; PyObject *__pyx_v_sink = 0; PyObject *__pyx_v_timeout = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_out (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy_stmt,&__pyx_n_s_sink,&__pyx_n_s_timeout,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_copy_stmt)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sink)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy_out", 1, 3, 3, 1); __PYX_ERR(0, 318, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy_out", 1, 3, 3, 2); __PYX_ERR(0, 318, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_out") < 0)) __PYX_ERR(0, 318, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_copy_stmt = values[0]; __pyx_v_sink = values[1]; __pyx_v_timeout = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy_out", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 318, __pyx_L3_error) __pyx_L3_error:; __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_28copy_out(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_copy_stmt, __pyx_v_sink, __pyx_v_timeout); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_28copy_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_7_copy_out *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_out", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 318, __pyx_L1_error) } else { __Pyx_GOTREF(__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_30generator6, (PyObject *) __pyx_cur_scope, __pyx_n_s_copy_out, __pyx_n_s_BaseProtocol_copy_out, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 318, __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_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_7_copy_out *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out *)__pyx_generator->closure); PyObject *__pyx_r = NULL; 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; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *(*__pyx_t_12)(PyObject *); PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_t_18; int __pyx_t_19; char const *__pyx_t_20; PyObject *__pyx_t_21 = NULL; char const *__pyx_t_22; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_out", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L27_resume_from_await; case 4: goto __pyx_L57_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 318, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":319 * * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":320 * async def copy_out(self, copy_stmt, sink, timeout): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 320, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 320, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":319 * * 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":321 * 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_2 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":322 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 322, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 322, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":323 * 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":321 * 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":325 * 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, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":327 * 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, 327, __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":328 * * timeout = self._get_timeout_impl(timeout) * timer = Timer(timeout) # <<<<<<<<<<<<<< * * # The copy operation is guarded by a single timeout */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_cur_scope->__pyx_v_timeout); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_timer = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":332 * # 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":334 * waiter = self._new_waiter(timer.get_remaining_budget()) * * self._copy_out(copy_stmt) # <<<<<<<<<<<<<< * * try: */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_copy_stmt))||((__pyx_cur_scope->__pyx_v_copy_stmt) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_cur_scope->__pyx_v_copy_stmt)->tp_name), 0))) __PYX_ERR(0, 334, __pyx_L1_error) __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._copy_out(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_cur_scope->__pyx_v_copy_stmt)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":336 * self._copy_out(copy_stmt) * * try: # <<<<<<<<<<<<<< * while True: * self.resume_reading() */ /*try:*/ { /* "asyncpg/protocol/protocol.pyx":337 * * try: * while True: # <<<<<<<<<<<<<< * self.resume_reading() * */ while (1) { /* "asyncpg/protocol/protocol.pyx":338 * try: * while True: * self.resume_reading() # <<<<<<<<<<<<<< * * with timer: */ __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, 338, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":340 * 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_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L13_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L13_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_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":341 * * with timer: * buffer, done, status_msg = await waiter # <<<<<<<<<<<<<< * * # buffer will be empty if CopyDone was received apart from */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_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, 341, __pyx_L19_error) __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_4 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_4) < 0) __PYX_ERR(0, 341, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 341, __pyx_L19_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 341, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L28_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_6 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_6)) goto __pyx_L28_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 2; __pyx_t_5 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_5)) goto __pyx_L28_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(0, 341, __pyx_L19_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L29_unpacking_done; __pyx_L28_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 341, __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_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_done); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_done, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_status_msg); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_status_msg, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":340 * 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_3); __pyx_t_3 = 0; __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; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 340, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 340, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_1 < 0) __PYX_ERR(0, 340, __pyx_L21_except_error) __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __PYX_ERR(0, 340, __pyx_L21_except_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; 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_tuple__94, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 340, __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":345 * # 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, 345, __pyx_L9_error) } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_buffer); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 345, __pyx_L9_error) if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":346 * # the last CopyData message. * if buffer: * try: # <<<<<<<<<<<<<< * with timer: * await asyncio.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":347 * if buffer: * try: * with timer: # <<<<<<<<<<<<<< * await asyncio.wait_for( * sink(buffer), */ /*with:*/ { __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 347, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L43_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_4) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L43_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L43_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":348 * try: * with timer: * await asyncio.wait_for( # <<<<<<<<<<<<<< * sink(buffer), * timeout=timer.get_remaining_budget(), */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_asyncio); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_wait_for); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":349 * with timer: * await asyncio.wait_for( * sink(buffer), # <<<<<<<<<<<<<< * timeout=timer.get_remaining_budget(), * loop=self.loop) */ if (unlikely(!__pyx_cur_scope->__pyx_v_buffer)) { __Pyx_RaiseUnboundLocalError("buffer"); __PYX_ERR(0, 349, __pyx_L49_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sink); __pyx_t_4 = __pyx_cur_scope->__pyx_v_sink; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_buffer}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L49_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_buffer}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L49_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 349, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_buffer); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_buffer); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_cur_scope->__pyx_v_buffer); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":348 * try: * with timer: * await asyncio.wait_for( # <<<<<<<<<<<<<< * sink(buffer), * timeout=timer.get_remaining_budget(), */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":350 * await asyncio.wait_for( * sink(buffer), * timeout=timer.get_remaining_budget(), # <<<<<<<<<<<<<< * loop=self.loop) * except Exception as ex: */ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_16) { __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 350, __pyx_L49_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else { __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 350, __pyx_L49_error) } __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_timeout, __pyx_t_11) < 0) __PYX_ERR(0, 350, __pyx_L49_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":351 * sink(buffer), * timeout=timer.get_remaining_budget(), * loop=self.loop) # <<<<<<<<<<<<<< * except Exception as ex: * # Abort the COPY operation on any error in */ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_loop, __pyx_cur_scope->__pyx_v_self->loop) < 0) __PYX_ERR(0, 350, __pyx_L49_error) /* "asyncpg/protocol/protocol.pyx":348 * try: * with timer: * await asyncio.wait_for( # <<<<<<<<<<<<<< * sink(buffer), * timeout=timer.get_remaining_budget(), */ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 348, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__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_13); __pyx_cur_scope->__pyx_t_4 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_t_14); __pyx_cur_scope->__pyx_t_5 = __pyx_t_14; __Pyx_XGIVEREF(__pyx_t_15); __pyx_cur_scope->__pyx_t_6 = __pyx_t_15; __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_13 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_13); __pyx_t_14 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_14); __pyx_t_15 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 348, __pyx_L49_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 348, __pyx_L49_error) } } /* "asyncpg/protocol/protocol.pyx":347 * if buffer: * try: * with timer: # <<<<<<<<<<<<<< * await asyncio.wait_for( * sink(buffer), */ } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L56_try_end; __pyx_L49_error:; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 347, __pyx_L51_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_11, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L51_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 347, __pyx_L51_except_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_17); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_2 < 0) __PYX_ERR(0, 347, __pyx_L51_except_error) __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_11, __pyx_t_6, __pyx_t_4); __pyx_t_11 = 0; __pyx_t_6 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 347, __pyx_L51_except_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L50_exception_handled; } __pyx_L51_except_error:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L35_error; __pyx_L50_exception_handled:; __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_L56_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_8) { __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__95, NULL); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 347, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 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":346 * # the last CopyData message. * if buffer: * try: # <<<<<<<<<<<<<< * with timer: * await asyncio.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_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":352 * timeout=timer.get_remaining_budget(), * loop=self.loop) * except Exception as ex: # <<<<<<<<<<<<<< * # Abort the COPY operation on any error in * # output sink. */ __pyx_t_18 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_18) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_11) < 0) __PYX_ERR(0, 352, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_v_ex = __pyx_t_6; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":355 * # Abort the COPY operation on any error in * # output sink. * self._request_cancel() # <<<<<<<<<<<<<< * raise * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_request_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_16) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L67_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L67_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":356 * # output sink. * self._request_cancel() * raise # <<<<<<<<<<<<<< * * # done will be True upon receipt of CopyDone. */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_11); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_11 = 0; __PYX_ERR(0, 356, __pyx_L67_error) } /* "asyncpg/protocol/protocol.pyx":352 * timeout=timer.get_remaining_budget(), * loop=self.loop) * except Exception as ex: # <<<<<<<<<<<<<< * # Abort the COPY operation on any error in * # output sink. */ /*finally:*/ { /*exception exit:*/{ __pyx_L67_error:; __pyx_t_8 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_17 = 0; __pyx_t_21 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_17, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_15, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_15, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_18 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_17, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_15, __pyx_t_14); __pyx_t_8 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_17 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_18; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; goto __pyx_L37_except_error; } } } goto __pyx_L37_except_error; __pyx_L37_except_error:; /* "asyncpg/protocol/protocol.pyx":346 * # the last CopyData message. * if buffer: * try: # <<<<<<<<<<<<<< * with timer: * await asyncio.wait_for( */ __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":345 * # buffer will be empty if CopyDone was received apart from * # the last CopyData message. * if buffer: # <<<<<<<<<<<<<< * try: * with timer: */ } /* "asyncpg/protocol/protocol.pyx":359 * * # 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, 359, __pyx_L9_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_done); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 359, __pyx_L9_error) if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":360 * # 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":359 * * # done will be True upon receipt of CopyDone. * if done: # <<<<<<<<<<<<<< * break * */ } /* "asyncpg/protocol/protocol.pyx":362 * break * * waiter = self._new_waiter(timer.get_remaining_budget()) # <<<<<<<<<<<<<< * * finally: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_4) { __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 362, __pyx_L9_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 362, __pyx_L9_error) } __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = ((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_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_waiter); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_waiter, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L12_break:; } /* "asyncpg/protocol/protocol.pyx":365 * * finally: * self.resume_reading() # <<<<<<<<<<<<<< * * return status_msg */ /*finally:*/ { /*normal exit:*/{ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L10; } /*exception exit:*/{ __pyx_L9_error:; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_7 = 0; __pyx_t_21 = 0; __pyx_t_17 = 0; __pyx_t_13 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_17, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || 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_21); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_19 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_22 = __pyx_filename; { __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L75_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_17, __pyx_t_13); } __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_21 = 0; __pyx_t_17 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_22; goto __pyx_L1_error; __pyx_L75_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_17, __pyx_t_13); } __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_21 = 0; __pyx_t_17 = 0; __pyx_t_13 = 0; goto __pyx_L1_error; } __pyx_L10:; } /* "asyncpg/protocol/protocol.pyx":367 * 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, 367, __pyx_L1_error) } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_status_msg); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":318 * 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_6); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __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":369 * 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_32copy_in(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_in(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { 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; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_in (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy_stmt,&__pyx_n_s_reader,&__pyx_n_s_data,&__pyx_n_s_records,&__pyx_n_s_record_stmt,&__pyx_n_s_timeout,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_copy_stmt)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reader)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, 1); __PYX_ERR(0, 369, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, 2); __PYX_ERR(0, 369, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_records)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, 3); __PYX_ERR(0, 369, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_record_stmt)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, 4); __PYX_ERR(0, 369, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, 5); __PYX_ERR(0, 369, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_in") < 0)) __PYX_ERR(0, 369, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_copy_stmt = values[0]; __pyx_v_reader = values[1]; __pyx_v_data = values[2]; __pyx_v_records = values[3]; __pyx_v_record_stmt = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[4]); __pyx_v_timeout = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 369, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_record_stmt), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "record_stmt", 0))) __PYX_ERR(0, 370, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_31copy_in(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_copy_stmt, __pyx_v_reader, __pyx_v_data, __pyx_v_records, __pyx_v_record_stmt, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_31copy_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_8_copy_in *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_in", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 369, __pyx_L1_error) } else { __Pyx_GOTREF(__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_33generator7, (PyObject *) __pyx_cur_scope, __pyx_n_s_copy_in, __pyx_n_s_BaseProtocol_copy_in, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 369, __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_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_8_copy_in *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in *)__pyx_generator->closure); PyObject *__pyx_r = NULL; 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; 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; 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)(PyObject *); 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 = NULL; PyObject *__pyx_t_27 = NULL; PyObject *__pyx_t_28 = NULL; int __pyx_t_29; char const *__pyx_t_30; __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_L40_resume_from_await; case 4: goto __pyx_L75_resume_from_await; case 5: goto __pyx_L94_resume_from_await; case 6: goto __pyx_L99_resume_from_await; case 7: goto __pyx_L110_resume_from_await; case 8: goto __pyx_L124_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 369, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":376 * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":377 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 377, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 377, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":376 * 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":378 * 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_2 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":379 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 379, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 379, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":380 * 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":378 * 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":382 * 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, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":384 * 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, 384, __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":385 * * timeout = self._get_timeout_impl(timeout) * timer = Timer(timeout) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timer.get_remaining_budget()) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Timer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_cur_scope->__pyx_v_timeout); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_timer = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":387 * timer = Timer(timeout) * * waiter = self._new_waiter(timer.get_remaining_budget()) # <<<<<<<<<<<<<< * * # Initiate COPY IN. */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":390 * * # Initiate COPY IN. * self._copy_in(copy_stmt) # <<<<<<<<<<<<<< * * try: */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_copy_stmt))||((__pyx_cur_scope->__pyx_v_copy_stmt) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_cur_scope->__pyx_v_copy_stmt)->tp_name), 0))) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._copy_in(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_cur_scope->__pyx_v_copy_stmt)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":392 * 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":393 * * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":395 * if record_stmt is not None: * # copy_in_records in binary mode * wbuf = WriteBuffer.new() # <<<<<<<<<<<<<< * # Signature * wbuf.write_bytes(_COPY_SIGNATURE) */ __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_wbuf = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":397 * wbuf = WriteBuffer.new() * # Signature * wbuf.write_bytes(_COPY_SIGNATURE) # <<<<<<<<<<<<<< * # Flags field * wbuf.write_int32(0) */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytes(__pyx_cur_scope->__pyx_v_wbuf, __pyx_kp_b_PGCOPY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":399 * wbuf.write_bytes(_COPY_SIGNATURE) * # Flags field * wbuf.write_int32(0) # <<<<<<<<<<<<<< * # No header extension * wbuf.write_int32(0) */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_cur_scope->__pyx_v_wbuf, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":401 * wbuf.write_int32(0) * # No header extension * wbuf.write_int32(0) # <<<<<<<<<<<<<< * * record_stmt._ensure_rows_decoder() */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_cur_scope->__pyx_v_wbuf, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":403 * wbuf.write_int32(0) * * record_stmt._ensure_rows_decoder() # <<<<<<<<<<<<<< * codecs = record_stmt.rows_codecs * num_cols = len(codecs) */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(__pyx_cur_scope->__pyx_v_record_stmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":404 * * record_stmt._ensure_rows_decoder() * codecs = record_stmt.rows_codecs # <<<<<<<<<<<<<< * num_cols = len(codecs) * settings = self.settings */ __pyx_t_4 = __pyx_cur_scope->__pyx_v_record_stmt->rows_codecs; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_codecs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":405 * 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, 405, __pyx_L8_error) } __pyx_t_10 = PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_codecs); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 405, __pyx_L8_error) __pyx_cur_scope->__pyx_v_num_cols = __pyx_t_10; /* "asyncpg/protocol/protocol.pyx":406 * codecs = record_stmt.rows_codecs * num_cols = len(codecs) * settings = self.settings # <<<<<<<<<<<<<< * * for codec in codecs: */ __pyx_t_4 = ((PyObject *)__pyx_cur_scope->__pyx_v_self->settings); __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":408 * 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, 408, __pyx_L8_error) } __pyx_t_4 = __pyx_cur_scope->__pyx_v_codecs; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0; for (;;) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 408, __pyx_L8_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(0, 408, __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_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":409 * * for codec in codecs: * if (not codec.has_encoder() or # <<<<<<<<<<<<<< * codec.format != PG_FORMAT_BINARY): * raise apg_exc.InternalClientError( */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_cur_scope->__pyx_v_codec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 409, __pyx_L8_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = ((!__pyx_t_1) != 0); if (!__pyx_t_11) { } else { __pyx_t_2 = __pyx_t_11; goto __pyx_L18_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":410 * for codec in codecs: * if (not codec.has_encoder() or * codec.format != PG_FORMAT_BINARY): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'no binary format encoder for ' */ __pyx_t_11 = ((__pyx_cur_scope->__pyx_v_codec->format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY) != 0); __pyx_t_2 = __pyx_t_11; __pyx_L18_bool_binop_done:; /* "asyncpg/protocol/protocol.pyx":409 * * for codec in codecs: * if (not codec.has_encoder() or # <<<<<<<<<<<<<< * codec.format != PG_FORMAT_BINARY): * raise apg_exc.InternalClientError( */ if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":411 * 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 411, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":413 * raise apg_exc.InternalClientError( * 'no binary format encoder for ' * 'type {} (OID {})'.format(codec.name, codec.oid)) # <<<<<<<<<<<<<< * * for row in records: */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_no_binary_format_encoder_for_typ, __pyx_n_s_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 413, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyInt_From_uint32_t(__pyx_cur_scope->__pyx_v_codec->oid); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 413, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_15 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_15 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_cur_scope->__pyx_v_codec->name, __pyx_t_13}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_cur_scope->__pyx_v_codec->name, __pyx_t_13}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 413, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_14) { __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL; } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_codec->name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_codec->name); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_15, __pyx_cur_scope->__pyx_v_codec->name); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_15, __pyx_t_13); __pyx_t_13 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_12) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L8_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_6}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_6}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L8_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 411, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 411, __pyx_L8_error) /* "asyncpg/protocol/protocol.pyx":409 * * for codec in codecs: * if (not codec.has_encoder() or # <<<<<<<<<<<<<< * codec.format != PG_FORMAT_BINARY): * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/protocol.pyx":408 * settings = self.settings * * for codec in codecs: # <<<<<<<<<<<<<< * if (not codec.has_encoder() or * codec.format != PG_FORMAT_BINARY): */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":415 * 'type {} (OID {})'.format(codec.name, codec.oid)) * * for row in records: # <<<<<<<<<<<<<< * # Tuple header * wbuf.write_int16(num_cols) */ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_records)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_records)) { __pyx_t_4 = __pyx_cur_scope->__pyx_v_records; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0; __pyx_t_17 = NULL; } else { __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_records); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 415, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_17)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 415, __pyx_L8_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 415, __pyx_L8_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_17(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 415, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":417 * for row in records: * # Tuple header * wbuf.write_int16(num_cols) # <<<<<<<<<<<<<< * # Tuple data * for i in range(num_cols): */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_cur_scope->__pyx_v_wbuf, ((int16_t)__pyx_cur_scope->__pyx_v_num_cols)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":419 * wbuf.write_int16(num_cols) * # Tuple data * for i in range(num_cols): # <<<<<<<<<<<<<< * item = row[i] * if item is None: */ __pyx_t_18 = __pyx_cur_scope->__pyx_v_num_cols; 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":420 * # Tuple data * for i in range(num_cols): * item = row[i] # <<<<<<<<<<<<<< * if item is None: * wbuf.write_int32(-1) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":421 * for i in range(num_cols): * item = row[i] * if item is None: # <<<<<<<<<<<<<< * wbuf.write_int32(-1) * else: */ __pyx_t_2 = (__pyx_cur_scope->__pyx_v_item == Py_None); __pyx_t_11 = (__pyx_t_2 != 0); if (__pyx_t_11) { /* "asyncpg/protocol/protocol.pyx":422 * item = row[i] * if item is None: * wbuf.write_int32(-1) # <<<<<<<<<<<<<< * else: * codec = cpython.PyTuple_GET_ITEM(codecs, i) */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32(__pyx_cur_scope->__pyx_v_wbuf, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":421 * for i in range(num_cols): * item = row[i] * if item is None: # <<<<<<<<<<<<<< * wbuf.write_int32(-1) * else: */ goto __pyx_L24; } /* "asyncpg/protocol/protocol.pyx":424 * wbuf.write_int32(-1) * else: * codec = cpython.PyTuple_GET_ITEM(codecs, i) # <<<<<<<<<<<<<< * codec.encode(settings, wbuf, item) * */ /*else*/ { __pyx_t_20 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_codecs, __pyx_cur_scope->__pyx_v_i); __pyx_t_3 = ((PyObject *)__pyx_t_20); __Pyx_INCREF(__pyx_t_3); __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_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":425 * else: * codec = cpython.PyTuple_GET_ITEM(codecs, i) * codec.encode(settings, wbuf, item) # <<<<<<<<<<<<<< * * if wbuf.len() >= _COPY_BUFFER_SIZE: */ __pyx_t_3 = __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_3)) __PYX_ERR(0, 425, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L24:; } /* "asyncpg/protocol/protocol.pyx":427 * codec.encode(settings, wbuf, item) * * if wbuf.len() >= _COPY_BUFFER_SIZE: # <<<<<<<<<<<<<< * with timer: * await self.writing_allowed.wait() */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_len(__pyx_cur_scope->__pyx_v_wbuf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_524288, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L8_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 427, __pyx_L8_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_11) { /* "asyncpg/protocol/protocol.pyx":428 * * 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_n_s_exit); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 428, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_16) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L26_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L26_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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":429 * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: * await self.writing_allowed.wait() # <<<<<<<<<<<<<< * self._write_copy_data_msg(wbuf) * wbuf = WriteBuffer.new() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_wait); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 429, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } if (__pyx_t_3) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L32_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L32_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_0 = __pyx_t_4; __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_4 = __pyx_t_10; __pyx_cur_scope->__pyx_t_5 = __pyx_t_17; __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_8 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_9 = __pyx_t_24; __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_L40_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_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_4; __pyx_t_17 = __pyx_cur_scope->__pyx_t_5; __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_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_24); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 429, __pyx_L32_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 429, __pyx_L32_error) } } /* "asyncpg/protocol/protocol.pyx":428 * * 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_L39_try_end; __pyx_L32_error:; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 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_16, &__pyx_t_3) < 0) __PYX_ERR(0, 428, __pyx_L34_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_16); __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L34_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_6, NULL); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 428, __pyx_L34_except_error) __Pyx_GOTREF(__pyx_t_25); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_25); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 428, __pyx_L34_except_error) __pyx_t_2 = ((!(__pyx_t_11 != 0)) != 0); if (__pyx_t_2) { __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, 428, __pyx_L34_except_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L33_exception_handled; } __pyx_L34_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_L33_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_L39_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_21) { __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_tuple__96, NULL); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 428, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; } goto __pyx_L31; } __pyx_L31:; } goto __pyx_L44; __pyx_L26_error:; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; goto __pyx_L8_error; __pyx_L44:; } /* "asyncpg/protocol/protocol.pyx":430 * with timer: * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) # <<<<<<<<<<<<<< * wbuf = WriteBuffer.new() * */ __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, 430, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":431 * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) * wbuf = WriteBuffer.new() # <<<<<<<<<<<<<< * * # End of binary copy. */ __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_wbuf)); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_wbuf, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":427 * codec.encode(settings, wbuf, item) * * if wbuf.len() >= _COPY_BUFFER_SIZE: # <<<<<<<<<<<<<< * with timer: * await self.writing_allowed.wait() */ } /* "asyncpg/protocol/protocol.pyx":415 * 'type {} (OID {})'.format(codec.name, codec.oid)) * * for row in records: # <<<<<<<<<<<<<< * # Tuple header * wbuf.write_int16(num_cols) */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":434 * * # End of binary copy. * wbuf.write_int16(-1) # <<<<<<<<<<<<<< * self._write_copy_data_msg(wbuf) * */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16(__pyx_cur_scope->__pyx_v_wbuf, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":435 * # End of binary copy. * wbuf.write_int16(-1) * self._write_copy_data_msg(wbuf) # <<<<<<<<<<<<<< * * elif reader is not None: */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject *)__pyx_cur_scope->__pyx_v_wbuf)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":393 * * try: * if record_stmt is not None: # <<<<<<<<<<<<<< * # copy_in_records in binary mode * wbuf = WriteBuffer.new() */ goto __pyx_L14; } /* "asyncpg/protocol/protocol.pyx":437 * self._write_copy_data_msg(wbuf) * * elif reader is not None: # <<<<<<<<<<<<<< * try: * aiter = reader.__aiter__ */ __pyx_t_2 = (__pyx_cur_scope->__pyx_v_reader != Py_None); __pyx_t_11 = (__pyx_t_2 != 0); if (__pyx_t_11) { /* "asyncpg/protocol/protocol.pyx":438 * * elif reader is not None: * try: # <<<<<<<<<<<<<< * aiter = reader.__aiter__ * except AttributeError: */ { __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_24, &__pyx_t_23); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_23); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":439 * elif reader is not None: * try: * aiter = reader.__aiter__ # <<<<<<<<<<<<<< * except AttributeError: * raise TypeError('reader is not an asynchronous iterable') */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_reader, __pyx_n_s_aiter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_aiter = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":438 * * elif reader is not None: * try: # <<<<<<<<<<<<<< * aiter = reader.__aiter__ * except AttributeError: */ } /* "asyncpg/protocol/protocol.pyx":443 * raise TypeError('reader is not an asynchronous iterable') * else: * iterator = aiter() # <<<<<<<<<<<<<< * * try: */ /*else:*/ { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_aiter); __pyx_t_3 = __pyx_cur_scope->__pyx_v_aiter; __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_16) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L47_except_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L47_except_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_iterator = __pyx_t_4; __pyx_t_4 = 0; } __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; goto __pyx_L50_try_end; __pyx_L45_error:; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 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; /* "asyncpg/protocol/protocol.pyx":440 * try: * aiter = reader.__aiter__ * except AttributeError: # <<<<<<<<<<<<<< * raise TypeError('reader is not an asynchronous iterable') * else: */ __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_15) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_16) < 0) __PYX_ERR(0, 440, __pyx_L47_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_16); /* "asyncpg/protocol/protocol.pyx":441 * aiter = reader.__aiter__ * except AttributeError: * raise TypeError('reader is not an asynchronous iterable') # <<<<<<<<<<<<<< * else: * iterator = aiter() */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L47_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, 441, __pyx_L47_except_error) } goto __pyx_L47_except_error; __pyx_L47_except_error:; /* "asyncpg/protocol/protocol.pyx":438 * * elif reader is not None: * try: # <<<<<<<<<<<<<< * aiter = reader.__aiter__ * except AttributeError: */ __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_24, __pyx_t_23); goto __pyx_L8_error; __pyx_L50_try_end:; } /* "asyncpg/protocol/protocol.pyx":445 * iterator = aiter() * * try: # <<<<<<<<<<<<<< * while True: * # We rely on protocol flow control to moderate the */ { __Pyx_ExceptionSave(&__pyx_t_23, &__pyx_t_24, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_21); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":446 * * try: * while True: # <<<<<<<<<<<<<< * # We rely on protocol flow control to moderate the * # rate of data messages. */ while (1) { /* "asyncpg/protocol/protocol.pyx":449 * # 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_22 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_exit); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 449, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 449, __pyx_L61_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_16 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 449, __pyx_L61_error) } __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":450 * # rate of data messages. * with timer: * await self.writing_allowed.wait() # <<<<<<<<<<<<<< * with timer: * chunk = await asyncio.wait_for( */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_wait); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_3) { __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 450, __pyx_L67_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_16 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 450, __pyx_L67_error) } __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_16); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__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_6 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_7 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_8 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_t_25); __pyx_cur_scope->__pyx_t_9 = __pyx_t_25; __Pyx_XGIVEREF(__pyx_t_26); __pyx_cur_scope->__pyx_t_10 = __pyx_t_26; __Pyx_XGIVEREF(__pyx_t_27); __pyx_cur_scope->__pyx_t_11 = __pyx_t_27; __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_L75_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_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_23 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_24); __pyx_t_25 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_25); __pyx_t_26 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_26); __pyx_t_27 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_27); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 450, __pyx_L67_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 450, __pyx_L67_error) } } /* "asyncpg/protocol/protocol.pyx":449 * # 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_26); __pyx_t_26 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; goto __pyx_L74_try_end; __pyx_L67_error:; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 449, __pyx_L69_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_Pack(3, __pyx_t_16, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L69_except_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_28 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_5, NULL); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 449, __pyx_L69_except_error) __Pyx_GOTREF(__pyx_t_28); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_28); __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 449, __pyx_L69_except_error) __pyx_t_2 = ((!(__pyx_t_11 != 0)) != 0); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_16, __pyx_t_4, __pyx_t_3); __pyx_t_16 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 449, __pyx_L69_except_error) } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L68_exception_handled; } __pyx_L69_except_error:; __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27); goto __pyx_L53_error; __pyx_L68_exception_handled:; __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27); __pyx_L74_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_22) { __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_tuple__98, NULL); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 449, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; } goto __pyx_L66; } __pyx_L66:; } goto __pyx_L79; __pyx_L61_error:; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; goto __pyx_L53_error; __pyx_L79:; } /* "asyncpg/protocol/protocol.pyx":451 * with timer: * await self.writing_allowed.wait() * with timer: # <<<<<<<<<<<<<< * chunk = await asyncio.wait_for( * iterator.__anext__(), */ /*with:*/ { __pyx_t_22 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_exit); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 451, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L80_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_16) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L80_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L80_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_25); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":452 * await self.writing_allowed.wait() * with timer: * chunk = await asyncio.wait_for( # <<<<<<<<<<<<<< * iterator.__anext__(), * timeout=timer.get_remaining_budget(), */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_wait_for); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":453 * with timer: * chunk = await asyncio.wait_for( * iterator.__anext__(), # <<<<<<<<<<<<<< * timeout=timer.get_remaining_budget(), * loop=self.loop) */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_iterator, __pyx_n_s_anext); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 453, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L86_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L86_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "asyncpg/protocol/protocol.pyx":452 * await self.writing_allowed.wait() * with timer: * chunk = await asyncio.wait_for( # <<<<<<<<<<<<<< * iterator.__anext__(), * timeout=timer.get_remaining_budget(), */ __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 452, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":454 * chunk = await asyncio.wait_for( * iterator.__anext__(), * timeout=timer.get_remaining_budget(), # <<<<<<<<<<<<<< * loop=self.loop) * self._write_copy_data_msg(chunk) */ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 454, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_12) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L86_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L86_error) } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_timeout, __pyx_t_5) < 0) __PYX_ERR(0, 454, __pyx_L86_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":455 * iterator.__anext__(), * timeout=timer.get_remaining_budget(), * loop=self.loop) # <<<<<<<<<<<<<< * self._write_copy_data_msg(chunk) * except builtins.StopAsyncIteration: */ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_loop, __pyx_cur_scope->__pyx_v_self->loop) < 0) __PYX_ERR(0, 454, __pyx_L86_error) /* "asyncpg/protocol/protocol.pyx":452 * await self.writing_allowed.wait() * with timer: * chunk = await asyncio.wait_for( # <<<<<<<<<<<<<< * iterator.__anext__(), * timeout=timer.get_remaining_budget(), */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__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_6 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_7 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_8 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_t_25); __pyx_cur_scope->__pyx_t_9 = __pyx_t_25; __Pyx_XGIVEREF(__pyx_t_26); __pyx_cur_scope->__pyx_t_10 = __pyx_t_26; __Pyx_XGIVEREF(__pyx_t_27); __pyx_cur_scope->__pyx_t_11 = __pyx_t_27; __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_L94_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_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_23 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_24); __pyx_t_25 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_25); __pyx_t_26 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_26); __pyx_t_27 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_27); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 452, __pyx_L86_error) __pyx_t_5 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_5); } else { __pyx_t_5 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_5) < 0) __PYX_ERR(0, 452, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunk); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunk, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":451 * with timer: * await self.writing_allowed.wait() * with timer: # <<<<<<<<<<<<<< * chunk = await asyncio.wait_for( * iterator.__anext__(), */ } __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; goto __pyx_L93_try_end; __pyx_L86_error:; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__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_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 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_3, &__pyx_t_16) < 0) __PYX_ERR(0, 451, __pyx_L88_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_16); __pyx_t_4 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L88_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_28 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 451, __pyx_L88_except_error) __Pyx_GOTREF(__pyx_t_28); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_28); __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; if (__pyx_t_2 < 0) __PYX_ERR(0, 451, __pyx_L88_except_error) __pyx_t_11 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_3, __pyx_t_16); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_16 = 0; __PYX_ERR(0, 451, __pyx_L88_except_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L87_exception_handled; } __pyx_L88_except_error:; __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_26, __pyx_t_25); goto __pyx_L53_error; __pyx_L87_exception_handled:; __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_26, __pyx_t_25); __pyx_L93_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_22) { __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_tuple__99, NULL); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 451, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; } goto __pyx_L85; } __pyx_L85:; } goto __pyx_L98; __pyx_L80_error:; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; goto __pyx_L53_error; __pyx_L98:; } /* "asyncpg/protocol/protocol.pyx":456 * timeout=timer.get_remaining_budget(), * loop=self.loop) * self._write_copy_data_msg(chunk) # <<<<<<<<<<<<<< * except builtins.StopAsyncIteration: * pass */ if (unlikely(!__pyx_cur_scope->__pyx_v_chunk)) { __Pyx_RaiseUnboundLocalError("chunk"); __PYX_ERR(0, 456, __pyx_L53_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, 456, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } /* "asyncpg/protocol/protocol.pyx":445 * 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_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; goto __pyx_L58_try_end; __pyx_L53_error:; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__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; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; /* "asyncpg/protocol/protocol.pyx":457 * loop=self.loop) * self._write_copy_data_msg(chunk) * except builtins.StopAsyncIteration: # <<<<<<<<<<<<<< * pass * else: */ __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_builtins); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 457, __pyx_L55_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_StopAsyncIteration); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L55_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_15) { __Pyx_ErrRestore(0,0,0); goto __pyx_L54_exception_handled; } goto __pyx_L55_except_error; __pyx_L55_except_error:; /* "asyncpg/protocol/protocol.pyx":445 * iterator = aiter() * * try: # <<<<<<<<<<<<<< * while True: * # We rely on protocol flow control to moderate the */ __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_21); goto __pyx_L8_error; __pyx_L54_exception_handled:; __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_21); __pyx_L58_try_end:; } /* "asyncpg/protocol/protocol.pyx":437 * self._write_copy_data_msg(wbuf) * * elif reader is not None: # <<<<<<<<<<<<<< * try: * aiter = reader.__aiter__ */ goto __pyx_L14; } /* "asyncpg/protocol/protocol.pyx":461 * 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_n_s_writing_allowed); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 461, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_wait); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 461, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_16) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L8_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L8_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__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 = 6; return __pyx_r; __pyx_L99_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, 461, __pyx_L8_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 461, __pyx_L8_error) } } /* "asyncpg/protocol/protocol.pyx":462 * # 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, 462, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L14:; /* "asyncpg/protocol/protocol.pyx":392 * 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_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__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_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":464 * self._write_copy_data_msg(data) * * except asyncio.TimeoutError: # <<<<<<<<<<<<<< * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_15) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_16) < 0) __PYX_ERR(0, 464, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_16); /* "asyncpg/protocol/protocol.pyx":465 * * 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_n_u_TimeoutError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":466 * except asyncio.TimeoutError: * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) # <<<<<<<<<<<<<< * try: * await waiter */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_on_timeout); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_12) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_self->waiter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_self->waiter}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L10_except_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_self->waiter}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L10_except_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 466, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->waiter); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->waiter); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_cur_scope->__pyx_v_self->waiter); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":467 * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) * try: # <<<<<<<<<<<<<< * await waiter * except TimeoutError: */ { __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_24, &__pyx_t_23); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_23); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":468 * self._on_timeout(self.waiter) * try: * await waiter # <<<<<<<<<<<<<< * except TimeoutError: * raise */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_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_6 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_t_7 = __pyx_t_16; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_8 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_9 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_10 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_SwapException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 7; return __pyx_r; __pyx_L110_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_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_16 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_16); __pyx_t_21 = __pyx_cur_scope->__pyx_t_8; __pyx_cur_scope->__pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_23 = __pyx_cur_scope->__pyx_t_9; __pyx_cur_scope->__pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_24); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 468, __pyx_L102_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 468, __pyx_L102_error) } } /* "asyncpg/protocol/protocol.pyx":467 * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) * try: # <<<<<<<<<<<<<< * await waiter * except TimeoutError: */ } /* "asyncpg/protocol/protocol.pyx":472 * raise * else: * raise apg_exc.InternalClientError('TimoutError was not raised') # <<<<<<<<<<<<<< * * except Exception as e: */ /*else:*/ { __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L104_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L104_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L104_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 472, __pyx_L104_except_error) } __pyx_L102_error:; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":469 * try: * await waiter * except TimeoutError: # <<<<<<<<<<<<<< * raise * else: */ __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TimeoutError); if (__pyx_t_15) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_13) < 0) __PYX_ERR(0, 469, __pyx_L104_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_13); /* "asyncpg/protocol/protocol.pyx":470 * await waiter * except TimeoutError: * raise # <<<<<<<<<<<<<< * else: * raise apg_exc.InternalClientError('TimoutError was not raised') */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_13); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_13 = 0; __PYX_ERR(0, 470, __pyx_L104_except_error) } goto __pyx_L104_except_error; __pyx_L104_except_error:; /* "asyncpg/protocol/protocol.pyx":467 * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) * try: # <<<<<<<<<<<<<< * await waiter * except TimeoutError: */ __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_24, __pyx_t_23); goto __pyx_L10_except_error; } } /* "asyncpg/protocol/protocol.pyx":474 * raise apg_exc.InternalClientError('TimoutError was not raised') * * except Exception as e: # <<<<<<<<<<<<<< * self._write_copy_fail_msg(str(e)) * self._request_cancel() */ __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_15) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(0, 474, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_e = __pyx_t_3; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":475 * * except Exception as e: * self._write_copy_fail_msg(str(e)) # <<<<<<<<<<<<<< * self._request_cancel() * raise */ __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 475, __pyx_L118_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_e); __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L118_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __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_6)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 475, __pyx_L118_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":476 * except Exception as e: * self._write_copy_fail_msg(str(e)) * self._request_cancel() # <<<<<<<<<<<<<< * raise * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_request_cancel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 476, __pyx_L118_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_4) { __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 476, __pyx_L118_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_13 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 476, __pyx_L118_error) } __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/protocol.pyx":477 * self._write_copy_fail_msg(str(e)) * self._request_cancel() * raise # <<<<<<<<<<<<<< * * self._write_copy_done_msg() */ __Pyx_GIVEREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestoreWithState(__pyx_t_16, __pyx_t_3, __pyx_t_5); __pyx_t_16 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0; __PYX_ERR(0, 477, __pyx_L118_error) } /* "asyncpg/protocol/protocol.pyx":474 * raise apg_exc.InternalClientError('TimoutError was not raised') * * except Exception as e: # <<<<<<<<<<<<<< * self._write_copy_fail_msg(str(e)) * self._request_cancel() */ /*finally:*/ { /*exception exit:*/{ __pyx_L118_error:; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __Pyx_PyThreadState_assign __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_25, &__pyx_t_26); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_24, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_24, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __pyx_t_15 = __pyx_lineno; __pyx_t_29 = __pyx_clineno; __pyx_t_30 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_25, __pyx_t_26); } __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_23, __pyx_t_24, __pyx_t_21); __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_29; __pyx_filename = __pyx_t_30; goto __pyx_L10_except_error; } } } goto __pyx_L10_except_error; __pyx_L10_except_error:; /* "asyncpg/protocol/protocol.pyx":392 * self._copy_in(copy_stmt) * * try: # <<<<<<<<<<<<<< * if record_stmt is not None: * # copy_in_records in binary mode */ __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":479 * raise * * self._write_copy_done_msg() # <<<<<<<<<<<<<< * * status_msg = await waiter */ __pyx_t_5 = ((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_5)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":481 * self._write_copy_done_msg() * * status_msg = await waiter # <<<<<<<<<<<<<< * * return status_msg */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 8; return __pyx_r; __pyx_L124_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 481, __pyx_L1_error) __pyx_t_5 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_5); } else { __pyx_t_5 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_5) < 0) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_GIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_v_status_msg = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":483 * status_msg = await waiter * * return status_msg # <<<<<<<<<<<<<< * * async def close_statement(self, PreparedStatementState state, timeout): */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_status_msg); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":369 * 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_6); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __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":485 * 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_35close_statement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35close_statement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0; PyObject *__pyx_v_timeout = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close_statement (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_timeout,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("close_statement", 1, 2, 2, 1); __PYX_ERR(0, 485, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "close_statement") < 0)) __PYX_ERR(0, 485, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_timeout = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("close_statement", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 485, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 485, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_34close_statement(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_34close_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_9_close_statement *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close_statement", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 485, __pyx_L1_error) } else { __Pyx_GOTREF(__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_36generator8, (PyObject *) __pyx_cur_scope, __pyx_n_s_close_statement, __pyx_n_s_BaseProtocol_close_statement, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 485, __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_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_9_close_statement *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement *)__pyx_generator->closure); PyObject *__pyx_r = NULL; 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; 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; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close_statement", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L29_resume_from_await; case 4: goto __pyx_L32_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 485, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":486 * * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":487 * async def close_statement(self, PreparedStatementState state, timeout): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 487, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 487, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":486 * * 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":488 * 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_2 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":489 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 489, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 489, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":490 * 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":488 * 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":492 * 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, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":494 * 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) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":495 * * if state.refs != 0: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'cannot close prepared statement; refs == {} != 0'.format( * state.refs)) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":496 * if state.refs != 0: * raise apg_exc.InternalClientError( * 'cannot close prepared statement; refs == {} != 0'.format( # <<<<<<<<<<<<<< * state.refs)) * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_close_prepared_statement, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/protocol.pyx":497 * raise apg_exc.InternalClientError( * 'cannot close prepared statement; refs == {} != 0'.format( * state.refs)) # <<<<<<<<<<<<<< * * timeout = self._get_timeout_impl(timeout) */ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_state->refs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_8) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 495, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":494 * self._check_state() * * if state.refs != 0: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'cannot close prepared statement; refs == {} != 0'.format( */ } /* "asyncpg/protocol/protocol.pyx":499 * 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, 499, __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":500 * * 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, 500, __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":501 * 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":502 * 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_5 = ((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_5)) __PYX_ERR(0, 502, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":503 * 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":501 * 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_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":504 * 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)[0]))); if (__pyx_t_13) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(0, 504, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__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":505 * state.closed = True * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_ex); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L23_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L23_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 505, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ex); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_cur_scope->__pyx_v_ex); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":506 * 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, 506, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/protocol.pyx":504 * 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 = NULL; goto __pyx_L24; } /*exception exit:*/{ __pyx_L23_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_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 = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L14_except_error; } __pyx_L24:; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L13_exception_handled; } goto __pyx_L14_except_error; __pyx_L14_except_error:; /* "asyncpg/protocol/protocol.pyx":501 * timeout = self._get_timeout_impl(timeout) * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._close(state.name, False) # network op * state.closed = True */ __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":508 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * def is_closed(self): */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L29_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 508, __pyx_L1_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L0; } /*exception exit:*/{ __pyx_L10_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 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; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_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_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_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, 508, __pyx_L31_error) __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_9 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(0, 508, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = 0; goto __pyx_L30_return; } __pyx_L30_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_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":485 * 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); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":510 * return await waiter * * def is_closed(self): # <<<<<<<<<<<<<< * return self.closing * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38is_closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38is_closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_closed (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_37is_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_37is_closed(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("is_closed", 0); /* "asyncpg/protocol/protocol.pyx":511 * * 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, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":510 * 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":513 * 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_40is_connected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_40is_connected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_connected (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_39is_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_39is_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; __Pyx_RefNannySetupContext("is_connected", 0); /* "asyncpg/protocol/protocol.pyx":514 * * 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 != 0)); if (__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __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, 514, __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":513 * 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":516 * 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_42abort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_42abort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("abort (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_41abort(((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_41abort(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; __Pyx_RefNannySetupContext("abort", 0); /* "asyncpg/protocol/protocol.pyx":517 * * def abort(self): * if self.closing: # <<<<<<<<<<<<<< * return * self.closing = True */ __pyx_t_1 = (__pyx_v_self->closing != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":518 * 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":517 * * def abort(self): * if self.closing: # <<<<<<<<<<<<<< * return * self.closing = True */ } /* "asyncpg/protocol/protocol.pyx":519 * 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":520 * return * self.closing = True * self._handle_waiter_on_connection_lost(None) # <<<<<<<<<<<<<< * self._terminate() * self.transport.abort() */ __pyx_t_2 = ((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_2)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":521 * self.closing = True * self._handle_waiter_on_connection_lost(None) * self._terminate() # <<<<<<<<<<<<<< * self.transport.abort() * */ __pyx_t_2 = ((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_2)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":522 * self._handle_waiter_on_connection_lost(None) * self._terminate() * self.transport.abort() # <<<<<<<<<<<<<< * * async def close(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.transport, __pyx_n_s_abort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":516 * 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_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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_45generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":524 * self.transport.abort() * * async def close(self): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_44close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_44close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_43close(((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_43close(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 524, __pyx_L1_error) } else { __Pyx_GOTREF(__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_45generator9, (PyObject *) __pyx_cur_scope, __pyx_n_s_close, __pyx_n_s_BaseProtocol_close, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 524, __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_45generator9(__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_close *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close", 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_L9_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 524, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":525 * * async def close(self): * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":526 * async def close(self): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 526, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 526, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":525 * * async def close(self): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":527 * 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_2 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":528 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 528, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 528, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":529 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._handle_waiter_on_connection_lost(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":527 * 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":531 * self.cancel_sent_waiter = None * * self._handle_waiter_on_connection_lost(None) # <<<<<<<<<<<<<< * assert self.waiter is None * */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_handle_waiter_on_connection_lost(__pyx_cur_scope->__pyx_v_self, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":532 * * self._handle_waiter_on_connection_lost(None) * assert self.waiter is None # <<<<<<<<<<<<<< * * if self.closing: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->waiter == Py_None); if (unlikely(!(__pyx_t_1 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 532, __pyx_L1_error) } } #endif /* "asyncpg/protocol/protocol.pyx":534 * assert self.waiter is None * * if self.closing: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->closing != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":535 * * if self.closing: * return # <<<<<<<<<<<<<< * * self._terminate() */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":534 * assert self.waiter is None * * if self.closing: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/protocol.pyx":537 * return * * self._terminate() # <<<<<<<<<<<<<< * self.waiter = self.create_future() * self.closing = True */ __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, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":538 * * self._terminate() * self.waiter = self.create_future() # <<<<<<<<<<<<<< * self.closing = True * self.transport.abort() */ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->create_future); __pyx_t_4 = __pyx_cur_scope->__pyx_v_self->create_future; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __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":539 * self._terminate() * self.waiter = self.create_future() * self.closing = True # <<<<<<<<<<<<<< * self.transport.abort() * return await self.waiter */ __pyx_cur_scope->__pyx_v_self->closing = 1; /* "asyncpg/protocol/protocol.pyx":540 * self.waiter = self.create_future() * self.closing = True * self.transport.abort() # <<<<<<<<<<<<<< * return await self.waiter * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->__pyx_base.transport, __pyx_n_s_abort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":541 * self.closing = True * self.transport.abort() * return await self.waiter # <<<<<<<<<<<<<< * * def _request_cancel(self): */ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L9_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 541, __pyx_L1_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = 0; goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":524 * self.transport.abort() * * async def close(self): # <<<<<<<<<<<<<< * 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_AddTraceback("close", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Coroutine_ResetAndClearException(__pyx_generator); __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":543 * return await self.waiter * * 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_47_request_cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47_request_cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_request_cancel (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_46_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_46_request_cancel(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; __Pyx_RefNannySetupContext("_request_cancel", 0); /* "asyncpg/protocol/protocol.pyx":544 * * def _request_cancel(self): * self.cancel_waiter = self.create_future() # <<<<<<<<<<<<<< * self.cancel_sent_waiter = self.create_future() * self.connection._cancel_current_command(self.cancel_sent_waiter) */ __Pyx_INCREF(__pyx_v_self->create_future); __pyx_t_2 = __pyx_v_self->create_future; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->cancel_waiter); __Pyx_DECREF(__pyx_v_self->cancel_waiter); __pyx_v_self->cancel_waiter = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":545 * def _request_cancel(self): * self.cancel_waiter = self.create_future() * self.cancel_sent_waiter = self.create_future() # <<<<<<<<<<<<<< * self.connection._cancel_current_command(self.cancel_sent_waiter) * self._set_state(PROTOCOL_CANCELLED) */ __Pyx_INCREF(__pyx_v_self->create_future); __pyx_t_2 = __pyx_v_self->create_future; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_v_self->cancel_sent_waiter); __pyx_v_self->cancel_sent_waiter = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":546 * self.cancel_waiter = self.create_future() * self.cancel_sent_waiter = self.create_future() * self.connection._cancel_current_command(self.cancel_sent_waiter) # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_CANCELLED) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->connection, __pyx_n_s_cancel_current_command); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->cancel_sent_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->cancel_sent_waiter}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->cancel_sent_waiter}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_self->cancel_sent_waiter); __Pyx_GIVEREF(__pyx_v_self->cancel_sent_waiter); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->cancel_sent_waiter); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":547 * self.cancel_sent_waiter = self.create_future() * self.connection._cancel_current_command(self.cancel_sent_waiter) * self._set_state(PROTOCOL_CANCELLED) # <<<<<<<<<<<<<< * * def _on_timeout(self, fut): */ __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_CANCELLED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":543 * return await self.waiter * * def _request_cancel(self): # <<<<<<<<<<<<<< * self.cancel_waiter = self.create_future() * self.cancel_sent_waiter = self.create_future() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._request_cancel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":549 * 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_49_on_timeout(PyObject *__pyx_v_self, PyObject *__pyx_v_fut); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_49_on_timeout(PyObject *__pyx_v_self, PyObject *__pyx_v_fut) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_on_timeout (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_48_on_timeout(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_fut)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_48_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; 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; __Pyx_RefNannySetupContext("_on_timeout", 0); /* "asyncpg/protocol/protocol.pyx":550 * * 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); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fut, __pyx_n_s_done); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":551 * 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_3 = (__pyx_v_self->cancel_waiter != Py_None); __pyx_t_2 = (__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":552 * 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_3 = (__pyx_t_2 != 0); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; /* "asyncpg/protocol/protocol.pyx":550 * * 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":553 * 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":550 * * 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":554 * self.timeout_handle is None: * return * self._request_cancel() # <<<<<<<<<<<<<< * self.waiter.set_exception(asyncio.TimeoutError()) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_request_cancel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":555 * return * self._request_cancel() * self.waiter.set_exception(asyncio.TimeoutError()) # <<<<<<<<<<<<<< * * def _on_waiter_completed(self, fut): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_asyncio); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (__pyx_t_7) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_8) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":549 * 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_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.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":557 * self.waiter.set_exception(asyncio.TimeoutError()) * * def _on_waiter_completed(self, fut): # <<<<<<<<<<<<<< * if fut is not self.waiter or self.cancel_waiter is not None: * return */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_51_on_waiter_completed(PyObject *__pyx_v_self, PyObject *__pyx_v_fut); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_51_on_waiter_completed(PyObject *__pyx_v_self, PyObject *__pyx_v_fut) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_on_waiter_completed (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_50_on_waiter_completed(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_fut)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_50_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; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_on_waiter_completed", 0); /* "asyncpg/protocol/protocol.pyx":558 * * def _on_waiter_completed(self, fut): * if fut is not self.waiter or self.cancel_waiter is not None: # <<<<<<<<<<<<<< * return * if fut.cancelled(): */ __pyx_t_2 = (__pyx_v_fut != __pyx_v_self->waiter); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_self->cancel_waiter != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":559 * def _on_waiter_completed(self, fut): * if fut is not self.waiter or self.cancel_waiter is not None: * return # <<<<<<<<<<<<<< * if fut.cancelled(): * if self.timeout_handle: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":558 * * def _on_waiter_completed(self, fut): * if fut is not self.waiter or self.cancel_waiter is not None: # <<<<<<<<<<<<<< * return * if fut.cancelled(): */ } /* "asyncpg/protocol/protocol.pyx":560 * if fut is not self.waiter or self.cancel_waiter is not None: * return * if fut.cancelled(): # <<<<<<<<<<<<<< * if self.timeout_handle: * self.timeout_handle.cancel() */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fut, __pyx_n_s_cancelled); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":561 * return * if fut.cancelled(): * 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, 561, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":562 * if fut.cancelled(): * if self.timeout_handle: * self.timeout_handle.cancel() # <<<<<<<<<<<<<< * self.timeout_handle = None * self._request_cancel() */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->timeout_handle, __pyx_n_s_cancel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":563 * if self.timeout_handle: * self.timeout_handle.cancel() * self.timeout_handle = None # <<<<<<<<<<<<<< * self._request_cancel() * */ __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":561 * return * if fut.cancelled(): * if self.timeout_handle: # <<<<<<<<<<<<<< * self.timeout_handle.cancel() * self.timeout_handle = None */ } /* "asyncpg/protocol/protocol.pyx":564 * self.timeout_handle.cancel() * self.timeout_handle = None * self._request_cancel() # <<<<<<<<<<<<<< * * def _create_future_fallback(self): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_request_cancel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":560 * if fut is not self.waiter or self.cancel_waiter is not None: * return * if fut.cancelled(): # <<<<<<<<<<<<<< * if self.timeout_handle: * self.timeout_handle.cancel() */ } /* "asyncpg/protocol/protocol.pyx":557 * self.waiter.set_exception(asyncio.TimeoutError()) * * def _on_waiter_completed(self, fut): # <<<<<<<<<<<<<< * if fut is not self.waiter or self.cancel_waiter is not None: * return */ /* 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_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":566 * self._request_cancel() * * def _create_future_fallback(self): # <<<<<<<<<<<<<< * return asyncio.Future(loop=self.loop) * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_53_create_future_fallback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_53_create_future_fallback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_create_future_fallback (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_52_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_52_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; __Pyx_RefNannySetupContext("_create_future_fallback", 0); /* "asyncpg/protocol/protocol.pyx":567 * * 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Future); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_loop, __pyx_v_self->loop) < 0) __PYX_ERR(0, 567, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":566 * self._request_cancel() * * def _create_future_fallback(self): # <<<<<<<<<<<<<< * return asyncio.Future(loop=self.loop) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._create_future_fallback", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":569 * 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; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("_handle_waiter_on_connection_lost", 0); /* "asyncpg/protocol/protocol.pyx":570 * * 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); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = ((!__pyx_t_3) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":571 * 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 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionDoesNotExistError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_exc = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":574 * '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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":575 * 'operation') * if cause is not None: * exc.__cause__ = cause # <<<<<<<<<<<<<< * self.waiter.set_exception(exc) * self.waiter = None */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_exc, __pyx_n_s_cause, __pyx_v_cause) < 0) __PYX_ERR(0, 575, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":574 * '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":576 * if cause is not None: * exc.__cause__ = cause * self.waiter.set_exception(exc) # <<<<<<<<<<<<<< * self.waiter = None * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_exc}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_exc}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_exc); __Pyx_GIVEREF(__pyx_v_exc); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_exc); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":570 * * 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":577 * 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":569 * 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_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __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":579 * 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; __Pyx_RefNannySetupContext("_set_server_parameter", 0); /* "asyncpg/protocol/protocol.pyx":580 * * cdef _set_server_parameter(self, name, val): * self.settings.add_setting(name, val) # <<<<<<<<<<<<<< * * def _get_timeout(self, timeout): */ if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 580, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_val))||((__pyx_v_val) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_val)->tp_name), 0))) __PYX_ERR(0, 580, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting(__pyx_v_self->settings, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_val)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":579 * self.waiter = None * * cdef _set_server_parameter(self, name, val): # <<<<<<<<<<<<<< * self.settings.add_setting(name, val) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._set_server_parameter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":582 * 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_55_get_timeout(PyObject *__pyx_v_self, PyObject *__pyx_v_timeout); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_55_get_timeout(PyObject *__pyx_v_self, PyObject *__pyx_v_timeout) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_timeout (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_54_get_timeout(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_timeout)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_54_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; int __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; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; __Pyx_RefNannySetupContext("_get_timeout", 0); __Pyx_INCREF(__pyx_v_timeout); /* "asyncpg/protocol/protocol.pyx":583 * * def _get_timeout(self, timeout): * if timeout is not None: # <<<<<<<<<<<<<< * try: * if type(timeout) is bool: */ __pyx_t_1 = (__pyx_v_timeout != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":584 * 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_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":585 * if timeout is not None: * try: * if type(timeout) is bool: # <<<<<<<<<<<<<< * raise ValueError * timeout = float(timeout) */ __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_timeout)) == ((PyObject*)&PyBool_Type)); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":586 * try: * if type(timeout) is bool: * raise ValueError # <<<<<<<<<<<<<< * timeout = float(timeout) * except ValueError: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); __PYX_ERR(0, 586, __pyx_L4_error) /* "asyncpg/protocol/protocol.pyx":585 * if timeout is not None: * try: * if type(timeout) is bool: # <<<<<<<<<<<<<< * raise ValueError * timeout = float(timeout) */ } /* "asyncpg/protocol/protocol.pyx":587 * if type(timeout) is bool: * raise ValueError * timeout = float(timeout) # <<<<<<<<<<<<<< * except ValueError: * raise ValueError( */ __pyx_t_6 = __Pyx_PyNumber_Float(__pyx_v_timeout); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 587, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":584 * def _get_timeout(self, timeout): * if timeout is not None: * try: # <<<<<<<<<<<<<< * if type(timeout) is bool: * raise ValueError */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":588 * raise ValueError * timeout = float(timeout) * except ValueError: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid timeout value: expected non-negative float ' */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_7) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._get_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 588, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/protocol.pyx":591 * raise ValueError( * 'invalid timeout value: expected non-negative float ' * '(got {!r})'.format(timeout)) from None # <<<<<<<<<<<<<< * * return self._get_timeout_impl(timeout) */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_timeout_value_expected_n, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 591, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); } } if (!__pyx_t_12) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_timeout); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 591, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_timeout}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 591, __pyx_L6_except_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_timeout}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 591, __pyx_L6_except_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 591, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_v_timeout); __Pyx_GIVEREF(__pyx_v_timeout); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_timeout); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 591, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":589 * timeout = float(timeout) * except ValueError: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid timeout value: expected non-negative float ' * '(got {!r})'.format(timeout)) from None */ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 589, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 589, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":591 * raise ValueError( * 'invalid timeout value: expected non-negative float ' * '(got {!r})'.format(timeout)) from None # <<<<<<<<<<<<<< * * return self._get_timeout_impl(timeout) */ __Pyx_Raise(__pyx_t_10, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(0, 589, __pyx_L6_except_error) } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "asyncpg/protocol/protocol.pyx":584 * def _get_timeout(self, timeout): * if timeout is not None: * try: # <<<<<<<<<<<<<< * if type(timeout) is bool: * raise ValueError */ __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_L1_error; __pyx_L9_try_end:; } /* "asyncpg/protocol/protocol.pyx":583 * * def _get_timeout(self, timeout): * if timeout is not None: # <<<<<<<<<<<<<< * try: * if type(timeout) is bool: */ } /* "asyncpg/protocol/protocol.pyx":593 * '(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_9 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_v_self, __pyx_v_timeout); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":582 * 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_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.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":595 * return self._get_timeout_impl(timeout) * * cdef inline _get_timeout_impl(self, timeout): # <<<<<<<<<<<<<< * if timeout is None: * timeout = self.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; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_get_timeout_impl", 0); __Pyx_INCREF(__pyx_v_timeout); /* "asyncpg/protocol/protocol.pyx":596 * * cdef inline _get_timeout_impl(self, timeout): * if timeout is None: # <<<<<<<<<<<<<< * timeout = self.connection._config.command_timeout * elif timeout is NO_TIMEOUT: */ __pyx_t_1 = (__pyx_v_timeout == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":597 * cdef inline _get_timeout_impl(self, timeout): * if timeout is None: * timeout = self.connection._config.command_timeout # <<<<<<<<<<<<<< * elif timeout is NO_TIMEOUT: * timeout = None */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->connection, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_command_timeout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":596 * * cdef inline _get_timeout_impl(self, timeout): * if timeout is None: # <<<<<<<<<<<<<< * timeout = self.connection._config.command_timeout * elif timeout is NO_TIMEOUT: */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":598 * if timeout is None: * timeout = self.connection._config.command_timeout * elif timeout is NO_TIMEOUT: # <<<<<<<<<<<<<< * timeout = None * else: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NO_TIMEOUT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = (__pyx_v_timeout == __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":599 * timeout = self.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":598 * if timeout is None: * timeout = self.connection._config.command_timeout * elif timeout is NO_TIMEOUT: # <<<<<<<<<<<<<< * timeout = None * else: */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":601 * timeout = None * else: * timeout = float(timeout) # <<<<<<<<<<<<<< * * if timeout is not None and timeout <= 0: */ /*else*/ { __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_v_timeout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":603 * timeout = float(timeout) * * if timeout is not None and timeout <= 0: # <<<<<<<<<<<<<< * raise asyncio.TimeoutError() * return timeout */ __pyx_t_2 = (__pyx_v_timeout != Py_None); __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = PyObject_RichCompare(__pyx_v_timeout, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 603, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":604 * * if timeout is not None and timeout <= 0: * raise asyncio.TimeoutError() # <<<<<<<<<<<<<< * return timeout * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 604, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":603 * timeout = float(timeout) * * if timeout is not None and timeout <= 0: # <<<<<<<<<<<<<< * raise asyncio.TimeoutError() * return timeout */ } /* "asyncpg/protocol/protocol.pyx":605 * 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":595 * return self._get_timeout_impl(timeout) * * cdef inline _get_timeout_impl(self, timeout): # <<<<<<<<<<<<<< * if timeout is None: * timeout = self.connection._config.command_timeout */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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":607 * 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; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; __Pyx_RefNannySetupContext("_check_state", 0); /* "asyncpg/protocol/protocol.pyx":608 * * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":609 * 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 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 609, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":608 * * 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":611 * raise apg_exc.InterfaceError( * 'cannot perform operation: another operation is cancelling') * if self.closing: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'cannot perform operation: connection is closed') */ __pyx_t_2 = (__pyx_v_self->closing != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":612 * '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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 612, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":611 * 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":614 * 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_1 = (__pyx_v_self->waiter != Py_None); __pyx_t_5 = (__pyx_t_1 != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->timeout_handle != Py_None); __pyx_t_1 = (__pyx_t_5 != 0); __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":615 * '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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 615, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":614 * 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":607 * 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_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._check_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":618 * 'cannot perform operation: another operation is in progress') * * 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; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; 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; __Pyx_RefNannySetupContext("_coreproto_error", 0); /* "asyncpg/protocol/protocol.pyx":619 * * cdef _coreproto_error(self): * try: # <<<<<<<<<<<<<< * if self.waiter is not None: * if not self.waiter.done(): */ /*try:*/ { /* "asyncpg/protocol/protocol.pyx":620 * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":621 * 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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 621, __pyx_L4_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 621, __pyx_L4_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 621, __pyx_L4_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":622 * 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 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 622, __pyx_L4_error) /* "asyncpg/protocol/protocol.pyx":621 * 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":625 * '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":620 * cdef _coreproto_error(self): * try: * if self.waiter is not None: # <<<<<<<<<<<<<< * if not self.waiter.done(): * raise apg_exc.InternalClientError( */ } } /* "asyncpg/protocol/protocol.pyx":627 * self.waiter = None * finally: * self.abort() # <<<<<<<<<<<<<< * * cdef _new_waiter(self, timeout): */ /*finally:*/ { /*normal exit:*/{ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L5; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L4_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); if ((PY_MAJOR_VERSION < 3) || 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; { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L9_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L9_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (PY_MAJOR_VERSION >= 3) { __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_L9_error:; if (PY_MAJOR_VERSION >= 3) { __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_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "asyncpg/protocol/protocol.pyx":618 * 'cannot perform operation: another operation is in progress') * * 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_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __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":629 * 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; int __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; __Pyx_RefNannySetupContext("_new_waiter", 0); /* "asyncpg/protocol/protocol.pyx":630 * * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":631 * 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 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 631, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":630 * * 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":633 * 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.connection._loop.call_later( */ __Pyx_INCREF(__pyx_v_self->create_future); __pyx_t_4 = __pyx_v_self->create_future; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->waiter); __Pyx_DECREF(__pyx_v_self->waiter); __pyx_v_self->waiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":634 * 'cannot perform operation: another operation is in progress') * self.waiter = self.create_future() * if timeout is not None: # <<<<<<<<<<<<<< * self.timeout_handle = self.connection._loop.call_later( * timeout, self.timeout_callback, self.waiter) */ __pyx_t_2 = (__pyx_v_timeout != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":635 * self.waiter = self.create_future() * if timeout is not None: * self.timeout_handle = self.connection._loop.call_later( # <<<<<<<<<<<<<< * timeout, self.timeout_callback, self.waiter) * self.waiter.add_done_callback(self.completed_callback) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->connection, __pyx_n_s_loop_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_call_later); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":636 * if timeout is not None: * self.timeout_handle = self.connection._loop.call_later( * timeout, self.timeout_callback, self.waiter) # <<<<<<<<<<<<<< * self.waiter.add_done_callback(self.completed_callback) * return self.waiter */ __pyx_t_4 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_timeout, __pyx_v_self->timeout_callback, __pyx_v_self->waiter}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_timeout, __pyx_v_self->timeout_callback, __pyx_v_self->waiter}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_timeout); __Pyx_GIVEREF(__pyx_v_timeout); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_timeout); __Pyx_INCREF(__pyx_v_self->timeout_callback); __Pyx_GIVEREF(__pyx_v_self->timeout_callback); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_self->timeout_callback); __Pyx_INCREF(__pyx_v_self->waiter); __Pyx_GIVEREF(__pyx_v_self->waiter); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_self->waiter); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":635 * self.waiter = self.create_future() * if timeout is not None: * self.timeout_handle = self.connection._loop.call_later( # <<<<<<<<<<<<<< * timeout, self.timeout_callback, self.waiter) * self.waiter.add_done_callback(self.completed_callback) */ __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->timeout_handle); __Pyx_DECREF(__pyx_v_self->timeout_handle); __pyx_v_self->timeout_handle = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":634 * 'cannot perform operation: another operation is in progress') * self.waiter = self.create_future() * if timeout is not None: # <<<<<<<<<<<<<< * self.timeout_handle = self.connection._loop.call_later( * timeout, self.timeout_callback, self.waiter) */ } /* "asyncpg/protocol/protocol.pyx":637 * self.timeout_handle = self.connection._loop.call_later( * timeout, self.timeout_callback, self.waiter) * self.waiter.add_done_callback(self.completed_callback) # <<<<<<<<<<<<<< * return self.waiter * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_add_done_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_7) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->completed_callback); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_self->completed_callback}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_self->completed_callback}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_v_self->completed_callback); __Pyx_GIVEREF(__pyx_v_self->completed_callback); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->completed_callback); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__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; /* "asyncpg/protocol/protocol.pyx":638 * timeout, self.timeout_callback, self.waiter) * self.waiter.add_done_callback(self.completed_callback) * 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":629 * 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_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __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":640 * 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; __Pyx_RefNannySetupContext("_on_result__connect", 0); /* "asyncpg/protocol/protocol.pyx":641 * * cdef _on_result__connect(self, object waiter): * waiter.set_result(True) # <<<<<<<<<<<<<< * * cdef _on_result__prepare(self, object waiter): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":640 * 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":643 * waiter.set_result(True) * * cdef _on_result__prepare(self, object waiter): # <<<<<<<<<<<<<< * if ASYNCPG_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; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_on_result__prepare", 0); /* "asyncpg/protocol/protocol.pyx":644 * * cdef _on_result__prepare(self, object waiter): * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if self.statement is None: * raise apg_exc.InternalClientError( */ __pyx_t_1 = (ASYNCPG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":645 * cdef _on_result__prepare(self, object waiter): * if ASYNCPG_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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":646 * if ASYNCPG_DEBUG: * if self.statement is None: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_on_result__prepare: statement is None') * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 646, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":645 * cdef _on_result__prepare(self, object waiter): * if ASYNCPG_DEBUG: * if self.statement is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_on_result__prepare: statement is None') */ } /* "asyncpg/protocol/protocol.pyx":644 * * cdef _on_result__prepare(self, object waiter): * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if self.statement is None: * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/protocol.pyx":649 * '_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_2 = (__pyx_v_self->__pyx_base.result_param_desc != ((PyObject*)Py_None)); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":650 * * 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_3 = __pyx_v_self->__pyx_base.result_param_desc; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc(__pyx_v_self->statement, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":649 * '_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":651 * 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)); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":652 * self.statement._set_args_desc(self.result_param_desc) * if self.result_row_desc is not None: * self.statement._set_row_desc(self.result_row_desc) # <<<<<<<<<<<<<< * waiter.set_result(self.statement) * */ __pyx_t_4 = __pyx_v_self->__pyx_base.result_row_desc; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc(__pyx_v_self->statement, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":651 * 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":653 * if self.result_row_desc is not None: * self.statement._set_row_desc(self.result_row_desc) * waiter.set_result(self.statement) # <<<<<<<<<<<<<< * * cdef _on_result__bind_and_exec(self, object waiter): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_self->statement)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->statement)}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->statement)}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_self->statement)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->statement)); PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_self->statement)); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":643 * waiter.set_result(True) * * cdef _on_result__prepare(self, object waiter): # <<<<<<<<<<<<<< * if ASYNCPG_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_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __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":655 * 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 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; __Pyx_RefNannySetupContext("_on_result__bind_and_exec", 0); /* "asyncpg/protocol/protocol.pyx":656 * * cdef _on_result__bind_and_exec(self, object waiter): * if self.return_extra: # <<<<<<<<<<<<<< * waiter.set_result(( * self.result, */ __pyx_t_1 = (__pyx_v_self->return_extra != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":657 * cdef _on_result__bind_and_exec(self, object waiter): * if self.return_extra: * waiter.set_result(( # <<<<<<<<<<<<<< * self.result, * self.result_status_msg, */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/protocol.pyx":660 * self.result, * self.result_status_msg, * self.result_execute_completed)) # <<<<<<<<<<<<<< * else: * waiter.set_result(self.result) */ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.result_execute_completed); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/protocol.pyx":658 * if self.return_extra: * waiter.set_result(( * self.result, # <<<<<<<<<<<<<< * self.result_status_msg, * self.result_execute_completed)) */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->__pyx_base.result); __Pyx_INCREF(__pyx_v_self->__pyx_base.result_status_msg); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_status_msg); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->__pyx_base.result_status_msg); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":656 * * 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":662 * self.result_execute_completed)) * else: * waiter.set_result(self.result) # <<<<<<<<<<<<<< * * cdef _on_result__bind(self, object waiter): */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->__pyx_base.result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_self->__pyx_base.result}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_self->__pyx_base.result}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->__pyx_base.result); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":655 * 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_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.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":664 * waiter.set_result(self.result) * * cdef _on_result__bind(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_on_result__bind", 0); /* "asyncpg/protocol/protocol.pyx":665 * * cdef _on_result__bind(self, object waiter): * waiter.set_result(self.result) # <<<<<<<<<<<<<< * * cdef _on_result__close_stmt_or_portal(self, object waiter): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->__pyx_base.result}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->__pyx_base.result}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->__pyx_base.result); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":664 * waiter.set_result(self.result) * * cdef _on_result__bind(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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":667 * waiter.set_result(self.result) * * cdef _on_result__close_stmt_or_portal(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__close_stmt_or_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_on_result__close_stmt_or_portal", 0); /* "asyncpg/protocol/protocol.pyx":668 * * cdef _on_result__close_stmt_or_portal(self, object waiter): * waiter.set_result(self.result) # <<<<<<<<<<<<<< * * cdef _on_result__simple_query(self, object waiter): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->__pyx_base.result}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->__pyx_base.result}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->__pyx_base.result); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":667 * waiter.set_result(self.result) * * cdef _on_result__close_stmt_or_portal(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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":670 * waiter.set_result(self.result) * * cdef _on_result__simple_query(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result_status_msg.decode(self.encoding)) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_on_result__simple_query", 0); /* "asyncpg/protocol/protocol.pyx":671 * * cdef _on_result__simple_query(self, object waiter): * waiter.set_result(self.result_status_msg.decode(self.encoding)) # <<<<<<<<<<<<<< * * cdef _on_result__copy_out(self, object waiter): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.result_status_msg, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->__pyx_base.encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_self->__pyx_base.encoding}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_self->__pyx_base.encoding}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self->__pyx_base.encoding); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":670 * waiter.set_result(self.result) * * cdef _on_result__simple_query(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result_status_msg.decode(self.encoding)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __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":673 * 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 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; __Pyx_RefNannySetupContext("_on_result__copy_out", 0); /* "asyncpg/protocol/protocol.pyx":674 * * 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":675 * 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: */ __pyx_t_1 = (__pyx_v_copy_done != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":676 * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.result_status_msg, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->__pyx_base.encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->__pyx_base.encoding}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->__pyx_base.encoding}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->__pyx_base.encoding); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_status_msg = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":675 * 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":678 * status_msg = self.result_status_msg.decode(self.encoding) * else: * status_msg = None # <<<<<<<<<<<<<< * * # We need to put some backpressure on Postgres */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_status_msg = Py_None; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":682 * # 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_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":684 * self.pause_reading() * * waiter.set_result((self.result, copy_done, status_msg)) # <<<<<<<<<<<<<< * * cdef _on_result__copy_in(self, object waiter): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_copy_done); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __Pyx_INCREF(__pyx_v_status_msg); __Pyx_GIVEREF(__pyx_v_status_msg); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_status_msg); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":673 * 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_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.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":686 * waiter.set_result((self.result, copy_done, status_msg)) * * cdef _on_result__copy_in(self, object waiter): # <<<<<<<<<<<<<< * status_msg = self.result_status_msg.decode(self.encoding) * waiter.set_result(status_msg) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_v_status_msg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_on_result__copy_in", 0); /* "asyncpg/protocol/protocol.pyx":687 * * cdef _on_result__copy_in(self, object waiter): * status_msg = self.result_status_msg.decode(self.encoding) # <<<<<<<<<<<<<< * waiter.set_result(status_msg) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.result_status_msg, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->__pyx_base.encoding}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->__pyx_base.encoding}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->__pyx_base.encoding); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_status_msg = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":688 * cdef _on_result__copy_in(self, object waiter): * status_msg = self.result_status_msg.decode(self.encoding) * waiter.set_result(status_msg) # <<<<<<<<<<<<<< * * cdef _decode_row(self, const char* buf, ssize_t buf_len): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_status_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_status_msg}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_status_msg}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_status_msg); __Pyx_GIVEREF(__pyx_v_status_msg); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_status_msg); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __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; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":686 * waiter.set_result((self.result, copy_done, status_msg)) * * cdef _on_result__copy_in(self, object waiter): # <<<<<<<<<<<<<< * status_msg = self.result_status_msg.decode(self.encoding) * waiter.set_result(status_msg) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __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":690 * waiter.set_result(status_msg) * * cdef _decode_row(self, const char* buf, ssize_t buf_len): # <<<<<<<<<<<<<< * if ASYNCPG_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; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("_decode_row", 0); /* "asyncpg/protocol/protocol.pyx":691 * * cdef _decode_row(self, const char* buf, ssize_t buf_len): * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if self.statement is None: * raise apg_exc.InternalClientError( */ __pyx_t_1 = (ASYNCPG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":692 * cdef _decode_row(self, const char* buf, ssize_t buf_len): * if ASYNCPG_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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":693 * if ASYNCPG_DEBUG: * if self.statement is None: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_decode_row: statement is None') * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 693, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":692 * cdef _decode_row(self, const char* buf, ssize_t buf_len): * if ASYNCPG_DEBUG: * if self.statement is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_decode_row: statement is None') */ } /* "asyncpg/protocol/protocol.pyx":691 * * cdef _decode_row(self, const char* buf, ssize_t buf_len): * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if self.statement is None: * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/protocol.pyx":696 * '_decode_row: statement is None') * * return self.statement._decode_row(buf, buf_len) # <<<<<<<<<<<<<< * * cdef _dispatch_result(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row(__pyx_v_self->statement, __pyx_v_buf, __pyx_v_buf_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":690 * waiter.set_result(status_msg) * * cdef _decode_row(self, const char* buf, ssize_t buf_len): # <<<<<<<<<<<<<< * if ASYNCPG_DEBUG: * if self.statement is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._decode_row", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":698 * 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; 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; 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; __Pyx_RefNannySetupContext("_dispatch_result", 0); /* "asyncpg/protocol/protocol.pyx":699 * * 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":700 * cdef _dispatch_result(self): * waiter = self.waiter * self.waiter = None # <<<<<<<<<<<<<< * * if ASYNCPG_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":702 * self.waiter = None * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if waiter is None: * raise apg_exc.InternalClientError('_on_result: waiter is None') */ __pyx_t_2 = (ASYNCPG_DEBUG != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":703 * * if ASYNCPG_DEBUG: * if waiter is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is None') * */ __pyx_t_2 = (__pyx_v_waiter == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/protocol.pyx":704 * if ASYNCPG_DEBUG: * if waiter is None: * raise apg_exc.InternalClientError('_on_result: waiter is None') # <<<<<<<<<<<<<< * * if waiter.cancelled(): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 704, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":703 * * if ASYNCPG_DEBUG: * if waiter is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is None') * */ } /* "asyncpg/protocol/protocol.pyx":702 * self.waiter = None * * if ASYNCPG_DEBUG: # <<<<<<<<<<<<<< * if waiter is None: * raise apg_exc.InternalClientError('_on_result: waiter is None') */ } /* "asyncpg/protocol/protocol.pyx":706 * raise apg_exc.InternalClientError('_on_result: waiter is None') * * if waiter.cancelled(): # <<<<<<<<<<<<<< * return * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_cancelled); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "asyncpg/protocol/protocol.pyx":707 * * 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":706 * raise apg_exc.InternalClientError('_on_result: waiter is None') * * if waiter.cancelled(): # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/protocol.pyx":709 * return * * if waiter.done(): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is done') * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "asyncpg/protocol/protocol.pyx":710 * * if waiter.done(): * raise apg_exc.InternalClientError('_on_result: waiter is done') # <<<<<<<<<<<<<< * * if self.result_type == RESULT_FAILED: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 710, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":709 * return * * if waiter.done(): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is done') * */ } /* "asyncpg/protocol/protocol.pyx":712 * 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_3 = ((__pyx_v_self->__pyx_base.result_type == __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED) != 0); if (__pyx_t_3) { /* "asyncpg/protocol/protocol.pyx":713 * * 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_3 = PyDict_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":714 * if self.result_type == RESULT_FAILED: * if isinstance(self.result, dict): * exc = apg_exc_base.PostgresError.new( # <<<<<<<<<<<<<< * self.result, query=self.last_query) * else: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PostgresError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":715 * if isinstance(self.result, dict): * exc = apg_exc_base.PostgresError.new( * self.result, query=self.last_query) # <<<<<<<<<<<<<< * else: * exc = self.result */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->__pyx_base.result); __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_query, __pyx_v_self->last_query) < 0) __PYX_ERR(0, 715, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":714 * if self.result_type == RESULT_FAILED: * if isinstance(self.result, dict): * exc = apg_exc_base.PostgresError.new( # <<<<<<<<<<<<<< * self.result, query=self.last_query) * else: */ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 714, __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; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_exc = __pyx_t_6; __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":713 * * 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":717 * self.result, query=self.last_query) * else: * exc = self.result # <<<<<<<<<<<<<< * waiter.set_exception(exc) * return */ /*else*/ { __pyx_t_6 = __pyx_v_self->__pyx_base.result; __Pyx_INCREF(__pyx_t_6); __pyx_v_exc = __pyx_t_6; __pyx_t_6 = 0; } __pyx_L8:; /* "asyncpg/protocol/protocol.pyx":718 * else: * exc = self.result * waiter.set_exception(exc) # <<<<<<<<<<<<<< * return * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_4) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_exc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_exc}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_exc}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_exc); __Pyx_GIVEREF(__pyx_v_exc); PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_exc); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":719 * 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":712 * 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":721 * 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":722 * * 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":723 * try: * if self.state == PROTOCOL_AUTH: * self._on_result__connect(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_PREPARE: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__connect(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 723, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":722 * * try: * if self.state == PROTOCOL_AUTH: # <<<<<<<<<<<<<< * self._on_result__connect(waiter) * */ break; /* "asyncpg/protocol/protocol.pyx":725 * self._on_result__connect(waiter) * * elif self.state == PROTOCOL_PREPARE: # <<<<<<<<<<<<<< * self._on_result__prepare(waiter) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE: /* "asyncpg/protocol/protocol.pyx":726 * * elif self.state == PROTOCOL_PREPARE: * self._on_result__prepare(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_BIND_EXECUTE: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__prepare(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":725 * self._on_result__connect(waiter) * * elif self.state == PROTOCOL_PREPARE: # <<<<<<<<<<<<<< * self._on_result__prepare(waiter) * */ break; /* "asyncpg/protocol/protocol.pyx":728 * self._on_result__prepare(waiter) * * elif self.state == PROTOCOL_BIND_EXECUTE: # <<<<<<<<<<<<<< * self._on_result__bind_and_exec(waiter) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE: /* "asyncpg/protocol/protocol.pyx":729 * * elif self.state == PROTOCOL_BIND_EXECUTE: * self._on_result__bind_and_exec(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_BIND_EXECUTE_MANY: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind_and_exec(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 729, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":728 * self._on_result__prepare(waiter) * * elif self.state == PROTOCOL_BIND_EXECUTE: # <<<<<<<<<<<<<< * self._on_result__bind_and_exec(waiter) * */ break; /* "asyncpg/protocol/protocol.pyx":731 * self._on_result__bind_and_exec(waiter) * * elif self.state == PROTOCOL_BIND_EXECUTE_MANY: # <<<<<<<<<<<<<< * self._on_result__bind_and_exec(waiter) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE_MANY: /* "asyncpg/protocol/protocol.pyx":732 * * elif self.state == PROTOCOL_BIND_EXECUTE_MANY: * self._on_result__bind_and_exec(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_EXECUTE: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind_and_exec(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 732, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":731 * self._on_result__bind_and_exec(waiter) * * elif self.state == PROTOCOL_BIND_EXECUTE_MANY: # <<<<<<<<<<<<<< * self._on_result__bind_and_exec(waiter) * */ break; /* "asyncpg/protocol/protocol.pyx":734 * self._on_result__bind_and_exec(waiter) * * elif self.state == PROTOCOL_EXECUTE: # <<<<<<<<<<<<<< * self._on_result__bind_and_exec(waiter) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_EXECUTE: /* "asyncpg/protocol/protocol.pyx":735 * * elif self.state == PROTOCOL_EXECUTE: * self._on_result__bind_and_exec(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_BIND: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind_and_exec(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 735, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":734 * self._on_result__bind_and_exec(waiter) * * elif self.state == PROTOCOL_EXECUTE: # <<<<<<<<<<<<<< * self._on_result__bind_and_exec(waiter) * */ break; /* "asyncpg/protocol/protocol.pyx":737 * self._on_result__bind_and_exec(waiter) * * elif self.state == PROTOCOL_BIND: # <<<<<<<<<<<<<< * self._on_result__bind(waiter) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND: /* "asyncpg/protocol/protocol.pyx":738 * * elif self.state == PROTOCOL_BIND: * self._on_result__bind(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_CLOSE_STMT_PORTAL: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 738, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":737 * self._on_result__bind_and_exec(waiter) * * elif self.state == PROTOCOL_BIND: # <<<<<<<<<<<<<< * self._on_result__bind(waiter) * */ break; /* "asyncpg/protocol/protocol.pyx":740 * self._on_result__bind(waiter) * * elif self.state == PROTOCOL_CLOSE_STMT_PORTAL: # <<<<<<<<<<<<<< * self._on_result__close_stmt_or_portal(waiter) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CLOSE_STMT_PORTAL: /* "asyncpg/protocol/protocol.pyx":741 * * elif self.state == PROTOCOL_CLOSE_STMT_PORTAL: * self._on_result__close_stmt_or_portal(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_SIMPLE_QUERY: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__close_stmt_or_portal(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 741, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":740 * self._on_result__bind(waiter) * * elif self.state == PROTOCOL_CLOSE_STMT_PORTAL: # <<<<<<<<<<<<<< * self._on_result__close_stmt_or_portal(waiter) * */ break; /* "asyncpg/protocol/protocol.pyx":743 * self._on_result__close_stmt_or_portal(waiter) * * elif self.state == PROTOCOL_SIMPLE_QUERY: # <<<<<<<<<<<<<< * self._on_result__simple_query(waiter) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_SIMPLE_QUERY: /* "asyncpg/protocol/protocol.pyx":744 * * elif self.state == PROTOCOL_SIMPLE_QUERY: * self._on_result__simple_query(waiter) # <<<<<<<<<<<<<< * * elif (self.state == PROTOCOL_COPY_OUT_DATA or */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__simple_query(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 744, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":743 * self._on_result__close_stmt_or_portal(waiter) * * elif self.state == PROTOCOL_SIMPLE_QUERY: # <<<<<<<<<<<<<< * self._on_result__simple_query(waiter) * */ break; /* "asyncpg/protocol/protocol.pyx":746 * 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_DATA: /* "asyncpg/protocol/protocol.pyx":747 * * 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":748 * elif (self.state == PROTOCOL_COPY_OUT_DATA or * self.state == PROTOCOL_COPY_OUT_DONE): * self._on_result__copy_out(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_COPY_IN_DATA: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__copy_out(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":746 * 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; /* "asyncpg/protocol/protocol.pyx":750 * self._on_result__copy_out(waiter) * * elif self.state == PROTOCOL_COPY_IN_DATA: # <<<<<<<<<<<<<< * self._on_result__copy_in(waiter) * */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA: /* "asyncpg/protocol/protocol.pyx":751 * * elif self.state == PROTOCOL_COPY_IN_DATA: * self._on_result__copy_in(waiter) # <<<<<<<<<<<<<< * * else: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__copy_in(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 751, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":750 * self._on_result__copy_out(waiter) * * elif self.state == PROTOCOL_COPY_IN_DATA: # <<<<<<<<<<<<<< * self._on_result__copy_in(waiter) * */ break; default: /* "asyncpg/protocol/protocol.pyx":754 * * else: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'got result for unknown protocol state {}'. * format(self.state)) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":755 * else: * raise apg_exc.InternalClientError( * 'got result for unknown protocol state {}'. # <<<<<<<<<<<<<< * format(self.state)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_got_result_for_unknown_protocol, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/protocol.pyx":756 * raise apg_exc.InternalClientError( * 'got result for unknown protocol state {}'. * format(self.state)) # <<<<<<<<<<<<<< * * except Exception as exc: */ __pyx_t_10 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->__pyx_base.state); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 756, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_11) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L9_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_10}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 756, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_4) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 754, __pyx_L9_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 754, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 754, __pyx_L9_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 754, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 754, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 754, __pyx_L9_error) break; } /* "asyncpg/protocol/protocol.pyx":721 * 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_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":758 * format(self.state)) * * except Exception as exc: # <<<<<<<<<<<<<< * waiter.set_exception(exc) * */ __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_13) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._dispatch_result", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_12) < 0) __PYX_ERR(0, 758, __pyx_L11_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_v_exc = __pyx_t_1; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":759 * * except Exception as exc: * waiter.set_exception(exc) # <<<<<<<<<<<<<< * * cdef _on_result(self): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_10) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_exc}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L20_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_exc}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L20_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 759, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_exc); __Pyx_GIVEREF(__pyx_v_exc); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_exc); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "asyncpg/protocol/protocol.pyx":758 * format(self.state)) * * except Exception as exc: # <<<<<<<<<<<<<< * waiter.set_exception(exc) * */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_exc); __pyx_v_exc = NULL; goto __pyx_L21; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L20_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_DECREF(__pyx_v_exc); __pyx_v_exc = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L11_except_error; } __pyx_L21:; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L10_exception_handled; } goto __pyx_L11_except_error; __pyx_L11_except_error:; /* "asyncpg/protocol/protocol.pyx":721 * return * * try: # <<<<<<<<<<<<<< * if self.state == PROTOCOL_AUTH: * self._on_result__connect(waiter) */ __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":698 * 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_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __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":761 * 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; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; 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; __Pyx_RefNannySetupContext("_on_result", 0); /* "asyncpg/protocol/protocol.pyx":762 * * 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":763 * cdef _on_result(self): * if self.timeout_handle is not None: * self.timeout_handle.cancel() # <<<<<<<<<<<<<< * self.timeout_handle = None * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->timeout_handle, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":764 * 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":762 * * cdef _on_result(self): * if self.timeout_handle is not None: # <<<<<<<<<<<<<< * self.timeout_handle.cancel() * self.timeout_handle = None */ } /* "asyncpg/protocol/protocol.pyx":766 * self.timeout_handle = None * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * # We have received the result of a cancelled operation. * # Simply ignore the result. */ __pyx_t_2 = (__pyx_v_self->cancel_waiter != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":769 * # We have received the result of a cancelled operation. * # Simply ignore the result. * self.cancel_waiter.set_result(None) # <<<<<<<<<<<<<< * self.cancel_waiter = None * self.waiter = None */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->cancel_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":770 * # Simply ignore the result. * self.cancel_waiter.set_result(None) * self.cancel_waiter = None # <<<<<<<<<<<<<< * self.waiter = None * return */ __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":771 * self.cancel_waiter.set_result(None) * self.cancel_waiter = None * self.waiter = 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":772 * self.cancel_waiter = None * self.waiter = None * return # <<<<<<<<<<<<<< * * try: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":766 * self.timeout_handle = None * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * # We have received the result of a cancelled operation. * # Simply ignore the result. */ } /* "asyncpg/protocol/protocol.pyx":774 * return * * try: # <<<<<<<<<<<<<< * self._dispatch_result() * finally: */ /*try:*/ { /* "asyncpg/protocol/protocol.pyx":775 * * try: * self._dispatch_result() # <<<<<<<<<<<<<< * finally: * self.statement = None */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_dispatch_result(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/protocol.pyx":777 * 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(__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":778 * 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":779 * self.statement = None * self.last_query = None * self.return_extra = False # <<<<<<<<<<<<<< * * cdef _on_notice(self, parsed): */ __pyx_v_self->return_extra = 0; goto __pyx_L7; } /*exception exit:*/{ __Pyx_PyThreadState_declare __pyx_L6_error:; __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_PyThreadState_assign __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); if ((PY_MAJOR_VERSION < 3) || 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":777 * 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(__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":778 * 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":779 * self.statement = None * self.last_query = None * self.return_extra = False # <<<<<<<<<<<<<< * * cdef _on_notice(self, parsed): */ __pyx_v_self->return_extra = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_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_L7:; } /* "asyncpg/protocol/protocol.pyx":761 * 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_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __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":781 * self.return_extra = False * * cdef _on_notice(self, parsed): # <<<<<<<<<<<<<< * self.connection._process_log_message(parsed, self.last_query) * */ 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_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_on_notice", 0); /* "asyncpg/protocol/protocol.pyx":782 * * cdef _on_notice(self, parsed): * self.connection._process_log_message(parsed, self.last_query) # <<<<<<<<<<<<<< * * cdef _on_notification(self, pid, channel, payload): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->connection, __pyx_n_s_process_log_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_parsed, __pyx_v_self->last_query}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_parsed, __pyx_v_self->last_query}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_parsed); __Pyx_GIVEREF(__pyx_v_parsed); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_parsed); __Pyx_INCREF(__pyx_v_self->last_query); __Pyx_GIVEREF(__pyx_v_self->last_query); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_self->last_query); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":781 * self.return_extra = False * * cdef _on_notice(self, parsed): # <<<<<<<<<<<<<< * self.connection._process_log_message(parsed, self.last_query) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_notice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":784 * self.connection._process_log_message(parsed, self.last_query) * * cdef _on_notification(self, pid, channel, payload): # <<<<<<<<<<<<<< * self.connection._process_notification(pid, channel, payload) * */ 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_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_on_notification", 0); /* "asyncpg/protocol/protocol.pyx":785 * * cdef _on_notification(self, pid, channel, payload): * self.connection._process_notification(pid, channel, payload) # <<<<<<<<<<<<<< * * cdef _on_connection_lost(self, exc): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->connection, __pyx_n_s_process_notification); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_pid, __pyx_v_channel, __pyx_v_payload}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_pid, __pyx_v_channel, __pyx_v_payload}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_pid); __Pyx_GIVEREF(__pyx_v_pid); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_pid); __Pyx_INCREF(__pyx_v_channel); __Pyx_GIVEREF(__pyx_v_channel); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_channel); __Pyx_INCREF(__pyx_v_payload); __Pyx_GIVEREF(__pyx_v_payload); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_payload); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":784 * self.connection._process_log_message(parsed, self.last_query) * * cdef _on_notification(self, pid, channel, payload): # <<<<<<<<<<<<<< * self.connection._process_notification(pid, channel, payload) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_notification", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":787 * self.connection._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_r = NULL; __Pyx_RefNannyDeclarations int __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; __Pyx_RefNannySetupContext("_on_connection_lost", 0); /* "asyncpg/protocol/protocol.pyx":788 * * cdef _on_connection_lost(self, exc): * if self.closing: # <<<<<<<<<<<<<< * # The connection was lost because * # Protocol.close() was called */ __pyx_t_1 = (__pyx_v_self->closing != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":791 * # 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); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = ((!__pyx_t_3) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":792 * # 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); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":793 * if self.waiter is not None and not self.waiter.done(): * if exc is None: * self.waiter.set_result(None) # <<<<<<<<<<<<<< * else: * self.waiter.set_exception(exc) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":792 * # 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":795 * self.waiter.set_result(None) * else: * self.waiter.set_exception(exc) # <<<<<<<<<<<<<< * self.waiter = None * else: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_exc}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_exc}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_exc); __Pyx_GIVEREF(__pyx_v_exc); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_exc); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L7:; /* "asyncpg/protocol/protocol.pyx":791 * # 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":796 * 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":788 * * 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":801 * # terminated or due to another error; * # Throw an error in any awaiting waiter. * self.closing = True # <<<<<<<<<<<<<< * self._handle_waiter_on_connection_lost(exc) * */ /*else*/ { __pyx_v_self->closing = 1; /* "asyncpg/protocol/protocol.pyx":802 * # Throw an error in any awaiting waiter. * self.closing = True * self._handle_waiter_on_connection_lost(exc) # <<<<<<<<<<<<<< * * def pause_writing(self): */ __pyx_t_5 = ((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_5)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":787 * self.connection._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_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":804 * self._handle_waiter_on_connection_lost(exc) * * def pause_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.clear() * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_57pause_writing(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_57pause_writing(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause_writing (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_56pause_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_56pause_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; __Pyx_RefNannySetupContext("pause_writing", 0); /* "asyncpg/protocol/protocol.pyx":805 * * def pause_writing(self): * self.writing_allowed.clear() # <<<<<<<<<<<<<< * * def resume_writing(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":804 * self._handle_waiter_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":807 * self.writing_allowed.clear() * * def resume_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.set() * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_59resume_writing(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_59resume_writing(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resume_writing (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_58resume_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_58resume_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; __Pyx_RefNannySetupContext("resume_writing", 0); /* "asyncpg/protocol/protocol.pyx":808 * * def resume_writing(self): * self.writing_allowed.set() # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":807 * 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.pxd":47 * bint closing * * readonly uint64_t queries_count # <<<<<<<<<<<<<< * * PreparedStatementState statement */ /* 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) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __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; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->queries_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 47, __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 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.cancel_sent_waiter, self.cancel_waiter, self.closing, self.completed_callback, self.con_params, self.con_status, self.connection, self.create_future, self.encoding, self.is_reading, self.last_query, self.loop, self.queries_count, 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.settings, self.state, self.statement, self.timeout_callback, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_61__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_61__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_60__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_60__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { int __pyx_v_use_setstate; PyObject *__pyx_v_state = NULL; PyObject *__pyx_v__dict = 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; 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_t_16; int __pyx_t_17; int __pyx_t_18; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":3 * def __reduce_cython__(self): * 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.cancel_sent_waiter, self.cancel_waiter, self.closing, self.completed_callback, self.con_params, self.con_status, self.connection, self.create_future, self.encoding, self.is_reading, self.last_query, self.loop, self.queries_count, 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.settings, self.state, self.statement, self.timeout_callback, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base._discard_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base._skip_discard); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_self->__pyx_base.backend_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_self->__pyx_base.backend_secret); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->closing); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_v_self->__pyx_base.con_status); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->is_reading); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->queries_count); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.result_execute_completed); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_v_self->__pyx_base.result_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_self->return_extra); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->__pyx_base.state); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyBool_FromLong(__pyx_v_self->writing_paused); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_v_self->__pyx_base.xact_status); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = PyTuple_New(38); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_self->__pyx_base._execute_iter); __Pyx_GIVEREF(__pyx_v_self->__pyx_base._execute_iter); PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_self->__pyx_base._execute_iter); __Pyx_INCREF(__pyx_v_self->__pyx_base._execute_portal_name); __Pyx_GIVEREF(__pyx_v_self->__pyx_base._execute_portal_name); PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_self->__pyx_base._execute_portal_name); __Pyx_INCREF(__pyx_v_self->__pyx_base._execute_stmt_name); __Pyx_GIVEREF(__pyx_v_self->__pyx_base._execute_stmt_name); PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_v_self->__pyx_base._execute_stmt_name); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_2); __Pyx_INCREF(__pyx_v_self->address); __Pyx_GIVEREF(__pyx_v_self->address); PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_v_self->address); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_15, 6, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 7, __pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.buffer)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.buffer)); PyTuple_SET_ITEM(__pyx_t_15, 8, ((PyObject *)__pyx_v_self->__pyx_base.buffer)); __Pyx_INCREF(__pyx_v_self->cancel_sent_waiter); __Pyx_GIVEREF(__pyx_v_self->cancel_sent_waiter); PyTuple_SET_ITEM(__pyx_t_15, 9, __pyx_v_self->cancel_sent_waiter); __Pyx_INCREF(__pyx_v_self->cancel_waiter); __Pyx_GIVEREF(__pyx_v_self->cancel_waiter); PyTuple_SET_ITEM(__pyx_t_15, 10, __pyx_v_self->cancel_waiter); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_15, 11, __pyx_t_5); __Pyx_INCREF(__pyx_v_self->completed_callback); __Pyx_GIVEREF(__pyx_v_self->completed_callback); PyTuple_SET_ITEM(__pyx_t_15, 12, __pyx_v_self->completed_callback); __Pyx_INCREF(__pyx_v_self->__pyx_base.con_params); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.con_params); PyTuple_SET_ITEM(__pyx_t_15, 13, __pyx_v_self->__pyx_base.con_params); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_15, 14, __pyx_t_6); __Pyx_INCREF(__pyx_v_self->connection); __Pyx_GIVEREF(__pyx_v_self->connection); PyTuple_SET_ITEM(__pyx_t_15, 15, __pyx_v_self->connection); __Pyx_INCREF(__pyx_v_self->create_future); __Pyx_GIVEREF(__pyx_v_self->create_future); PyTuple_SET_ITEM(__pyx_t_15, 16, __pyx_v_self->create_future); __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); PyTuple_SET_ITEM(__pyx_t_15, 17, __pyx_v_self->__pyx_base.encoding); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_15, 18, __pyx_t_7); __Pyx_INCREF(__pyx_v_self->last_query); __Pyx_GIVEREF(__pyx_v_self->last_query); PyTuple_SET_ITEM(__pyx_t_15, 19, __pyx_v_self->last_query); __Pyx_INCREF(__pyx_v_self->loop); __Pyx_GIVEREF(__pyx_v_self->loop); PyTuple_SET_ITEM(__pyx_t_15, 20, __pyx_v_self->loop); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_15, 21, __pyx_t_8); __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); PyTuple_SET_ITEM(__pyx_t_15, 22, __pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_15, 23, __pyx_t_9); __Pyx_INCREF(__pyx_v_self->__pyx_base.result_param_desc); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_param_desc); PyTuple_SET_ITEM(__pyx_t_15, 24, __pyx_v_self->__pyx_base.result_param_desc); __Pyx_INCREF(__pyx_v_self->__pyx_base.result_row_desc); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_row_desc); PyTuple_SET_ITEM(__pyx_t_15, 25, __pyx_v_self->__pyx_base.result_row_desc); __Pyx_INCREF(__pyx_v_self->__pyx_base.result_status_msg); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_status_msg); PyTuple_SET_ITEM(__pyx_t_15, 26, __pyx_v_self->__pyx_base.result_status_msg); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_15, 27, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_15, 28, __pyx_t_11); __Pyx_INCREF(((PyObject *)__pyx_v_self->settings)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->settings)); PyTuple_SET_ITEM(__pyx_t_15, 29, ((PyObject *)__pyx_v_self->settings)); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_15, 30, __pyx_t_12); __Pyx_INCREF(((PyObject *)__pyx_v_self->statement)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->statement)); PyTuple_SET_ITEM(__pyx_t_15, 31, ((PyObject *)__pyx_v_self->statement)); __Pyx_INCREF(__pyx_v_self->timeout_callback); __Pyx_GIVEREF(__pyx_v_self->timeout_callback); PyTuple_SET_ITEM(__pyx_t_15, 32, __pyx_v_self->timeout_callback); __Pyx_INCREF(__pyx_v_self->timeout_handle); __Pyx_GIVEREF(__pyx_v_self->timeout_handle); PyTuple_SET_ITEM(__pyx_t_15, 33, __pyx_v_self->timeout_handle); __Pyx_INCREF(__pyx_v_self->__pyx_base.transport); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.transport); PyTuple_SET_ITEM(__pyx_t_15, 34, __pyx_v_self->__pyx_base.transport); __Pyx_INCREF(__pyx_v_self->waiter); __Pyx_GIVEREF(__pyx_v_self->waiter); PyTuple_SET_ITEM(__pyx_t_15, 35, __pyx_v_self->waiter); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 36, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 37, __pyx_t_14); __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_v_state = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; /* "(tree fragment)":4 * 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.cancel_sent_waiter, self.cancel_waiter, self.closing, self.completed_callback, self.con_params, self.con_status, self.connection, self.create_future, self.encoding, self.is_reading, self.last_query, self.loop, self.queries_count, 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.settings, self.state, self.statement, self.timeout_callback, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_15 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_v__dict = __pyx_t_15; __pyx_t_15 = 0; /* "(tree fragment)":5 * 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.cancel_sent_waiter, self.cancel_waiter, self.closing, self.completed_callback, self.con_params, self.con_status, self.connection, self.create_future, self.encoding, self.is_reading, self.last_query, self.loop, self.queries_count, 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.settings, self.state, self.statement, self.timeout_callback, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_16 = (__pyx_v__dict != Py_None); __pyx_t_17 = (__pyx_t_16 != 0); if (__pyx_t_17) { /* "(tree fragment)":6 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v__dict); __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_14)); __pyx_t_14 = 0; /* "(tree fragment)":7 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.completed_callback is not None or self.con_params is not None or self.connection is not None or self.create_future is not None or self.encoding is not None or self.last_query is not None or self.loop 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.settings is not None or self.statement is not None or self.timeout_callback 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)":5 * 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.cancel_sent_waiter, self.cancel_waiter, self.closing, self.completed_callback, self.con_params, self.con_status, self.connection, self.create_future, self.encoding, self.is_reading, self.last_query, self.loop, self.queries_count, 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.settings, self.state, self.statement, self.timeout_callback, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":9 * 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.completed_callback is not None or self.con_params is not None or self.connection is not None or self.create_future is not None or self.encoding is not None or self.last_query is not None or self.loop 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.settings is not None or self.statement is not None or self.timeout_callback 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), 0x30f806c, None), state */ /*else*/ { __pyx_t_16 = (__pyx_v_self->__pyx_base._execute_iter != Py_None); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base._execute_portal_name != ((PyObject*)Py_None)); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (__pyx_v_self->__pyx_base._execute_stmt_name != ((PyObject*)Py_None)); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->address != Py_None); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (((PyObject *)__pyx_v_self->__pyx_base.buffer) != Py_None); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (__pyx_v_self->cancel_waiter != Py_None); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->completed_callback != Py_None); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (__pyx_v_self->__pyx_base.con_params != Py_None); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->connection != Py_None); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (__pyx_v_self->create_future != Py_None); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.encoding != ((PyObject*)Py_None)); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (__pyx_v_self->last_query != ((PyObject*)Py_None)); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->loop != Py_None); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (__pyx_v_self->__pyx_base.result != Py_None); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.result_param_desc != ((PyObject*)Py_None)); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (__pyx_v_self->__pyx_base.result_row_desc != ((PyObject*)Py_None)); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.result_status_msg != ((PyObject*)Py_None)); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (((PyObject *)__pyx_v_self->settings) != Py_None); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (((PyObject *)__pyx_v_self->statement) != Py_None); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (__pyx_v_self->timeout_callback != Py_None); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->timeout_handle != Py_None); __pyx_t_16 = (__pyx_t_18 != 0); if (!__pyx_t_16) { } else { __pyx_t_17 = __pyx_t_16; goto __pyx_L4_bool_binop_done; } __pyx_t_16 = (__pyx_v_self->__pyx_base.transport != Py_None); __pyx_t_18 = (__pyx_t_16 != 0); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->waiter != Py_None); __pyx_t_16 = (__pyx_t_18 != 0); __pyx_t_17 = __pyx_t_16; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_17; } __pyx_L3:; /* "(tree fragment)":10 * 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.completed_callback is not None or self.con_params is not None or self.connection is not None or self.create_future is not None or self.encoding is not None or self.last_query is not None or self.loop 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.settings is not None or self.statement is not None or self.timeout_callback 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), 0x30f806c, None), state * else: */ __pyx_t_17 = (__pyx_v_use_setstate != 0); if (__pyx_t_17) { /* "(tree fragment)":11 * 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.completed_callback is not None or self.con_params is not None or self.connection is not None or self.create_future is not None or self.encoding is not None or self.last_query is not None or self.loop 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.settings is not None or self.statement is not None or self.timeout_callback 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), 0x30f806c, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_BaseProtocol, (type(self), 0x30f806c, state) */ __Pyx_XDECREF(__pyx_r); __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_BaseProtocol); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_51347564); __Pyx_GIVEREF(__pyx_int_51347564); PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_int_51347564); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_15, 2, Py_None); __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_15); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_state); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_r = __pyx_t_13; __pyx_t_13 = 0; goto __pyx_L0; /* "(tree fragment)":10 * 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.completed_callback is not None or self.con_params is not None or self.connection is not None or self.create_future is not None or self.encoding is not None or self.last_query is not None or self.loop 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.settings is not None or self.statement is not None or self.timeout_callback 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), 0x30f806c, None), state * else: */ } /* "(tree fragment)":13 * return __pyx_unpickle_BaseProtocol, (type(self), 0x30f806c, None), state * else: * return __pyx_unpickle_BaseProtocol, (type(self), 0x30f806c, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_BaseProtocol); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_51347564); __Pyx_GIVEREF(__pyx_int_51347564); PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_int_51347564); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_state); __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_15 = 0; __pyx_r = __pyx_t_14; __pyx_t_14 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * 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.cancel_sent_waiter, self.cancel_waiter, self.closing, self.completed_callback, self.con_params, self.con_status, self.connection, self.create_future, self.encoding, self.is_reading, self.last_query, self.loop, self.queries_count, 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.settings, self.state, self.statement, self.timeout_callback, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status) */ /* 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_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)":14 * else: * return __pyx_unpickle_BaseProtocol, (type(self), 0x30f806c, 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_63__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_63__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_62__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_62__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; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":15 * return __pyx_unpickle_BaseProtocol, (type(self), 0x30f806c, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 15, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":14 * else: * return __pyx_unpickle_BaseProtocol, (type(self), 0x30f806c, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":812 * * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_budget = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_budget,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_budget)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 812, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 812, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_budget = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 812, __pyx_L3_error) __pyx_L3_error:; __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 */ __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 __Pyx_RefNannySetupContext("__init__", 0); /* "asyncpg/protocol/protocol.pyx":813 * class Timer: * def __init__(self, budget): * self._budget = budget # <<<<<<<<<<<<<< * self._started = 0 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_budget_2, __pyx_v_budget) < 0) __PYX_ERR(0, 813, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":814 * def __init__(self, budget): * self._budget = budget * self._started = 0 # <<<<<<<<<<<<<< * * def __enter__(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_started, __pyx_int_0) < 0) __PYX_ERR(0, 814, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":812 * * 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":816 * 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, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_3__enter__ = {"__enter__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_3__enter__, METH_O, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_3__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer_2__enter__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __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; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__enter__", 0); /* "asyncpg/protocol/protocol.pyx":817 * * def __enter__(self): * if self._budget is not None: # <<<<<<<<<<<<<< * self._started = time.monotonic() * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __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; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/protocol.pyx":818 * def __enter__(self): * if self._budget is not None: * self._started = time.monotonic() # <<<<<<<<<<<<<< * * def __exit__(self, et, e, tb): */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_monotonic); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_started, __pyx_t_1) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":817 * * def __enter__(self): * if self._budget is not None: # <<<<<<<<<<<<<< * self._started = time.monotonic() * */ } /* "asyncpg/protocol/protocol.pyx":816 * 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_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":820 * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_5__exit__ = {"__exit__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_5__exit__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_5__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { 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; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_et,&__pyx_n_s_e,&__pyx_n_s_tb,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_et)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 1); __PYX_ERR(0, 820, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 2); __PYX_ERR(0, 820, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 3); __PYX_ERR(0, 820, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 820, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_self = values[0]; __pyx_v_et = values[1]; __pyx_v_e = values[2]; __pyx_v_tb = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 820, __pyx_L3_error) __pyx_L3_error:; __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 */ __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; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__exit__", 0); /* "asyncpg/protocol/protocol.pyx":821 * * def __exit__(self, et, e, tb): * if self._budget is not None: # <<<<<<<<<<<<<< * self._budget -= time.monotonic() - self._started * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __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; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "asyncpg/protocol/protocol.pyx":822 * def __exit__(self, et, e, tb): * if self._budget is not None: * self._budget -= time.monotonic() - self._started # <<<<<<<<<<<<<< * * def get_remaining_budget(self): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_monotonic); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_started); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_budget_2, __pyx_t_6) < 0) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":821 * * def __exit__(self, et, e, tb): * if self._budget is not None: # <<<<<<<<<<<<<< * self._budget -= time.monotonic() - self._started * */ } /* "asyncpg/protocol/protocol.pyx":820 * 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_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":824 * 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, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget = {"get_remaining_budget", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget, METH_O, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_remaining_budget (wrapper)", 0); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer_6get_remaining_budget(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __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; __Pyx_RefNannySetupContext("get_remaining_budget", 0); /* "asyncpg/protocol/protocol.pyx":825 * * def get_remaining_budget(self): * return self._budget # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":824 * 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":832 * * * 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_1_create_record = {"_create_record", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_1_create_record, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_1_create_record(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mapping = 0; PyObject *__pyx_v_elems = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_create_record (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mapping,&__pyx_n_s_elems,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapping)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elems)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_create_record", 1, 2, 2, 1); __PYX_ERR(0, 832, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_record") < 0)) __PYX_ERR(0, 832, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_mapping = values[0]; __pyx_v_elems = ((PyObject*)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_create_record", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 832, __pyx_L3_error) __pyx_L3_error:; __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, 832, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol__create_record(__pyx_self, __pyx_v_mapping, __pyx_v_elems); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __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; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; int32_t __pyx_t_6; __Pyx_RefNannySetupContext("_create_record", 0); /* "asyncpg/protocol/protocol.pyx":839 * int32_t i * * if mapping is None: # <<<<<<<<<<<<<< * desc = record.ApgRecordDesc_New({}, ()) * else: */ __pyx_t_1 = (__pyx_v_mapping == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":840 * * if mapping is None: * desc = record.ApgRecordDesc_New({}, ()) # <<<<<<<<<<<<<< * else: * desc = record.ApgRecordDesc_New( */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ApgRecordDesc_New(__pyx_t_3, __pyx_empty_tuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_desc = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":839 * int32_t i * * if mapping is None: # <<<<<<<<<<<<<< * desc = record.ApgRecordDesc_New({}, ()) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":842 * desc = record.ApgRecordDesc_New({}, ()) * else: * desc = record.ApgRecordDesc_New( # <<<<<<<<<<<<<< * mapping, tuple(mapping) if mapping else ()) * */ /*else*/ { /* "asyncpg/protocol/protocol.pyx":843 * else: * desc = record.ApgRecordDesc_New( * mapping, tuple(mapping) if mapping else ()) # <<<<<<<<<<<<<< * * rec = record.ApgRecord_New(desc, len(elems)) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_mapping); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 843, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_mapping); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_empty_tuple); __pyx_t_4 = __pyx_empty_tuple; } /* "asyncpg/protocol/protocol.pyx":842 * desc = record.ApgRecordDesc_New({}, ()) * else: * desc = record.ApgRecordDesc_New( # <<<<<<<<<<<<<< * mapping, tuple(mapping) if mapping else ()) * */ __pyx_t_3 = ApgRecordDesc_New(__pyx_v_mapping, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_desc = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":845 * mapping, tuple(mapping) if mapping else ()) * * rec = record.ApgRecord_New(desc, len(elems)) # <<<<<<<<<<<<<< * for i in range(len(elems)): * elem = elems[i] */ if (unlikely(__pyx_v_elems == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 845, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_elems); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 845, __pyx_L1_error) __pyx_t_3 = ApgRecord_New(__pyx_v_desc, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rec = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":846 * * rec = record.ApgRecord_New(desc, len(elems)) * for i in range(len(elems)): # <<<<<<<<<<<<<< * elem = elems[i] * cpython.Py_INCREF(elem) */ if (unlikely(__pyx_v_elems == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 846, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_elems); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 846, __pyx_L1_error) for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "asyncpg/protocol/protocol.pyx":847 * rec = record.ApgRecord_New(desc, len(elems)) * for i in range(len(elems)): * elem = elems[i] # <<<<<<<<<<<<<< * cpython.Py_INCREF(elem) * record.ApgRecord_SET_ITEM(rec, i, elem) */ if (unlikely(__pyx_v_elems == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 847, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_elems, __pyx_v_i, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":848 * for i in range(len(elems)): * elem = elems[i] * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * record.ApgRecord_SET_ITEM(rec, i, elem) * return rec */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/protocol.pyx":849 * elem = elems[i] * cpython.Py_INCREF(elem) * record.ApgRecord_SET_ITEM(rec, i, elem) # <<<<<<<<<<<<<< * return rec * */ ApgRecord_SET_ITEM(__pyx_v_rec, __pyx_v_i, __pyx_v_elem); } /* "asyncpg/protocol/protocol.pyx":850 * cpython.Py_INCREF(elem) * record.ApgRecord_SET_ITEM(rec, i, elem) * return rec # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rec); __pyx_r = __pyx_v_rec; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":832 * * * def _create_record(object mapping, tuple elems): # <<<<<<<<<<<<<< * # Exposed only for testing purposes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol._create_record", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rec); __Pyx_XDECREF(__pyx_v_desc); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_Memory(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0xe0abff4: * from pickle import PickleError as __pyx_PickleError */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_3__pyx_unpickle_Memory(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_3__pyx_unpickle_Memory = {"__pyx_unpickle_Memory", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_3__pyx_unpickle_Memory, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_3__pyx_unpickle_Memory(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_Memory (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Memory", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Memory", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Memory") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Memory", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_Memory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_2__pyx_unpickle_Memory(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_2__pyx_unpickle_Memory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = NULL; PyObject *__pyx_v___pyx_result = 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; int __pyx_t_7; __Pyx_RefNannySetupContext("__pyx_unpickle_Memory", 0); /* "(tree fragment)":2 * def __pyx_unpickle_Memory(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0xe0abff4: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0abff4 = (buf, length, owner))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xe0abff4) != 0); if (__pyx_t_1) { /* "(tree fragment)":3 * def __pyx_unpickle_Memory(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0xe0abff4: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0abff4 = (buf, length, owner))" % __pyx_checksum) * __pyx_result = Memory.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":4 * if __pyx_checksum != 0xe0abff4: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0abff4 = (buf, length, owner))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = Memory.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xe0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":2 * def __pyx_unpickle_Memory(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0xe0abff4: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0abff4 = (buf, length, owner))" % __pyx_checksum) */ } /* "(tree fragment)":5 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0abff4 = (buf, length, owner))" % __pyx_checksum) * __pyx_result = Memory.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_Memory__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Memory), __pyx_n_s_new_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v___pyx_type); __Pyx_GIVEREF(__pyx_v___pyx_type); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __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_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":6 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0abff4 = (buf, length, owner))" % __pyx_checksum) * __pyx_result = Memory.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Memory__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_7 = (__pyx_t_1 != 0); if (__pyx_t_7) { /* "(tree fragment)":7 * __pyx_result = Memory.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_Memory__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_Memory__set_state(Memory __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 7, __pyx_L1_error) __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_Memory__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0abff4 = (buf, length, owner))" % __pyx_checksum) * __pyx_result = Memory.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Memory__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":8 * if __pyx_state is not None: * __pyx_unpickle_Memory__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_Memory__set_state(Memory __pyx_result, tuple __pyx_state): * __pyx_result.buf = __pyx_state[0]; __pyx_result.length = __pyx_state[1]; __pyx_result.owner = __pyx_state[2] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_Memory(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0xe0abff4: * from pickle import PickleError as __pyx_PickleError */ /* 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.__pyx_unpickle_Memory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":9 * __pyx_unpickle_Memory__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Memory__set_state(Memory __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.buf = __pyx_state[0]; __pyx_result.length = __pyx_state[1]; __pyx_result.owner = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_Memory__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; Py_ssize_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; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("__pyx_unpickle_Memory__set_state", 0); /* "(tree fragment)":10 * return __pyx_result * cdef __pyx_unpickle_Memory__set_state(Memory __pyx_result, tuple __pyx_state): * __pyx_result.buf = __pyx_state[0]; __pyx_result.length = __pyx_state[1]; __pyx_result.owner = __pyx_state[2] # <<<<<<<<<<<<<< * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[3]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __pyx_v___pyx_result->buf = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->length = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->owner); __Pyx_DECREF(__pyx_v___pyx_result->owner); __pyx_v___pyx_result->owner = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":11 * cdef __pyx_unpickle_Memory__set_state(Memory __pyx_result, tuple __pyx_state): * __pyx_result.buf = __pyx_state[0]; __pyx_result.length = __pyx_state[1]; __pyx_result.owner = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[3]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 11, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_5 > 3) != 0); if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_4 = __pyx_t_7; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "(tree fragment)":12 * __pyx_result.buf = __pyx_state[0]; __pyx_result.length = __pyx_state[1]; __pyx_result.owner = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[3]) # <<<<<<<<<<<<<< */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_10) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":11 * cdef __pyx_unpickle_Memory__set_state(Memory __pyx_result, tuple __pyx_state): * __pyx_result.buf = __pyx_state[0]; __pyx_result.length = __pyx_state[1]; __pyx_result.owner = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[3]) */ } /* "(tree fragment)":9 * __pyx_unpickle_Memory__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Memory__set_state(Memory __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.buf = __pyx_state[0]; __pyx_result.length = __pyx_state[1]; __pyx_result.owner = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_Memory__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_FastReadBuffer(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0x7ea5e72: * from pickle import PickleError as __pyx_PickleError */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5__pyx_unpickle_FastReadBuffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5__pyx_unpickle_FastReadBuffer = {"__pyx_unpickle_FastReadBuffer", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_5__pyx_unpickle_FastReadBuffer, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5__pyx_unpickle_FastReadBuffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_FastReadBuffer (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FastReadBuffer", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FastReadBuffer", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_FastReadBuffer") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FastReadBuffer", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_FastReadBuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_4__pyx_unpickle_FastReadBuffer(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_4__pyx_unpickle_FastReadBuffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = NULL; PyObject *__pyx_v___pyx_result = 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; int __pyx_t_7; __Pyx_RefNannySetupContext("__pyx_unpickle_FastReadBuffer", 0); /* "(tree fragment)":2 * def __pyx_unpickle_FastReadBuffer(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0x7ea5e72: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x7ea5e72 = (buf, len))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x7ea5e72) != 0); if (__pyx_t_1) { /* "(tree fragment)":3 * def __pyx_unpickle_FastReadBuffer(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0x7ea5e72: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0x7ea5e72 = (buf, len))" % __pyx_checksum) * __pyx_result = FastReadBuffer.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":4 * if __pyx_checksum != 0x7ea5e72: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x7ea5e72 = (buf, len))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = FastReadBuffer.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x7e, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":2 * def __pyx_unpickle_FastReadBuffer(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0x7ea5e72: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x7ea5e72 = (buf, len))" % __pyx_checksum) */ } /* "(tree fragment)":5 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x7ea5e72 = (buf, len))" % __pyx_checksum) * __pyx_result = FastReadBuffer.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_FastReadBuffer__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_FastReadBuffer), __pyx_n_s_new_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v___pyx_type); __Pyx_GIVEREF(__pyx_v___pyx_type); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __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_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":6 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x7ea5e72 = (buf, len))" % __pyx_checksum) * __pyx_result = FastReadBuffer.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_FastReadBuffer__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_7 = (__pyx_t_1 != 0); if (__pyx_t_7) { /* "(tree fragment)":7 * __pyx_result = FastReadBuffer.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_FastReadBuffer__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_FastReadBuffer__set_state(FastReadBuffer __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 7, __pyx_L1_error) __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_FastReadBuffer__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x7ea5e72 = (buf, len))" % __pyx_checksum) * __pyx_result = FastReadBuffer.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_FastReadBuffer__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":8 * if __pyx_state is not None: * __pyx_unpickle_FastReadBuffer__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_FastReadBuffer__set_state(FastReadBuffer __pyx_result, tuple __pyx_state): * __pyx_result.buf = __pyx_state[0]; __pyx_result.len = __pyx_state[1] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_FastReadBuffer(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0x7ea5e72: * from pickle import PickleError as __pyx_PickleError */ /* 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.__pyx_unpickle_FastReadBuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":9 * __pyx_unpickle_FastReadBuffer__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_FastReadBuffer__set_state(FastReadBuffer __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.buf = __pyx_state[0]; __pyx_result.len = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_FastReadBuffer__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; Py_ssize_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; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("__pyx_unpickle_FastReadBuffer__set_state", 0); /* "(tree fragment)":10 * return __pyx_result * cdef __pyx_unpickle_FastReadBuffer__set_state(FastReadBuffer __pyx_result, tuple __pyx_state): * __pyx_result.buf = __pyx_state[0]; __pyx_result.len = __pyx_state[1] # <<<<<<<<<<<<<< * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[2]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __pyx_v___pyx_result->buf = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyInt_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->len = __pyx_t_3; /* "(tree fragment)":11 * cdef __pyx_unpickle_FastReadBuffer__set_state(FastReadBuffer __pyx_result, tuple __pyx_state): * __pyx_result.buf = __pyx_state[0]; __pyx_result.len = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[2]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 11, __pyx_L1_error) } __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_5 > 2) != 0); if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_4 = __pyx_t_7; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "(tree fragment)":12 * __pyx_result.buf = __pyx_state[0]; __pyx_result.len = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_10) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":11 * cdef __pyx_unpickle_FastReadBuffer__set_state(FastReadBuffer __pyx_result, tuple __pyx_state): * __pyx_result.buf = __pyx_state[0]; __pyx_result.len = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[2]) */ } /* "(tree fragment)":9 * __pyx_unpickle_FastReadBuffer__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_FastReadBuffer__set_state(FastReadBuffer __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.buf = __pyx_state[0]; __pyx_result.len = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_FastReadBuffer__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0xb75bfc9: * from pickle import PickleError as __pyx_PickleError */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_7__pyx_unpickle_DataCodecConfig(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_7__pyx_unpickle_DataCodecConfig = {"__pyx_unpickle_DataCodecConfig", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_7__pyx_unpickle_DataCodecConfig, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_7__pyx_unpickle_DataCodecConfig(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DataCodecConfig", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DataCodecConfig", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_DataCodecConfig") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DataCodecConfig", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_DataCodecConfig", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_6__pyx_unpickle_DataCodecConfig(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_6__pyx_unpickle_DataCodecConfig(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = NULL; PyObject *__pyx_v___pyx_result = 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; int __pyx_t_7; __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig", 0); /* "(tree fragment)":2 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0xb75bfc9: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb75bfc9 = (_local_type_codecs, _type_codecs_cache))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb75bfc9) != 0); if (__pyx_t_1) { /* "(tree fragment)":3 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0xb75bfc9: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb75bfc9 = (_local_type_codecs, _type_codecs_cache))" % __pyx_checksum) * __pyx_result = DataCodecConfig.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":4 * if __pyx_checksum != 0xb75bfc9: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb75bfc9 = (_local_type_codecs, _type_codecs_cache))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = DataCodecConfig.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":2 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0xb75bfc9: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb75bfc9 = (_local_type_codecs, _type_codecs_cache))" % __pyx_checksum) */ } /* "(tree fragment)":5 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb75bfc9 = (_local_type_codecs, _type_codecs_cache))" % __pyx_checksum) * __pyx_result = DataCodecConfig.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig), __pyx_n_s_new_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v___pyx_type); __Pyx_GIVEREF(__pyx_v___pyx_type); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __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_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":6 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb75bfc9 = (_local_type_codecs, _type_codecs_cache))" % __pyx_checksum) * __pyx_result = DataCodecConfig.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_7 = (__pyx_t_1 != 0); if (__pyx_t_7) { /* "(tree fragment)":7 * __pyx_result = DataCodecConfig.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 7, __pyx_L1_error) __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb75bfc9 = (_local_type_codecs, _type_codecs_cache))" % __pyx_checksum) * __pyx_result = DataCodecConfig.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":8 * if __pyx_state is not None: * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): * __pyx_result._local_type_codecs = __pyx_state[0]; __pyx_result._type_codecs_cache = __pyx_state[1] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0xb75bfc9: * from pickle import PickleError as __pyx_PickleError */ /* 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.__pyx_unpickle_DataCodecConfig", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":9 * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._local_type_codecs = __pyx_state[0]; __pyx_result._type_codecs_cache = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig__set_state", 0); /* "(tree fragment)":10 * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): * __pyx_result._local_type_codecs = __pyx_state[0]; __pyx_result._type_codecs_cache = __pyx_state[1] # <<<<<<<<<<<<<< * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[2]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_local_type_codecs); __Pyx_DECREF(__pyx_v___pyx_result->_local_type_codecs); __pyx_v___pyx_result->_local_type_codecs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_type_codecs_cache); __Pyx_DECREF(__pyx_v___pyx_result->_type_codecs_cache); __pyx_v___pyx_result->_type_codecs_cache = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":11 * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): * __pyx_result._local_type_codecs = __pyx_state[0]; __pyx_result._type_codecs_cache = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[2]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 11, __pyx_L1_error) } __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_4 = ((__pyx_t_3 > 2) != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_5 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":12 * __pyx_result._local_type_codecs = __pyx_state[0]; __pyx_result._type_codecs_cache = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":11 * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): * __pyx_result._local_type_codecs = __pyx_state[0]; __pyx_result._type_codecs_cache = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[2]) */ } /* "(tree fragment)":9 * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._local_type_codecs = __pyx_state[0]; __pyx_result._type_codecs_cache = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_DataCodecConfig__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0x197884c: * from pickle import PickleError as __pyx_PickleError */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_9__pyx_unpickle_CoreProtocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_9__pyx_unpickle_CoreProtocol = {"__pyx_unpickle_CoreProtocol", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_9__pyx_unpickle_CoreProtocol, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_9__pyx_unpickle_CoreProtocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_CoreProtocol") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_CoreProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_8__pyx_unpickle_CoreProtocol(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_8__pyx_unpickle_CoreProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = NULL; PyObject *__pyx_v___pyx_result = 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; int __pyx_t_7; __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol", 0); /* "(tree fragment)":2 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0x197884c: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x197884c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, backend_pid, backend_secret, buffer, con_params, con_status, encoding, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, state, transport, xact_status))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x197884c) != 0); if (__pyx_t_1) { /* "(tree fragment)":3 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0x197884c: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0x197884c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, backend_pid, backend_secret, buffer, con_params, con_status, encoding, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, state, transport, xact_status))" % __pyx_checksum) * __pyx_result = CoreProtocol.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":4 * if __pyx_checksum != 0x197884c: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x197884c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, backend_pid, backend_secret, buffer, con_params, con_status, encoding, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, state, transport, xact_status))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = CoreProtocol.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x19, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":2 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0x197884c: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x197884c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, backend_pid, backend_secret, buffer, con_params, con_status, encoding, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, state, transport, xact_status))" % __pyx_checksum) */ } /* "(tree fragment)":5 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x197884c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, backend_pid, backend_secret, buffer, con_params, con_status, encoding, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, state, transport, xact_status))" % __pyx_checksum) * __pyx_result = CoreProtocol.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol), __pyx_n_s_new_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v___pyx_type); __Pyx_GIVEREF(__pyx_v___pyx_type); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __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_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":6 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x197884c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, backend_pid, backend_secret, buffer, con_params, con_status, encoding, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, state, transport, xact_status))" % __pyx_checksum) * __pyx_result = CoreProtocol.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_7 = (__pyx_t_1 != 0); if (__pyx_t_7) { /* "(tree fragment)":7 * __pyx_result = CoreProtocol.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 7, __pyx_L1_error) __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x197884c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, backend_pid, backend_secret, buffer, con_params, con_status, encoding, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, state, transport, xact_status))" % __pyx_checksum) * __pyx_result = CoreProtocol.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":8 * if __pyx_state is not None: * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.backend_pid = __pyx_state[5]; __pyx_result.backend_secret = __pyx_state[6]; __pyx_result.buffer = __pyx_state[7]; __pyx_result.con_params = __pyx_state[8]; __pyx_result.con_status = __pyx_state[9]; __pyx_result.encoding = __pyx_state[10]; __pyx_result.result = __pyx_state[11]; __pyx_result.result_execute_completed = __pyx_state[12]; __pyx_result.result_param_desc = __pyx_state[13]; __pyx_result.result_row_desc = __pyx_state[14]; __pyx_result.result_status_msg = __pyx_state[15]; __pyx_result.result_type = __pyx_state[16]; __pyx_result.state = __pyx_state[17]; __pyx_result.transport = __pyx_state[18]; __pyx_result.xact_status = __pyx_state[19] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0x197884c: * from pickle import PickleError as __pyx_PickleError */ /* 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.__pyx_unpickle_CoreProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":9 * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.backend_pid = __pyx_state[5]; __pyx_result.backend_secret = __pyx_state[6]; __pyx_result.buffer = __pyx_state[7]; __pyx_result.con_params = __pyx_state[8]; __pyx_result.con_status = __pyx_state[9]; __pyx_result.encoding = __pyx_state[10]; __pyx_result.result = __pyx_state[11]; __pyx_result.result_execute_completed = __pyx_state[12]; __pyx_result.result_param_desc = __pyx_state[13]; __pyx_result.result_row_desc = __pyx_state[14]; __pyx_result.result_status_msg = __pyx_state[15]; __pyx_result.result_type = __pyx_state[16]; __pyx_result.state = __pyx_state[17]; __pyx_result.transport = __pyx_state[18]; __pyx_result.xact_status = __pyx_state[19] * if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int32_t __pyx_t_3; enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __pyx_t_4; enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __pyx_t_5; enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_t_6; enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol__set_state", 0); /* "(tree fragment)":10 * return __pyx_result * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.backend_pid = __pyx_state[5]; __pyx_result.backend_secret = __pyx_state[6]; __pyx_result.buffer = __pyx_state[7]; __pyx_result.con_params = __pyx_state[8]; __pyx_result.con_status = __pyx_state[9]; __pyx_result.encoding = __pyx_state[10]; __pyx_result.result = __pyx_state[11]; __pyx_result.result_execute_completed = __pyx_state[12]; __pyx_result.result_param_desc = __pyx_state[13]; __pyx_result.result_row_desc = __pyx_state[14]; __pyx_result.result_status_msg = __pyx_state[15]; __pyx_result.result_type = __pyx_state[16]; __pyx_result.state = __pyx_state[17]; __pyx_result.transport = __pyx_state[18]; __pyx_result.xact_status = __pyx_state[19] # <<<<<<<<<<<<<< * if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[20]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_discard_data = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_execute_iter); __Pyx_DECREF(__pyx_v___pyx_result->_execute_iter); __pyx_v___pyx_result->_execute_iter = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_execute_portal_name); __Pyx_DECREF(__pyx_v___pyx_result->_execute_portal_name); __pyx_v___pyx_result->_execute_portal_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_execute_stmt_name); __Pyx_DECREF(__pyx_v___pyx_result->_execute_stmt_name); __pyx_v___pyx_result->_execute_stmt_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_skip_discard = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->backend_pid = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->backend_secret = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_ReadBuffer))))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->buffer); __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->buffer)); __pyx_v___pyx_result->buffer = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->con_params); __Pyx_DECREF(__pyx_v___pyx_result->con_params); __pyx_v___pyx_result->con_params = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->con_status = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->encoding); __Pyx_DECREF(__pyx_v___pyx_result->encoding); __pyx_v___pyx_result->encoding = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->result); __Pyx_DECREF(__pyx_v___pyx_result->result); __pyx_v___pyx_result->result = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->result_execute_completed = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->result_param_desc); __Pyx_DECREF(__pyx_v___pyx_result->result_param_desc); __pyx_v___pyx_result->result_param_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->result_row_desc); __Pyx_DECREF(__pyx_v___pyx_result->result_row_desc); __pyx_v___pyx_result->result_row_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->result_status_msg); __Pyx_DECREF(__pyx_v___pyx_result->result_status_msg); __pyx_v___pyx_result->result_status_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->result_type = __pyx_t_5; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->state = __pyx_t_6; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->transport); __Pyx_DECREF(__pyx_v___pyx_result->transport); __pyx_v___pyx_result->transport = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->xact_status = __pyx_t_7; /* "(tree fragment)":11 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.backend_pid = __pyx_state[5]; __pyx_result.backend_secret = __pyx_state[6]; __pyx_result.buffer = __pyx_state[7]; __pyx_result.con_params = __pyx_state[8]; __pyx_result.con_status = __pyx_state[9]; __pyx_result.encoding = __pyx_state[10]; __pyx_result.result = __pyx_state[11]; __pyx_result.result_execute_completed = __pyx_state[12]; __pyx_result.result_param_desc = __pyx_state[13]; __pyx_result.result_row_desc = __pyx_state[14]; __pyx_result.result_status_msg = __pyx_state[15]; __pyx_result.result_type = __pyx_state[16]; __pyx_result.state = __pyx_state[17]; __pyx_result.transport = __pyx_state[18]; __pyx_result.xact_status = __pyx_state[19] * if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[20]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 11, __pyx_L1_error) } __pyx_t_8 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_9 = ((__pyx_t_8 > 20) != 0); if (__pyx_t_9) { } else { __pyx_t_2 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_10 = (__pyx_t_9 != 0); __pyx_t_2 = __pyx_t_10; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":12 * __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.backend_pid = __pyx_state[5]; __pyx_result.backend_secret = __pyx_state[6]; __pyx_result.buffer = __pyx_state[7]; __pyx_result.con_params = __pyx_state[8]; __pyx_result.con_status = __pyx_state[9]; __pyx_result.encoding = __pyx_state[10]; __pyx_result.result = __pyx_state[11]; __pyx_result.result_execute_completed = __pyx_state[12]; __pyx_result.result_param_desc = __pyx_state[13]; __pyx_result.result_row_desc = __pyx_state[14]; __pyx_result.result_status_msg = __pyx_state[15]; __pyx_result.result_type = __pyx_state[16]; __pyx_result.state = __pyx_state[17]; __pyx_result.transport = __pyx_state[18]; __pyx_result.xact_status = __pyx_state[19] * if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[20]) # <<<<<<<<<<<<<< */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_13 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_13) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_11}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else #endif { __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL; __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":11 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.backend_pid = __pyx_state[5]; __pyx_result.backend_secret = __pyx_state[6]; __pyx_result.buffer = __pyx_state[7]; __pyx_result.con_params = __pyx_state[8]; __pyx_result.con_status = __pyx_state[9]; __pyx_result.encoding = __pyx_state[10]; __pyx_result.result = __pyx_state[11]; __pyx_result.result_execute_completed = __pyx_state[12]; __pyx_result.result_param_desc = __pyx_state[13]; __pyx_result.result_row_desc = __pyx_state[14]; __pyx_result.result_status_msg = __pyx_state[15]; __pyx_result.result_type = __pyx_state[16]; __pyx_result.state = __pyx_state[17]; __pyx_result.transport = __pyx_state[18]; __pyx_result.xact_status = __pyx_state[19] * if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[20]) */ } /* "(tree fragment)":9 * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.backend_pid = __pyx_state[5]; __pyx_result.backend_secret = __pyx_state[6]; __pyx_result.buffer = __pyx_state[7]; __pyx_result.con_params = __pyx_state[8]; __pyx_result.con_status = __pyx_state[9]; __pyx_result.encoding = __pyx_state[10]; __pyx_result.result = __pyx_state[11]; __pyx_result.result_execute_completed = __pyx_state[12]; __pyx_result.result_param_desc = __pyx_state[13]; __pyx_result.result_row_desc = __pyx_state[14]; __pyx_result.result_status_msg = __pyx_state[15]; __pyx_result.result_type = __pyx_state[16]; __pyx_result.state = __pyx_state[17]; __pyx_result.transport = __pyx_state[18]; __pyx_result.xact_status = __pyx_state[19] * if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_CoreProtocol__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0x30f806c: * from pickle import PickleError as __pyx_PickleError */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_11__pyx_unpickle_BaseProtocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_11__pyx_unpickle_BaseProtocol = {"__pyx_unpickle_BaseProtocol", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_11__pyx_unpickle_BaseProtocol, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_11__pyx_unpickle_BaseProtocol(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BaseProtocol") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_BaseProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_10__pyx_unpickle_BaseProtocol(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_10__pyx_unpickle_BaseProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = NULL; PyObject *__pyx_v___pyx_result = 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; int __pyx_t_7; __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol", 0); /* "(tree fragment)":2 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0x30f806c: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x30f806c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, completed_callback, con_params, con_status, connection, create_future, encoding, is_reading, last_query, loop, queries_count, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, settings, state, statement, timeout_callback, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x30f806c) != 0); if (__pyx_t_1) { /* "(tree fragment)":3 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0x30f806c: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0x30f806c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, completed_callback, con_params, con_status, connection, create_future, encoding, is_reading, last_query, loop, queries_count, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, settings, state, statement, timeout_callback, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum) * __pyx_result = BaseProtocol.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":4 * if __pyx_checksum != 0x30f806c: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x30f806c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, completed_callback, con_params, con_status, connection, create_future, encoding, is_reading, last_query, loop, queries_count, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, settings, state, statement, timeout_callback, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = BaseProtocol.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x30, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":2 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state): * if __pyx_checksum != 0x30f806c: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x30f806c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, completed_callback, con_params, con_status, connection, create_future, encoding, is_reading, last_query, loop, queries_count, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, settings, state, statement, timeout_callback, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum) */ } /* "(tree fragment)":5 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x30f806c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, completed_callback, con_params, con_status, connection, create_future, encoding, is_reading, last_query, loop, queries_count, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, settings, state, statement, timeout_callback, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum) * __pyx_result = BaseProtocol.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol), __pyx_n_s_new_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v___pyx_type); __Pyx_GIVEREF(__pyx_v___pyx_type); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __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_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":6 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x30f806c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, completed_callback, con_params, con_status, connection, create_future, encoding, is_reading, last_query, loop, queries_count, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, settings, state, statement, timeout_callback, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum) * __pyx_result = BaseProtocol.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_7 = (__pyx_t_1 != 0); if (__pyx_t_7) { /* "(tree fragment)":7 * __pyx_result = BaseProtocol.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 7, __pyx_L1_error) __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x30f806c = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, completed_callback, con_params, con_status, connection, create_future, encoding, is_reading, last_query, loop, queries_count, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, settings, state, statement, timeout_callback, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum) * __pyx_result = BaseProtocol.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":8 * if __pyx_state is not None: * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._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.cancel_sent_waiter = __pyx_state[9]; __pyx_result.cancel_waiter = __pyx_state[10]; __pyx_result.closing = __pyx_state[11]; __pyx_result.completed_callback = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.connection = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.is_reading = __pyx_state[18]; __pyx_result.last_query = __pyx_state[19]; __pyx_result.loop = __pyx_state[20]; __pyx_result.queries_count = __pyx_state[21]; __pyx_result.result = __pyx_state[22]; __pyx_result.result_execute_completed = __pyx_state[23]; __pyx_result.result_param_desc = __pyx_state[24]; __pyx_result.result_row_desc = __pyx_state[25]; __pyx_result.result_status_msg = __pyx_state[26]; __pyx_result.result_type = __pyx_state[27]; __pyx_result.return_extra = __pyx_state[28]; __pyx_result.settings = __pyx_state[29]; __pyx_result.state = __pyx_state[30]; __pyx_result.statement = __pyx_state[31]; __pyx_result.timeout_callback = __pyx_state[32]; __pyx_result.timeout_handle = __pyx_state[33]; __pyx_result.transport = __pyx_state[34]; __pyx_result.waiter = __pyx_state[35]; __pyx_result.writing_paused = __pyx_state[36]; __pyx_result.xact_status = __pyx_state[37] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0x30f806c: * from pickle import PickleError as __pyx_PickleError */ /* 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.__pyx_unpickle_BaseProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":9 * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._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.cancel_sent_waiter = __pyx_state[9]; __pyx_result.cancel_waiter = __pyx_state[10]; __pyx_result.closing = __pyx_state[11]; __pyx_result.completed_callback = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.connection = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.is_reading = __pyx_state[18]; __pyx_result.last_query = __pyx_state[19]; __pyx_result.loop = __pyx_state[20]; __pyx_result.queries_count = __pyx_state[21]; __pyx_result.result = __pyx_state[22]; __pyx_result.result_execute_completed = __pyx_state[23]; __pyx_result.result_param_desc = __pyx_state[24]; __pyx_result.result_row_desc = __pyx_state[25]; __pyx_result.result_status_msg = __pyx_state[26]; __pyx_result.result_type = __pyx_state[27]; __pyx_result.return_extra = __pyx_state[28]; __pyx_result.settings = __pyx_state[29]; __pyx_result.state = __pyx_state[30]; __pyx_result.statement = __pyx_state[31]; __pyx_result.timeout_callback = __pyx_state[32]; __pyx_result.timeout_handle = __pyx_state[33]; __pyx_result.transport = __pyx_state[34]; __pyx_result.waiter = __pyx_state[35]; __pyx_result.writing_paused = __pyx_state[36]; __pyx_result.xact_status = __pyx_state[37] * if len(__pyx_state) > 38 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int32_t __pyx_t_3; enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __pyx_t_4; uint64_t __pyx_t_5; enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __pyx_t_6; enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_t_7; enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol__set_state", 0); /* "(tree fragment)":10 * return __pyx_result * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._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.cancel_sent_waiter = __pyx_state[9]; __pyx_result.cancel_waiter = __pyx_state[10]; __pyx_result.closing = __pyx_state[11]; __pyx_result.completed_callback = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.connection = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.is_reading = __pyx_state[18]; __pyx_result.last_query = __pyx_state[19]; __pyx_result.loop = __pyx_state[20]; __pyx_result.queries_count = __pyx_state[21]; __pyx_result.result = __pyx_state[22]; __pyx_result.result_execute_completed = __pyx_state[23]; __pyx_result.result_param_desc = __pyx_state[24]; __pyx_result.result_row_desc = __pyx_state[25]; __pyx_result.result_status_msg = __pyx_state[26]; __pyx_result.result_type = __pyx_state[27]; __pyx_result.return_extra = __pyx_state[28]; __pyx_result.settings = __pyx_state[29]; __pyx_result.state = __pyx_state[30]; __pyx_result.statement = __pyx_state[31]; __pyx_result.timeout_callback = __pyx_state[32]; __pyx_result.timeout_handle = __pyx_state[33]; __pyx_result.transport = __pyx_state[34]; __pyx_result.waiter = __pyx_state[35]; __pyx_result.writing_paused = __pyx_state[36]; __pyx_result.xact_status = __pyx_state[37] # <<<<<<<<<<<<<< * if len(__pyx_state) > 38 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[38]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base._discard_data = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._execute_iter); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._execute_iter); __pyx_v___pyx_result->__pyx_base._execute_iter = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._execute_portal_name); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._execute_portal_name); __pyx_v___pyx_result->__pyx_base._execute_portal_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._execute_stmt_name); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._execute_stmt_name); __pyx_v___pyx_result->__pyx_base._execute_stmt_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base._skip_discard = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->address); __Pyx_DECREF(__pyx_v___pyx_result->address); __pyx_v___pyx_result->address = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.backend_pid = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.backend_secret = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_ReadBuffer))))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__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_8protocol_8protocol_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->cancel_sent_waiter); __Pyx_DECREF(__pyx_v___pyx_result->cancel_sent_waiter); __pyx_v___pyx_result->cancel_sent_waiter = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->cancel_waiter); __Pyx_DECREF(__pyx_v___pyx_result->cancel_waiter); __pyx_v___pyx_result->cancel_waiter = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->closing = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->completed_callback); __Pyx_DECREF(__pyx_v___pyx_result->completed_callback); __pyx_v___pyx_result->completed_callback = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.con_params); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.con_params); __pyx_v___pyx_result->__pyx_base.con_params = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.con_status = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->connection); __Pyx_DECREF(__pyx_v___pyx_result->connection); __pyx_v___pyx_result->connection = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->create_future); __Pyx_DECREF(__pyx_v___pyx_result->create_future); __pyx_v___pyx_result->create_future = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.encoding); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.encoding); __pyx_v___pyx_result->__pyx_base.encoding = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->is_reading = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->last_query); __Pyx_DECREF(__pyx_v___pyx_result->last_query); __pyx_v___pyx_result->last_query = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->loop); __Pyx_DECREF(__pyx_v___pyx_result->loop); __pyx_v___pyx_result->loop = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->queries_count = __pyx_t_5; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result); __pyx_v___pyx_result->__pyx_base.result = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.result_execute_completed = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result_param_desc); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result_param_desc); __pyx_v___pyx_result->__pyx_base.result_param_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result_row_desc); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result_row_desc); __pyx_v___pyx_result->__pyx_base.result_row_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result_status_msg); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result_status_msg); __pyx_v___pyx_result->__pyx_base.result_status_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.result_type = __pyx_t_6; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->return_extra = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings))))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->settings); __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->settings)); __pyx_v___pyx_result->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.state = __pyx_t_7; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState))))) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->statement); __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->statement)); __pyx_v___pyx_result->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->timeout_callback); __Pyx_DECREF(__pyx_v___pyx_result->timeout_callback); __pyx_v___pyx_result->timeout_callback = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->timeout_handle); __Pyx_DECREF(__pyx_v___pyx_result->timeout_handle); __pyx_v___pyx_result->timeout_handle = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.transport); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.transport); __pyx_v___pyx_result->__pyx_base.transport = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->waiter); __Pyx_DECREF(__pyx_v___pyx_result->waiter); __pyx_v___pyx_result->waiter = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->writing_paused = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 10, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 10, __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)":11 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._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.cancel_sent_waiter = __pyx_state[9]; __pyx_result.cancel_waiter = __pyx_state[10]; __pyx_result.closing = __pyx_state[11]; __pyx_result.completed_callback = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.connection = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.is_reading = __pyx_state[18]; __pyx_result.last_query = __pyx_state[19]; __pyx_result.loop = __pyx_state[20]; __pyx_result.queries_count = __pyx_state[21]; __pyx_result.result = __pyx_state[22]; __pyx_result.result_execute_completed = __pyx_state[23]; __pyx_result.result_param_desc = __pyx_state[24]; __pyx_result.result_row_desc = __pyx_state[25]; __pyx_result.result_status_msg = __pyx_state[26]; __pyx_result.result_type = __pyx_state[27]; __pyx_result.return_extra = __pyx_state[28]; __pyx_result.settings = __pyx_state[29]; __pyx_result.state = __pyx_state[30]; __pyx_result.statement = __pyx_state[31]; __pyx_result.timeout_callback = __pyx_state[32]; __pyx_result.timeout_handle = __pyx_state[33]; __pyx_result.transport = __pyx_state[34]; __pyx_result.waiter = __pyx_state[35]; __pyx_result.writing_paused = __pyx_state[36]; __pyx_result.xact_status = __pyx_state[37] * if len(__pyx_state) > 38 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[38]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 11, __pyx_L1_error) } __pyx_t_9 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_10 = ((__pyx_t_9 > 38) != 0); if (__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L4_bool_binop_done; } __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(2, 11, __pyx_L1_error) __pyx_t_11 = (__pyx_t_10 != 0); __pyx_t_2 = __pyx_t_11; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":12 * __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.cancel_sent_waiter = __pyx_state[9]; __pyx_result.cancel_waiter = __pyx_state[10]; __pyx_result.closing = __pyx_state[11]; __pyx_result.completed_callback = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.connection = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.is_reading = __pyx_state[18]; __pyx_result.last_query = __pyx_state[19]; __pyx_result.loop = __pyx_state[20]; __pyx_result.queries_count = __pyx_state[21]; __pyx_result.result = __pyx_state[22]; __pyx_result.result_execute_completed = __pyx_state[23]; __pyx_result.result_param_desc = __pyx_state[24]; __pyx_result.result_row_desc = __pyx_state[25]; __pyx_result.result_status_msg = __pyx_state[26]; __pyx_result.result_type = __pyx_state[27]; __pyx_result.return_extra = __pyx_state[28]; __pyx_result.settings = __pyx_state[29]; __pyx_result.state = __pyx_state[30]; __pyx_result.statement = __pyx_state[31]; __pyx_result.timeout_callback = __pyx_state[32]; __pyx_result.timeout_handle = __pyx_state[33]; __pyx_result.transport = __pyx_state[34]; __pyx_result.waiter = __pyx_state[35]; __pyx_result.writing_paused = __pyx_state[36]; __pyx_result.xact_status = __pyx_state[37] * if len(__pyx_state) > 38 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[38]) # <<<<<<<<<<<<<< */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_update); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_12 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 38, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); } } if (!__pyx_t_14) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) { PyObject *__pyx_temp[2] = {__pyx_t_14, __pyx_t_12}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif { __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL; __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12); __pyx_t_12 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":11 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._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.cancel_sent_waiter = __pyx_state[9]; __pyx_result.cancel_waiter = __pyx_state[10]; __pyx_result.closing = __pyx_state[11]; __pyx_result.completed_callback = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.connection = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.is_reading = __pyx_state[18]; __pyx_result.last_query = __pyx_state[19]; __pyx_result.loop = __pyx_state[20]; __pyx_result.queries_count = __pyx_state[21]; __pyx_result.result = __pyx_state[22]; __pyx_result.result_execute_completed = __pyx_state[23]; __pyx_result.result_param_desc = __pyx_state[24]; __pyx_result.result_row_desc = __pyx_state[25]; __pyx_result.result_status_msg = __pyx_state[26]; __pyx_result.result_type = __pyx_state[27]; __pyx_result.return_extra = __pyx_state[28]; __pyx_result.settings = __pyx_state[29]; __pyx_result.state = __pyx_state[30]; __pyx_result.statement = __pyx_state[31]; __pyx_result.timeout_callback = __pyx_state[32]; __pyx_result.timeout_handle = __pyx_state[33]; __pyx_result.transport = __pyx_state[34]; __pyx_result.waiter = __pyx_state[35]; __pyx_result.writing_paused = __pyx_state[36]; __pyx_result.xact_status = __pyx_state[37] * if len(__pyx_state) > 38 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[38]) */ } /* "(tree fragment)":9 * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._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.cancel_sent_waiter = __pyx_state[9]; __pyx_result.cancel_waiter = __pyx_state[10]; __pyx_result.closing = __pyx_state[11]; __pyx_result.completed_callback = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.connection = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.is_reading = __pyx_state[18]; __pyx_result.last_query = __pyx_state[19]; __pyx_result.loop = __pyx_state[20]; __pyx_result.queries_count = __pyx_state[21]; __pyx_result.result = __pyx_state[22]; __pyx_result.result_execute_completed = __pyx_state[23]; __pyx_result.result_param_desc = __pyx_state[24]; __pyx_result.result_row_desc = __pyx_state[25]; __pyx_result.result_status_msg = __pyx_state[26]; __pyx_result.result_type = __pyx_state[27]; __pyx_result.return_extra = __pyx_state[28]; __pyx_result.settings = __pyx_state[29]; __pyx_result.state = __pyx_state[30]; __pyx_result.statement = __pyx_state[31]; __pyx_result.timeout_callback = __pyx_state[32]; __pyx_result.timeout_handle = __pyx_state[33]; __pyx_result.transport = __pyx_state[34]; __pyx_result.waiter = __pyx_state[35]; __pyx_result.writing_paused = __pyx_state[36]; __pyx_result.xact_status = __pyx_state[37] * if len(__pyx_state) > 38 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __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; } /* "hton.pxd":25 * * * cdef inline void pack_int16(char* buf, int16_t x): # <<<<<<<<<<<<<< * (buf)[0] = htons(x) * */ static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_4hton_pack_int16(char *__pyx_v_buf, int16_t __pyx_v_x) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pack_int16", 0); /* "hton.pxd":26 * * cdef inline void pack_int16(char* buf, int16_t x): * (buf)[0] = htons(x) # <<<<<<<<<<<<<< * * */ (((uint16_t *)__pyx_v_buf)[0]) = htons(((uint16_t)__pyx_v_x)); /* "hton.pxd":25 * * * cdef inline void pack_int16(char* buf, int16_t x): # <<<<<<<<<<<<<< * (buf)[0] = htons(x) * */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "hton.pxd":29 * * * cdef inline int16_t unpack_int16(const char* buf): # <<<<<<<<<<<<<< * return ntohs((buf)[0]) * */ static CYTHON_INLINE int16_t __pyx_f_7asyncpg_8protocol_4hton_unpack_int16(char const *__pyx_v_buf) { int16_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpack_int16", 0); /* "hton.pxd":30 * * cdef inline int16_t unpack_int16(const char* buf): * return ntohs((buf)[0]) # <<<<<<<<<<<<<< * * */ __pyx_r = ((int16_t)ntohs((((uint16_t *)__pyx_v_buf)[0]))); goto __pyx_L0; /* "hton.pxd":29 * * * cdef inline int16_t unpack_int16(const char* buf): # <<<<<<<<<<<<<< * return ntohs((buf)[0]) * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "hton.pxd":33 * * * cdef inline void pack_int32(char* buf, int32_t x): # <<<<<<<<<<<<<< * (buf)[0] = htonl(x) * */ static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_4hton_pack_int32(char *__pyx_v_buf, int32_t __pyx_v_x) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pack_int32", 0); /* "hton.pxd":34 * * cdef inline void pack_int32(char* buf, int32_t x): * (buf)[0] = htonl(x) # <<<<<<<<<<<<<< * * */ (((uint32_t *)__pyx_v_buf)[0]) = htonl(((uint32_t)__pyx_v_x)); /* "hton.pxd":33 * * * cdef inline void pack_int32(char* buf, int32_t x): # <<<<<<<<<<<<<< * (buf)[0] = htonl(x) * */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "hton.pxd":37 * * * cdef inline int32_t unpack_int32(const char* buf): # <<<<<<<<<<<<<< * return ntohl((buf)[0]) * */ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(char const *__pyx_v_buf) { int32_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpack_int32", 0); /* "hton.pxd":38 * * cdef inline int32_t unpack_int32(const char* buf): * return ntohl((buf)[0]) # <<<<<<<<<<<<<< * * */ __pyx_r = ((int32_t)ntohl((((uint32_t *)__pyx_v_buf)[0]))); goto __pyx_L0; /* "hton.pxd":37 * * * cdef inline int32_t unpack_int32(const char* buf): # <<<<<<<<<<<<<< * return ntohl((buf)[0]) * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "hton.pxd":41 * * * cdef inline void pack_int64(char* buf, int64_t x): # <<<<<<<<<<<<<< * (buf)[0] = htonl(((x) >> 32)) * (&buf[4])[0] = htonl((x)) */ static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_4hton_pack_int64(char *__pyx_v_buf, int64_t __pyx_v_x) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pack_int64", 0); /* "hton.pxd":42 * * cdef inline void pack_int64(char* buf, int64_t x): * (buf)[0] = htonl(((x) >> 32)) # <<<<<<<<<<<<<< * (&buf[4])[0] = htonl((x)) * */ (((uint32_t *)__pyx_v_buf)[0]) = htonl(((uint32_t)(((uint64_t)__pyx_v_x) >> 32))); /* "hton.pxd":43 * cdef inline void pack_int64(char* buf, int64_t x): * (buf)[0] = htonl(((x) >> 32)) * (&buf[4])[0] = htonl((x)) # <<<<<<<<<<<<<< * * */ (((uint32_t *)(&(__pyx_v_buf[4])))[0]) = htonl(((uint32_t)__pyx_v_x)); /* "hton.pxd":41 * * * cdef inline void pack_int64(char* buf, int64_t x): # <<<<<<<<<<<<<< * (buf)[0] = htonl(((x) >> 32)) * (&buf[4])[0] = htonl((x)) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "hton.pxd":46 * * * cdef inline int64_t unpack_int64(const char* buf): # <<<<<<<<<<<<<< * cdef int64_t hh = unpack_int32(buf) * cdef uint32_t hl = unpack_int32(&buf[4]) */ static CYTHON_INLINE int64_t __pyx_f_7asyncpg_8protocol_4hton_unpack_int64(char const *__pyx_v_buf) { int64_t __pyx_v_hh; uint32_t __pyx_v_hl; int64_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpack_int64", 0); /* "hton.pxd":47 * * cdef inline int64_t unpack_int64(const char* buf): * cdef int64_t hh = unpack_int32(buf) # <<<<<<<<<<<<<< * cdef uint32_t hl = unpack_int32(&buf[4]) * */ __pyx_v_hh = __pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_v_buf); /* "hton.pxd":48 * cdef inline int64_t unpack_int64(const char* buf): * cdef int64_t hh = unpack_int32(buf) * cdef uint32_t hl = unpack_int32(&buf[4]) # <<<<<<<<<<<<<< * * return (hh << 32) | hl */ __pyx_v_hl = ((uint32_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int32((&(__pyx_v_buf[4])))); /* "hton.pxd":50 * cdef uint32_t hl = unpack_int32(&buf[4]) * * return (hh << 32) | hl # <<<<<<<<<<<<<< * * */ __pyx_r = ((__pyx_v_hh << 32) | __pyx_v_hl); goto __pyx_L0; /* "hton.pxd":46 * * * cdef inline int64_t unpack_int64(const char* buf): # <<<<<<<<<<<<<< * cdef int64_t hh = unpack_int32(buf) * cdef uint32_t hl = unpack_int32(&buf[4]) */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "hton.pxd":58 * * * cdef inline int32_t pack_float(char* buf, float f): # <<<<<<<<<<<<<< * cdef _floatconv v * v.f = f */ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_8protocol_4hton_pack_float(char *__pyx_v_buf, float __pyx_v_f) { union __pyx_t_7asyncpg_8protocol_4hton__floatconv __pyx_v_v; int32_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pack_float", 0); /* "hton.pxd":60 * cdef inline int32_t pack_float(char* buf, float f): * cdef _floatconv v * v.f = f # <<<<<<<<<<<<<< * pack_int32(buf, v.i) * */ __pyx_v_v.f = __pyx_v_f; /* "hton.pxd":61 * cdef _floatconv v * v.f = f * pack_int32(buf, v.i) # <<<<<<<<<<<<<< * * */ __pyx_f_7asyncpg_8protocol_4hton_pack_int32(__pyx_v_buf, ((int32_t)__pyx_v_v.i)); /* "hton.pxd":58 * * * cdef inline int32_t pack_float(char* buf, float f): # <<<<<<<<<<<<<< * cdef _floatconv v * v.f = f */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "hton.pxd":64 * * * cdef inline float unpack_float(const char* buf): # <<<<<<<<<<<<<< * cdef _floatconv v * v.i = unpack_int32(buf) */ static CYTHON_INLINE float __pyx_f_7asyncpg_8protocol_4hton_unpack_float(char const *__pyx_v_buf) { union __pyx_t_7asyncpg_8protocol_4hton__floatconv __pyx_v_v; float __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpack_float", 0); /* "hton.pxd":66 * cdef inline float unpack_float(const char* buf): * cdef _floatconv v * v.i = unpack_int32(buf) # <<<<<<<<<<<<<< * return v.f * */ __pyx_v_v.i = ((uint32_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int32(__pyx_v_buf)); /* "hton.pxd":67 * cdef _floatconv v * v.i = unpack_int32(buf) * return v.f # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_v.f; goto __pyx_L0; /* "hton.pxd":64 * * * cdef inline float unpack_float(const char* buf): # <<<<<<<<<<<<<< * cdef _floatconv v * v.i = unpack_int32(buf) */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "hton.pxd":75 * * * cdef inline int64_t pack_double(char* buf, double f): # <<<<<<<<<<<<<< * cdef _doubleconv v * v.f = f */ static CYTHON_INLINE int64_t __pyx_f_7asyncpg_8protocol_4hton_pack_double(char *__pyx_v_buf, double __pyx_v_f) { union __pyx_t_7asyncpg_8protocol_4hton__doubleconv __pyx_v_v; int64_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pack_double", 0); /* "hton.pxd":77 * cdef inline int64_t pack_double(char* buf, double f): * cdef _doubleconv v * v.f = f # <<<<<<<<<<<<<< * pack_int64(buf, v.i) * */ __pyx_v_v.f = __pyx_v_f; /* "hton.pxd":78 * cdef _doubleconv v * v.f = f * pack_int64(buf, v.i) # <<<<<<<<<<<<<< * * */ __pyx_f_7asyncpg_8protocol_4hton_pack_int64(__pyx_v_buf, ((int64_t)__pyx_v_v.i)); /* "hton.pxd":75 * * * cdef inline int64_t pack_double(char* buf, double f): # <<<<<<<<<<<<<< * cdef _doubleconv v * v.f = f */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "hton.pxd":81 * * * cdef inline double unpack_double(const char* buf): # <<<<<<<<<<<<<< * cdef _doubleconv v * v.i = unpack_int64(buf) */ static CYTHON_INLINE double __pyx_f_7asyncpg_8protocol_4hton_unpack_double(char const *__pyx_v_buf) { union __pyx_t_7asyncpg_8protocol_4hton__doubleconv __pyx_v_v; double __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unpack_double", 0); /* "hton.pxd":83 * cdef inline double unpack_double(const char* buf): * cdef _doubleconv v * v.i = unpack_int64(buf) # <<<<<<<<<<<<<< * return v.f */ __pyx_v_v.i = ((uint64_t)__pyx_f_7asyncpg_8protocol_4hton_unpack_int64(__pyx_v_buf)); /* "hton.pxd":84 * cdef _doubleconv v * v.i = unpack_int64(buf) * return v.f # <<<<<<<<<<<<<< */ __pyx_r = __pyx_v_v.f; goto __pyx_L0; /* "hton.pxd":81 * * * cdef inline double unpack_double(const char* buf): # <<<<<<<<<<<<<< * cdef _doubleconv v * v.i = unpack_int64(buf) */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Memory __pyx_vtable_7asyncpg_8protocol_8protocol_Memory; static struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *__pyx_freelist_7asyncpg_8protocol_8protocol_Memory[1024]; static int __pyx_freecount_7asyncpg_8protocol_8protocol_Memory = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_Memory(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *p; PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol_Memory > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol_Memory[--__pyx_freecount_7asyncpg_8protocol_8protocol_Memory]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_Memory; p->owner = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_Memory(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->owner); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol_Memory < 1024) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory)))) { __pyx_freelist_7asyncpg_8protocol_8protocol_Memory[__pyx_freecount_7asyncpg_8protocol_8protocol_Memory++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_Memory(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *)o; if (p->owner) { e = (*v)(p->owner, a); if (e) return e; } return 0; } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_Memory[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_6Memory_1__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_6Memory_3__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_Memory = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.Memory", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_Memory, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_Memory, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_Memory, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_Memory, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_WriteBuffer __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer; static struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *__pyx_freelist_7asyncpg_8protocol_8protocol_WriteBuffer[256]; static int __pyx_freecount_7asyncpg_8protocol_8protocol_WriteBuffer = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_WriteBuffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *p; PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol_WriteBuffer > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol_WriteBuffer[--__pyx_freecount_7asyncpg_8protocol_8protocol_WriteBuffer]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer)); (void) PyObject_INIT(o, t); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_WriteBuffer; if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_WriteBuffer(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_3__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol_WriteBuffer < 256) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer)))) { __pyx_freelist_7asyncpg_8protocol_8protocol_WriteBuffer[__pyx_freecount_7asyncpg_8protocol_8protocol_WriteBuffer++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_WriteBuffer[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_9__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_11__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static PyBufferProcs __pyx_tp_as_buffer_WriteBuffer = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_5__getbuffer__, /*bf_getbuffer*/ __pyx_pw_7asyncpg_8protocol_8protocol_11WriteBuffer_7__releasebuffer__, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_WriteBuffer = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.WriteBuffer", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_WriteBuffer, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_WriteBuffer, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_WriteBuffer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_WriteBuffer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ReadBuffer __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer; static struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *__pyx_freelist_7asyncpg_8protocol_8protocol_ReadBuffer[256]; static int __pyx_freecount_7asyncpg_8protocol_8protocol_ReadBuffer = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_ReadBuffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *p; PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol_ReadBuffer > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol_ReadBuffer[--__pyx_freecount_7asyncpg_8protocol_8protocol_ReadBuffer]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_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_8protocol_8protocol_10ReadBuffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ReadBuffer(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_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_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol_ReadBuffer < 256) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer)))) { __pyx_freelist_7asyncpg_8protocol_8protocol_ReadBuffer[__pyx_freecount_7asyncpg_8protocol_8protocol_ReadBuffer++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_ReadBuffer(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *)o; if (p->_bufs) { e = (*v)(p->_bufs, a); if (e) return e; } if (p->_bufs_append) { e = (*v)(p->_bufs_append, a); if (e) return e; } if (p->_bufs_popleft) { e = (*v)(p->_bufs_popleft, a); if (e) return e; } return 0; } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_ReadBuffer[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_10ReadBuffer_3__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_10ReadBuffer_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_ReadBuffer = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.ReadBuffer", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ReadBuffer, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_ReadBuffer, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_ReadBuffer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_ReadBuffer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_FastReadBuffer __pyx_vtable_7asyncpg_8protocol_8protocol_FastReadBuffer; static struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *__pyx_freelist_7asyncpg_8protocol_8protocol_FastReadBuffer[256]; static int __pyx_freecount_7asyncpg_8protocol_8protocol_FastReadBuffer = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_FastReadBuffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *p; PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol_FastReadBuffer > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol_FastReadBuffer[--__pyx_freecount_7asyncpg_8protocol_8protocol_FastReadBuffer]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer)); (void) PyObject_INIT(o, t); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_FastReadBuffer; return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_FastReadBuffer(PyObject *o) { if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol_FastReadBuffer < 256) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer)))) { __pyx_freelist_7asyncpg_8protocol_8protocol_FastReadBuffer[__pyx_freecount_7asyncpg_8protocol_8protocol_FastReadBuffer++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_FastReadBuffer[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_14FastReadBuffer_1__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_14FastReadBuffer_3__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_FastReadBuffer = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.FastReadBuffer", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_FastReadBuffer, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*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_8protocol_8protocol_FastReadBuffer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_FastReadBuffer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #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 = (*t->tp_alloc)(t, 0); 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->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->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->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->element_codecs); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_Codec(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)o; if (p->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->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->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->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)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; 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_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_Codec, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_Codec, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_Codec, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_Codec, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_DataCodecConfig __pyx_vtable_7asyncpg_8protocol_8protocol_DataCodecConfig; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_DataCodecConfig(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 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->_type_codecs_cache = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_local_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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->_type_codecs_cache); Py_CLEAR(p->_local_type_codecs); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_DataCodecConfig(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)o; if (p->_type_codecs_cache) { e = (*v)(p->_type_codecs_cache, a); if (e) return e; } if (p->_local_type_codecs) { e = (*v)(p->_local_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->_type_codecs_cache); p->_type_codecs_cache = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_local_type_codecs); p->_local_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)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types, METH_O, 0}, {"add_python_codec", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec, METH_VARARGS|METH_KEYWORDS, 0}, {"remove_python_codec", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec, METH_VARARGS|METH_KEYWORDS, 0}, {"_set_builtin_type_codec", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec, METH_VARARGS|METH_KEYWORDS, 0}, {"set_builtin_type_codec", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec, METH_VARARGS|METH_KEYWORDS, 0}, {"clear_type_cache", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache, METH_NOARGS, 0}, {"declare_fallback_codec", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec, METH_VARARGS|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; 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_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #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; o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)o); p->__pyx_vtab = __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, a, k) < 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; PyObject_GC_UnTrack(o); Py_CLEAR(p->_encoding); Py_CLEAR(p->_codec); Py_CLEAR(p->_settings); Py_CLEAR(p->_data_codecs); (*Py_TYPE(o)->tp_free)(o); } 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 (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; 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_15__getattr__(o, n); } return v; } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_ConnectionSettings[] = { {"get_text_codec", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec, METH_NOARGS, 0}, {"register_data_types", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types, METH_O, 0}, {"add_python_codec", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec, METH_VARARGS|METH_KEYWORDS, 0}, {"remove_python_codec", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec, METH_VARARGS|METH_KEYWORDS, 0}, {"set_builtin_type_codec", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11set_builtin_type_codec, METH_VARARGS|METH_KEYWORDS, 0}, {"get_data_codec", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13get_data_codec, METH_VARARGS|METH_KEYWORDS, 0}, {"__getattr__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15__getattr__, METH_O|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; 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_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 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_8protocol_8protocol_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->con_params = 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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { 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->con_params); Py_CLEAR(p->result); Py_CLEAR(p->result_param_desc); Py_CLEAR(p->result_row_desc); Py_CLEAR(p->result_status_msg); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CoreProtocol(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)o; if (p->buffer) { e = (*v)(((PyObject *)p->buffer), a); if (e) return e; } if (p->_execute_iter) { e = (*v)(p->_execute_iter, a); if (e) return e; } if (p->transport) { e = (*v)(p->transport, a); if (e) return e; } if (p->con_params) { e = (*v)(p->con_params, 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_8protocol_8protocol_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->con_params); p->con_params = 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[] = { {"data_received", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3data_received, METH_O, 0}, {"connection_made", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5connection_made, METH_O, 0}, {"connection_lost", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_7connection_lost, METH_O, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_9__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_11__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_CoreProtocol[] = { {(char *)"backend_pid", __pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_pid, 0, (char *)0, 0}, {(char *)"backend_secret", __pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_secret, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; 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_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #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 = (*t->tp_alloc)(t, 0); 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->buffer = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)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->protocol = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)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->buffer); Py_CLEAR(p->row_desc); Py_CLEAR(p->parameters_desc); Py_CLEAR(p->protocol); Py_CLEAR(p->settings); Py_CLEAR(p->args_codecs); Py_CLEAR(p->cols_desc); Py_CLEAR(p->rows_codecs); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_PreparedStatementState(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)o; if (p->buffer) { e = (*v)(((PyObject *)p->buffer), 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->protocol) { e = (*v)(((PyObject *)p->protocol), 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->buffer); p->buffer = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *)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->protocol); p->protocol = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)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_refs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs_1__get__(o); } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_PreparedStatementState[] = { {"_get_parameters", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters, METH_NOARGS, 0}, {"_get_attributes", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes, METH_NOARGS, 0}, {"_init_types", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types, METH_NOARGS, 0}, {"attach", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9attach, METH_NOARGS, 0}, {"detach", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11detach, METH_NOARGS, 0}, {"mark_closed", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13mark_closed, METH_NOARGS, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_PreparedStatementState[] = { {(char *)"name", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_name, 0, (char *)0, 0}, {(char *)"query", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_query, 0, (char *)0, 0}, {(char *)"closed", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_closed, 0, (char *)0, 0}, {(char *)"refs", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_refs, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; 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_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #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->address = 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->timeout_callback = Py_None; Py_INCREF(Py_None); p->completed_callback = Py_None; Py_INCREF(Py_None); p->connection = 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(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->loop); Py_CLEAR(p->address); 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->timeout_callback); Py_CLEAR(p->completed_callback); Py_CLEAR(p->connection); 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->address) { e = (*v)(p->address, 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->timeout_callback) { e = (*v)(p->timeout_callback, a); if (e) return e; } if (p->completed_callback) { e = (*v)(p->completed_callback, a); if (e) return e; } if (p->connection) { e = (*v)(p->connection, 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->address); p->address = 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->timeout_callback); p->timeout_callback = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->completed_callback); p->completed_callback = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->connection); p->connection = 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_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)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection, METH_O, 0}, {"get_server_pid", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid, METH_NOARGS, 0}, {"get_settings", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings, METH_NOARGS, 0}, {"is_in_transaction", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9is_in_transaction, METH_NOARGS, 0}, {"prepare", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare, METH_VARARGS|METH_KEYWORDS, 0}, {"bind_execute", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute, METH_VARARGS|METH_KEYWORDS, 0}, {"bind_execute_many", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many, METH_VARARGS|METH_KEYWORDS, 0}, {"bind", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind, METH_VARARGS|METH_KEYWORDS, 0}, {"execute", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute, METH_VARARGS|METH_KEYWORDS, 0}, {"query", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26query, METH_VARARGS|METH_KEYWORDS, 0}, {"copy_out", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29copy_out, METH_VARARGS|METH_KEYWORDS, 0}, {"copy_in", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_in, METH_VARARGS|METH_KEYWORDS, 0}, {"close_statement", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35close_statement, METH_VARARGS|METH_KEYWORDS, 0}, {"is_closed", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38is_closed, METH_NOARGS, 0}, {"is_connected", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_40is_connected, METH_NOARGS, 0}, {"abort", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_42abort, METH_NOARGS, 0}, {"close", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_44close, METH_NOARGS, 0}, {"_request_cancel", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47_request_cancel, METH_NOARGS, 0}, {"_on_timeout", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_49_on_timeout, METH_O, 0}, {"_on_waiter_completed", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_51_on_waiter_completed, METH_O, 0}, {"_create_future_fallback", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_53_create_future_fallback, METH_NOARGS, 0}, {"_get_timeout", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_55_get_timeout, METH_O, 0}, {"pause_writing", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_57pause_writing, METH_NOARGS, 0}, {"resume_writing", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_59resume_writing, METH_NOARGS, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_61__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_63__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_BaseProtocol[] = { {(char *)"queries_count", __pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_queries_count, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; 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_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare *)o; 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_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_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare *)o; if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_query) { e = (*v)(p->__pyx_v_query, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_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; } static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.__pyx_scope_struct__prepare", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct__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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute *)o; 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_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_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute *)o; if (p->__pyx_v_args) { e = (*v)(p->__pyx_v_args, a); if (e) return e; } if (p->__pyx_v_args_buf) { e = (*v)(p->__pyx_v_args_buf, a); if (e) return e; } if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_return_extra) { e = (*v)(p->__pyx_v_return_extra, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.__pyx_scope_struct_1_bind_execute", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *)o; 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_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_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_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many *)o; if (p->__pyx_v_arg_bufs) { e = (*v)(p->__pyx_v_arg_bufs, a); if (e) return e; } if (p->__pyx_v_args) { e = (*v)(p->__pyx_v_args, a); if (e) return e; } if (p->__pyx_v_data_gen) { e = (*v)(p->__pyx_v_data_gen, a); if (e) return e; } if (p->__pyx_v_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_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; } static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.__pyx_scope_struct_2_bind_execute_many", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); 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; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_b); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_b) { e = (*v)(p->__pyx_v_b, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } 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_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind *)o; 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_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind *)o; if (p->__pyx_v_args) { e = (*v)(p->__pyx_v_args, a); if (e) return e; } if (p->__pyx_v_args_buf) { e = (*v)(p->__pyx_v_args_buf, a); if (e) return e; } if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.__pyx_scope_struct_4_bind", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute *)o; 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_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute *)o; if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_return_extra) { e = (*v)(p->__pyx_v_return_extra, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.__pyx_scope_struct_5_execute", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query *)o; 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_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query *)o; if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_query) { e = (*v)(p->__pyx_v_query, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.__pyx_scope_struct_6_query", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out *)o; 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_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out *)o; if (p->__pyx_v_buffer) { e = (*v)(p->__pyx_v_buffer, a); if (e) return e; } if (p->__pyx_v_copy_stmt) { e = (*v)(p->__pyx_v_copy_stmt, a); if (e) return e; } if (p->__pyx_v_done) { e = (*v)(p->__pyx_v_done, a); if (e) return e; } if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_sink) { e = (*v)(p->__pyx_v_sink, a); if (e) return e; } if (p->__pyx_v_status_msg) { e = (*v)(p->__pyx_v_status_msg, a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_timer) { e = (*v)(p->__pyx_v_timer, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.__pyx_scope_struct_7_copy_out", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in *)o; 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_6); Py_CLEAR(p->__pyx_t_7); Py_CLEAR(p->__pyx_t_8); Py_CLEAR(p->__pyx_t_9); Py_CLEAR(p->__pyx_t_10); Py_CLEAR(p->__pyx_t_11); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in *)o; if (p->__pyx_v_aiter) { e = (*v)(p->__pyx_v_aiter, a); if (e) return e; } if (p->__pyx_v_chunk) { e = (*v)(p->__pyx_v_chunk, a); if (e) return e; } if (p->__pyx_v_codec) { e = (*v)(((PyObject *)p->__pyx_v_codec), a); if (e) return e; } if (p->__pyx_v_codecs) { e = (*v)(p->__pyx_v_codecs, a); if (e) return e; } if (p->__pyx_v_copy_stmt) { e = (*v)(p->__pyx_v_copy_stmt, a); if (e) return e; } if (p->__pyx_v_data) { e = (*v)(p->__pyx_v_data, a); if (e) return e; } if (p->__pyx_v_e) { e = (*v)(p->__pyx_v_e, a); if (e) return e; } if (p->__pyx_v_item) { e = (*v)(p->__pyx_v_item, a); if (e) return e; } if (p->__pyx_v_iterator) { e = (*v)(p->__pyx_v_iterator, a); if (e) return e; } if (p->__pyx_v_reader) { e = (*v)(p->__pyx_v_reader, a); if (e) return e; } if (p->__pyx_v_record_stmt) { e = (*v)(((PyObject *)p->__pyx_v_record_stmt), a); if (e) return e; } if (p->__pyx_v_records) { e = (*v)(p->__pyx_v_records, a); if (e) return e; } if (p->__pyx_v_row) { e = (*v)(p->__pyx_v_row, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_settings) { e = (*v)(((PyObject *)p->__pyx_v_settings), a); if (e) return e; } if (p->__pyx_v_status_msg) { e = (*v)(p->__pyx_v_status_msg, a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_timer) { e = (*v)(p->__pyx_v_timer, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_v_wbuf) { e = (*v)(((PyObject *)p->__pyx_v_wbuf), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_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_8) { e = (*v)(p->__pyx_t_8, a); if (e) return e; } if (p->__pyx_t_9) { e = (*v)(p->__pyx_t_9, 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; } static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.__pyx_scope_struct_8_copy_in", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement *)o; 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_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement *)o; if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.__pyx_scope_struct_9_close_statement", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close = 0; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close *)o; if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.__pyx_scope_struct_10_close", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_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*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_protocol(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_protocol}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "protocol", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_AF_UNIX, __pyx_k_AF_UNIX, sizeof(__pyx_k_AF_UNIX), 0, 0, 1, 1}, {&__pyx_n_u_AF_UNIX, __pyx_k_AF_UNIX, sizeof(__pyx_k_AF_UNIX), 0, 1, 0, 1}, {&__pyx_n_s_ARRAY_TYPES, __pyx_k_ARRAY_TYPES, sizeof(__pyx_k_ARRAY_TYPES), 0, 0, 1, 1}, {&__pyx_n_s_AUTH_METHOD_NAME, __pyx_k_AUTH_METHOD_NAME, sizeof(__pyx_k_AUTH_METHOD_NAME), 0, 0, 1, 1}, {&__pyx_n_s_Attribute, __pyx_k_Attribute, sizeof(__pyx_k_Attribute), 0, 0, 1, 1}, {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_bind, __pyx_k_BaseProtocol_bind, sizeof(__pyx_k_BaseProtocol_bind), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_bind_execute, __pyx_k_BaseProtocol_bind_execute, sizeof(__pyx_k_BaseProtocol_bind_execute), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_bind_execute_many, __pyx_k_BaseProtocol_bind_execute_many, sizeof(__pyx_k_BaseProtocol_bind_execute_many), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_close, __pyx_k_BaseProtocol_close, sizeof(__pyx_k_BaseProtocol_close), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_close_statement, __pyx_k_BaseProtocol_close_statement, sizeof(__pyx_k_BaseProtocol_close_statement), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_copy_in, __pyx_k_BaseProtocol_copy_in, sizeof(__pyx_k_BaseProtocol_copy_in), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_copy_out, __pyx_k_BaseProtocol_copy_out, sizeof(__pyx_k_BaseProtocol_copy_out), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_execute, __pyx_k_BaseProtocol_execute, sizeof(__pyx_k_BaseProtocol_execute), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_prepare, __pyx_k_BaseProtocol_prepare, sizeof(__pyx_k_BaseProtocol_prepare), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_query, __pyx_k_BaseProtocol_query, sizeof(__pyx_k_BaseProtocol_query), 0, 0, 1, 1}, {&__pyx_n_s_BitString, __pyx_k_BitString, sizeof(__pyx_k_BitString), 0, 0, 1, 1}, {&__pyx_n_s_Box, __pyx_k_Box, sizeof(__pyx_k_Box), 0, 0, 1, 1}, {&__pyx_n_s_BufferError, __pyx_k_BufferError, sizeof(__pyx_k_BufferError), 0, 0, 1, 1}, {&__pyx_kp_u_Check_the_query_against_the_pass, __pyx_k_Check_the_query_against_the_pass, sizeof(__pyx_k_Check_the_query_against_the_pass), 0, 1, 0, 0}, {&__pyx_n_s_Circle, __pyx_k_Circle, sizeof(__pyx_k_Circle), 0, 0, 1, 1}, {&__pyx_kp_u_Codec_oid_elem_oid_core, __pyx_k_Codec_oid_elem_oid_core, sizeof(__pyx_k_Codec_oid_elem_oid_core), 0, 1, 0, 0}, {&__pyx_n_s_ConnectionDoesNotExistError, __pyx_k_ConnectionDoesNotExistError, sizeof(__pyx_k_ConnectionDoesNotExistError), 0, 0, 1, 1}, {&__pyx_kp_u_ConnectionSettings_r, __pyx_k_ConnectionSettings_r, sizeof(__pyx_k_ConnectionSettings_r), 0, 1, 0, 0}, {&__pyx_n_s_Container, __pyx_k_Container, sizeof(__pyx_k_Container), 0, 0, 1, 1}, {&__pyx_n_s_ContainerABC, __pyx_k_ContainerABC, sizeof(__pyx_k_ContainerABC), 0, 0, 1, 1}, {&__pyx_kp_u_Deallocating_buffer_with_attache, __pyx_k_Deallocating_buffer_with_attache, sizeof(__pyx_k_Deallocating_buffer_with_attache), 0, 1, 0, 0}, {&__pyx_n_s_Dec, __pyx_k_Dec, sizeof(__pyx_k_Dec), 0, 0, 1, 1}, {&__pyx_n_s_Decimal, __pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 0, 1, 1}, {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, {&__pyx_n_u_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0, 1}, {&__pyx_n_s_Future, __pyx_k_Future, sizeof(__pyx_k_Future), 0, 0, 1, 1}, {&__pyx_n_s_IPPROTO_TCP, __pyx_k_IPPROTO_TCP, sizeof(__pyx_k_IPPROTO_TCP), 0, 0, 1, 1}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0x19, __pyx_k_Incompatible_checksums_s_vs_0x19, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x19), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0x30, __pyx_k_Incompatible_checksums_s_vs_0x30, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x30), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0x7e, __pyx_k_Incompatible_checksums_s_vs_0x7e, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x7e), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb7, __pyx_k_Incompatible_checksums_s_vs_0xb7, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb7), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0xe0, __pyx_k_Incompatible_checksums_s_vs_0xe0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xe0), 0, 0, 1, 0}, {&__pyx_n_s_InterfaceError, __pyx_k_InterfaceError, sizeof(__pyx_k_InterfaceError), 0, 0, 1, 1}, {&__pyx_n_s_InternalClientError, __pyx_k_InternalClientError, sizeof(__pyx_k_InternalClientError), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_Line, __pyx_k_Line, sizeof(__pyx_k_Line), 0, 0, 1, 1}, {&__pyx_n_s_LineSegment, __pyx_k_LineSegment, sizeof(__pyx_k_LineSegment), 0, 0, 1, 1}, {&__pyx_n_s_MAXYEAR, __pyx_k_MAXYEAR, sizeof(__pyx_k_MAXYEAR), 0, 0, 1, 1}, {&__pyx_n_s_MINYEAR, __pyx_k_MINYEAR, sizeof(__pyx_k_MINYEAR), 0, 0, 1, 1}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_u_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 1, 0, 1}, {&__pyx_n_u_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 1, 0, 1}, {&__pyx_n_s_NO_TIMEOUT, __pyx_k_NO_TIMEOUT, sizeof(__pyx_k_NO_TIMEOUT), 0, 0, 1, 1}, {&__pyx_n_b_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 0, 0, 1}, {&__pyx_kp_b_NULL_2, __pyx_k_NULL_2, sizeof(__pyx_k_NULL_2), 0, 0, 0, 0}, {&__pyx_n_u_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 1, 0, 1}, {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_kp_u_Note_that_parameters_are_suppor, __pyx_k_Note_that_parameters_are_suppor, sizeof(__pyx_k_Note_that_parameters_are_suppor), 0, 1, 0, 0}, {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1}, {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, {&__pyx_kp_b_PGCOPY, __pyx_k_PGCOPY, sizeof(__pyx_k_PGCOPY), 0, 0, 0, 0}, {&__pyx_n_s_Path, __pyx_k_Path, sizeof(__pyx_k_Path), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_Point, __pyx_k_Point, sizeof(__pyx_k_Point), 0, 0, 1, 1}, {&__pyx_n_s_Polygon, __pyx_k_Polygon, sizeof(__pyx_k_Polygon), 0, 0, 1, 1}, {&__pyx_n_s_PostgresError, __pyx_k_PostgresError, sizeof(__pyx_k_PostgresError), 0, 0, 1, 1}, {&__pyx_n_s_Protocol, __pyx_k_Protocol, sizeof(__pyx_k_Protocol), 0, 0, 1, 1}, {&__pyx_n_s_Range, __pyx_k_Range, sizeof(__pyx_k_Range), 0, 0, 1, 1}, {&__pyx_n_s_Record, __pyx_k_Record, sizeof(__pyx_k_Record), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_StopAsyncIteration, __pyx_k_StopAsyncIteration, sizeof(__pyx_k_StopAsyncIteration), 0, 0, 1, 1}, {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, {&__pyx_n_s_TCP_NODELAY, __pyx_k_TCP_NODELAY, sizeof(__pyx_k_TCP_NODELAY), 0, 0, 1, 1}, {&__pyx_n_s_TYPEMAP, __pyx_k_TYPEMAP, sizeof(__pyx_k_TYPEMAP), 0, 0, 1, 1}, {&__pyx_n_s_TimeoutError, __pyx_k_TimeoutError, sizeof(__pyx_k_TimeoutError), 0, 0, 1, 1}, {&__pyx_n_u_TimeoutError, __pyx_k_TimeoutError, sizeof(__pyx_k_TimeoutError), 0, 1, 0, 1}, {&__pyx_n_s_Timer, __pyx_k_Timer, sizeof(__pyx_k_Timer), 0, 0, 1, 1}, {&__pyx_n_s_Timer___enter, __pyx_k_Timer___enter, sizeof(__pyx_k_Timer___enter), 0, 0, 1, 1}, {&__pyx_n_s_Timer___exit, __pyx_k_Timer___exit, sizeof(__pyx_k_Timer___exit), 0, 0, 1, 1}, {&__pyx_n_s_Timer___init, __pyx_k_Timer___init, sizeof(__pyx_k_Timer___init), 0, 0, 1, 1}, {&__pyx_n_s_Timer_get_remaining_budget, __pyx_k_Timer_get_remaining_budget, sizeof(__pyx_k_Timer_get_remaining_budget), 0, 0, 1, 1}, {&__pyx_kp_u_TimoutError_was_not_raised, __pyx_k_TimoutError_was_not_raised, sizeof(__pyx_k_TimoutError_was_not_raised), 0, 1, 0, 0}, {&__pyx_n_s_Type, __pyx_k_Type, sizeof(__pyx_k_Type), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_UUID, __pyx_k_UUID, sizeof(__pyx_k_UUID), 0, 0, 1, 1}, {&__pyx_n_s_UUID_2, __pyx_k_UUID_2, sizeof(__pyx_k_UUID_2), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_b__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 0, 0}, {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0}, {&__pyx_kp_b__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 0, 0}, {&__pyx_n_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 1}, {&__pyx_kp_u__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 1, 0, 0}, {&__pyx_kp_b__64, __pyx_k__64, sizeof(__pyx_k__64), 0, 0, 0, 0}, {&__pyx_kp_u__87, __pyx_k__87, sizeof(__pyx_k__87), 0, 1, 0, 0}, {&__pyx_kp_u_a_boolean_is_required_got_type, __pyx_k_a_boolean_is_required_got_type, sizeof(__pyx_k_a_boolean_is_required_got_type), 0, 1, 0, 0}, {&__pyx_kp_u_a_non_trivial_iterable_expected, __pyx_k_a_non_trivial_iterable_expected, sizeof(__pyx_k_a_non_trivial_iterable_expected), 0, 1, 0, 0}, {&__pyx_n_u_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 1, 0, 1}, {&__pyx_n_s_abort, __pyx_k_abort, sizeof(__pyx_k_abort), 0, 0, 1, 1}, {&__pyx_n_u_abstime, __pyx_k_abstime, sizeof(__pyx_k_abstime), 0, 1, 0, 1}, {&__pyx_n_u_aclitem, __pyx_k_aclitem, sizeof(__pyx_k_aclitem), 0, 1, 0, 1}, {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, {&__pyx_n_s_add_done_callback, __pyx_k_add_done_callback, sizeof(__pyx_k_add_done_callback), 0, 0, 1, 1}, {&__pyx_n_s_add_python_codec, __pyx_k_add_python_codec, sizeof(__pyx_k_add_python_codec), 0, 0, 1, 1}, {&__pyx_n_s_add_types, __pyx_k_add_types, sizeof(__pyx_k_add_types), 0, 0, 1, 1}, {&__pyx_n_s_addr, __pyx_k_addr, sizeof(__pyx_k_addr), 0, 0, 1, 1}, {&__pyx_n_s_aiter, __pyx_k_aiter, sizeof(__pyx_k_aiter), 0, 0, 1, 1}, {&__pyx_n_s_alias_to, __pyx_k_alias_to, sizeof(__pyx_k_alias_to), 0, 0, 1, 1}, {&__pyx_kp_u_already_connected, __pyx_k_already_connected, sizeof(__pyx_k_already_connected), 0, 1, 0, 0}, {&__pyx_n_u_alt, __pyx_k_alt, sizeof(__pyx_k_alt), 0, 1, 0, 1}, {&__pyx_n_s_anext, __pyx_k_anext, sizeof(__pyx_k_anext), 0, 0, 1, 1}, {&__pyx_n_u_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 1, 0, 1}, {&__pyx_n_u_anyarray, __pyx_k_anyarray, sizeof(__pyx_k_anyarray), 0, 1, 0, 1}, {&__pyx_n_u_anyelement, __pyx_k_anyelement, sizeof(__pyx_k_anyelement), 0, 1, 0, 1}, {&__pyx_n_u_anyenum, __pyx_k_anyenum, sizeof(__pyx_k_anyenum), 0, 1, 0, 1}, {&__pyx_n_u_anynonarray, __pyx_k_anynonarray, sizeof(__pyx_k_anynonarray), 0, 1, 0, 1}, {&__pyx_n_u_anyrange, __pyx_k_anyrange, sizeof(__pyx_k_anyrange), 0, 1, 0, 1}, {&__pyx_n_s_apg_exc, __pyx_k_apg_exc, sizeof(__pyx_k_apg_exc), 0, 0, 1, 1}, {&__pyx_n_s_apg_exc_base, __pyx_k_apg_exc_base, sizeof(__pyx_k_apg_exc_base), 0, 0, 1, 1}, {&__pyx_n_s_apg_types, __pyx_k_apg_types, sizeof(__pyx_k_apg_types), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_u_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 1, 0, 1}, {&__pyx_n_s_as_tuple, __pyx_k_as_tuple, sizeof(__pyx_k_as_tuple), 0, 0, 1, 1}, {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, {&__pyx_n_s_astimezone, __pyx_k_astimezone, sizeof(__pyx_k_astimezone), 0, 0, 1, 1}, {&__pyx_n_s_asyncio, __pyx_k_asyncio, sizeof(__pyx_k_asyncio), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_tasks, __pyx_k_asyncio_tasks, sizeof(__pyx_k_asyncio_tasks), 0, 0, 1, 1}, {&__pyx_n_s_asyncpg, __pyx_k_asyncpg, sizeof(__pyx_k_asyncpg), 0, 0, 1, 1}, {&__pyx_n_s_asyncpg_exceptions, __pyx_k_asyncpg_exceptions, sizeof(__pyx_k_asyncpg_exceptions), 0, 0, 1, 1}, {&__pyx_n_s_asyncpg_protocol_protocol, __pyx_k_asyncpg_protocol_protocol, sizeof(__pyx_k_asyncpg_protocol_protocol), 0, 0, 1, 1}, {&__pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_k_asyncpg_protocol_protocol_pyx, sizeof(__pyx_k_asyncpg_protocol_protocol_pyx), 0, 0, 1, 0}, {&__pyx_n_s_asyncpg_types, __pyx_k_asyncpg_types, sizeof(__pyx_k_asyncpg_types), 0, 0, 1, 1}, {&__pyx_n_u_attrnames, __pyx_k_attrnames, sizeof(__pyx_k_attrnames), 0, 1, 0, 1}, {&__pyx_n_u_attrtypoids, __pyx_k_attrtypoids, sizeof(__pyx_k_attrtypoids), 0, 1, 0, 1}, {&__pyx_n_s_auth_msg, __pyx_k_auth_msg, sizeof(__pyx_k_auth_msg), 0, 0, 1, 1}, {&__pyx_n_s_await, __pyx_k_await, sizeof(__pyx_k_await), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_u_basetype, __pyx_k_basetype, sizeof(__pyx_k_basetype), 0, 1, 0, 1}, {&__pyx_n_u_binary, __pyx_k_binary, sizeof(__pyx_k_binary), 0, 1, 0, 1}, {&__pyx_n_s_bind, __pyx_k_bind, sizeof(__pyx_k_bind), 0, 0, 1, 1}, {&__pyx_n_s_bind_execute, __pyx_k_bind_execute, sizeof(__pyx_k_bind_execute), 0, 0, 1, 1}, {&__pyx_n_s_bind_execute_many, __pyx_k_bind_execute_many, sizeof(__pyx_k_bind_execute_many), 0, 0, 1, 1}, {&__pyx_n_s_bind_execute_many_locals_genexpr, __pyx_k_bind_execute_many_locals_genexpr, sizeof(__pyx_k_bind_execute_many_locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_u_bit, __pyx_k_bit, sizeof(__pyx_k_bit), 0, 1, 0, 1}, {&__pyx_kp_u_bit_value_too_long, __pyx_k_bit_value_too_long, sizeof(__pyx_k_bit_value_too_long), 0, 1, 0, 0}, {&__pyx_n_u_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 0, 1}, {&__pyx_n_u_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 1, 0, 1}, {&__pyx_n_u_bpchar, __pyx_k_bpchar, sizeof(__pyx_k_bpchar), 0, 1, 0, 1}, {&__pyx_n_s_budget, __pyx_k_budget, sizeof(__pyx_k_budget), 0, 0, 1, 1}, {&__pyx_n_s_budget_2, __pyx_k_budget_2, sizeof(__pyx_k_budget_2), 0, 0, 1, 1}, {&__pyx_kp_u_buffer_overread, __pyx_k_buffer_overread, sizeof(__pyx_k_buffer_overread), 0, 1, 0, 0}, {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, {&__pyx_n_u_bytea, __pyx_k_bytea, sizeof(__pyx_k_bytea), 0, 1, 0, 1}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_n_b_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 0, 1}, {&__pyx_n_s_cache_key, __pyx_k_cache_key, sizeof(__pyx_k_cache_key), 0, 0, 1, 1}, {&__pyx_n_s_call_later, __pyx_k_call_later, sizeof(__pyx_k_call_later), 0, 0, 1, 1}, {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1}, {&__pyx_n_s_cancel_current_command, __pyx_k_cancel_current_command, sizeof(__pyx_k_cancel_current_command), 0, 0, 1, 1}, {&__pyx_n_s_cancelled, __pyx_k_cancelled, sizeof(__pyx_k_cancelled), 0, 0, 1, 1}, {&__pyx_kp_u_cannot_close_prepared_statement, __pyx_k_cannot_close_prepared_statement, sizeof(__pyx_k_cannot_close_prepared_statement), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_encode_Decimal_value_into, __pyx_k_cannot_encode_Decimal_value_into, sizeof(__pyx_k_cannot_encode_Decimal_value_into), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_encode_Decimal_value_into_2, __pyx_k_cannot_encode_Decimal_value_into_2, sizeof(__pyx_k_cannot_encode_Decimal_value_into_2), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_encode_Decimal_value_into_3, __pyx_k_cannot_encode_Decimal_value_into_3, sizeof(__pyx_k_cannot_encode_Decimal_value_into_3), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_encode_type_text_encoding, __pyx_k_cannot_encode_type_text_encoding, sizeof(__pyx_k_cannot_encode_type_text_encoding), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_encode_type_text_encoding_2, __pyx_k_cannot_encode_type_text_encoding_2, sizeof(__pyx_k_cannot_encode_type_text_encoding_2), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_override_codec_for_type, __pyx_k_cannot_override_codec_for_type, sizeof(__pyx_k_cannot_override_codec_for_type), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_perform_operation_another, __pyx_k_cannot_perform_operation_another, sizeof(__pyx_k_cannot_perform_operation_another), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_perform_operation_another_2, __pyx_k_cannot_perform_operation_another_2, sizeof(__pyx_k_cannot_perform_operation_another_2), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_perform_operation_connect, __pyx_k_cannot_perform_operation_connect, sizeof(__pyx_k_cannot_perform_operation_connect), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_register_core_codec_for_O, __pyx_k_cannot_register_core_codec_for_O, sizeof(__pyx_k_cannot_register_core_codec_for_O), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_start_message_for_a_non_e, __pyx_k_cannot_start_message_for_a_non_e, sizeof(__pyx_k_cannot_start_message_for_a_non_e), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_switch_to_idle_state_prot, __pyx_k_cannot_switch_to_idle_state_prot, sizeof(__pyx_k_cannot_switch_to_idle_state_prot), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_switch_to_state_another_o, __pyx_k_cannot_switch_to_state_another_o, sizeof(__pyx_k_cannot_switch_to_state_another_o), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_switch_to_state_protocol, __pyx_k_cannot_switch_to_state_protocol, sizeof(__pyx_k_cannot_switch_to_state_protocol), 0, 1, 0, 0}, {&__pyx_n_s_cause, __pyx_k_cause, sizeof(__pyx_k_cause), 0, 0, 1, 1}, {&__pyx_n_u_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 1, 0, 1}, {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, {&__pyx_n_u_cid, __pyx_k_cid, sizeof(__pyx_k_cid), 0, 1, 0, 1}, {&__pyx_n_u_cidr, __pyx_k_cidr, sizeof(__pyx_k_cidr), 0, 1, 0, 1}, {&__pyx_n_u_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 1, 0, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_clear_type_cache, __pyx_k_clear_type_cache, sizeof(__pyx_k_clear_type_cache), 0, 0, 1, 1}, {&__pyx_n_b_client_encoding, __pyx_k_client_encoding, sizeof(__pyx_k_client_encoding), 0, 0, 0, 1}, {&__pyx_n_u_client_encoding, __pyx_k_client_encoding, sizeof(__pyx_k_client_encoding), 0, 1, 0, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_close_statement, __pyx_k_close_statement, sizeof(__pyx_k_close_statement), 0, 0, 1, 1}, {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1}, {&__pyx_n_s_command_timeout, __pyx_k_command_timeout, sizeof(__pyx_k_command_timeout), 0, 0, 1, 1}, {&__pyx_n_s_compat, __pyx_k_compat, sizeof(__pyx_k_compat), 0, 0, 1, 1}, {&__pyx_n_u_composite, __pyx_k_composite, sizeof(__pyx_k_composite), 0, 1, 0, 1}, {&__pyx_n_s_con_params, __pyx_k_con_params, sizeof(__pyx_k_con_params), 0, 0, 1, 1}, {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1}, {&__pyx_n_s_conn_key, __pyx_k_conn_key, sizeof(__pyx_k_conn_key), 0, 0, 1, 1}, {&__pyx_n_s_connected_fut, __pyx_k_connected_fut, sizeof(__pyx_k_connected_fut), 0, 0, 1, 1}, {&__pyx_kp_u_connection_was_closed_in_the_mid, __pyx_k_connection_was_closed_in_the_mid, sizeof(__pyx_k_connection_was_closed_in_the_mid), 0, 1, 0, 0}, {&__pyx_n_s_copy_in, __pyx_k_copy_in, sizeof(__pyx_k_copy_in), 0, 0, 1, 1}, {&__pyx_n_s_copy_out, __pyx_k_copy_out, sizeof(__pyx_k_copy_out), 0, 0, 1, 1}, {&__pyx_n_s_copy_stmt, __pyx_k_copy_stmt, sizeof(__pyx_k_copy_stmt), 0, 0, 1, 1}, {&__pyx_n_u_cp1250, __pyx_k_cp1250, sizeof(__pyx_k_cp1250), 0, 1, 0, 1}, {&__pyx_n_u_cp1251, __pyx_k_cp1251, sizeof(__pyx_k_cp1251), 0, 1, 0, 1}, {&__pyx_n_u_cp1252, __pyx_k_cp1252, sizeof(__pyx_k_cp1252), 0, 1, 0, 1}, {&__pyx_n_u_cp1253, __pyx_k_cp1253, sizeof(__pyx_k_cp1253), 0, 1, 0, 1}, {&__pyx_n_u_cp1254, __pyx_k_cp1254, sizeof(__pyx_k_cp1254), 0, 1, 0, 1}, {&__pyx_n_u_cp1255, __pyx_k_cp1255, sizeof(__pyx_k_cp1255), 0, 1, 0, 1}, {&__pyx_n_u_cp1256, __pyx_k_cp1256, sizeof(__pyx_k_cp1256), 0, 1, 0, 1}, {&__pyx_n_u_cp1257, __pyx_k_cp1257, sizeof(__pyx_k_cp1257), 0, 1, 0, 1}, {&__pyx_n_u_cp1258, __pyx_k_cp1258, sizeof(__pyx_k_cp1258), 0, 1, 0, 1}, {&__pyx_n_u_cp1521, __pyx_k_cp1521, sizeof(__pyx_k_cp1521), 0, 1, 0, 1}, {&__pyx_n_u_cp866, __pyx_k_cp866, sizeof(__pyx_k_cp866), 0, 1, 0, 1}, {&__pyx_n_u_cp874, __pyx_k_cp874, sizeof(__pyx_k_cp874), 0, 1, 0, 1}, {&__pyx_n_u_cp932, __pyx_k_cp932, sizeof(__pyx_k_cp932), 0, 1, 0, 1}, {&__pyx_n_u_cp936, __pyx_k_cp936, sizeof(__pyx_k_cp936), 0, 1, 0, 1}, {&__pyx_n_u_cp949, __pyx_k_cp949, sizeof(__pyx_k_cp949), 0, 1, 0, 1}, {&__pyx_n_u_cp950, __pyx_k_cp950, sizeof(__pyx_k_cp950), 0, 1, 0, 1}, {&__pyx_n_s_create_future, __pyx_k_create_future, sizeof(__pyx_k_create_future), 0, 0, 1, 1}, {&__pyx_n_s_create_future_fallback, __pyx_k_create_future_fallback, sizeof(__pyx_k_create_future_fallback), 0, 0, 1, 1}, {&__pyx_n_s_create_record, __pyx_k_create_record, sizeof(__pyx_k_create_record), 0, 0, 1, 1}, {&__pyx_n_u_cstring, __pyx_k_cstring, sizeof(__pyx_k_cstring), 0, 1, 0, 1}, {&__pyx_n_b_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 0, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_database, __pyx_k_database, sizeof(__pyx_k_database), 0, 0, 1, 1}, {&__pyx_n_u_database, __pyx_k_database, sizeof(__pyx_k_database), 0, 1, 0, 1}, {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1}, {&__pyx_n_u_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 1, 0, 1}, {&__pyx_n_s_date_from_ordinal, __pyx_k_date_from_ordinal, sizeof(__pyx_k_date_from_ordinal), 0, 0, 1, 1}, {&__pyx_kp_u_date_tuple_encoder_expecting_1_e, __pyx_k_date_tuple_encoder_expecting_1_e, sizeof(__pyx_k_date_tuple_encoder_expecting_1_e), 0, 1, 0, 0}, {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1}, {&__pyx_kp_u_debug_first_buffer_of_ReadBuffer, __pyx_k_debug_first_buffer_of_ReadBuffer, sizeof(__pyx_k_debug_first_buffer_of_ReadBuffer), 0, 1, 0, 0}, {&__pyx_kp_u_debug_second_buffer_of_ReadBuffe, __pyx_k_debug_second_buffer_of_ReadBuffe, sizeof(__pyx_k_debug_second_buffer_of_ReadBuffe), 0, 1, 0, 0}, {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1}, {&__pyx_n_s_declare_fallback_codec, __pyx_k_declare_fallback_codec, sizeof(__pyx_k_declare_fallback_codec), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_kp_u_decode_row_statement_is_None, __pyx_k_decode_row_statement_is_None, sizeof(__pyx_k_decode_row_statement_is_None), 0, 1, 0, 0}, {&__pyx_n_s_decoder, __pyx_k_decoder, sizeof(__pyx_k_decoder), 0, 0, 1, 1}, {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1}, {&__pyx_n_s_desc, __pyx_k_desc, sizeof(__pyx_k_desc), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_digits, __pyx_k_digits, sizeof(__pyx_k_digits), 0, 0, 1, 1}, {&__pyx_kp_u_discarding_message_r_unread_dat, __pyx_k_discarding_message_r_unread_dat, sizeof(__pyx_k_discarding_message_r_unread_dat), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1}, {&__pyx_n_b_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 0, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_elem, __pyx_k_elem, sizeof(__pyx_k_elem), 0, 0, 1, 1}, {&__pyx_n_u_elem_has_bin_io, __pyx_k_elem_has_bin_io, sizeof(__pyx_k_elem_has_bin_io), 0, 1, 0, 1}, {&__pyx_n_u_elemdelim, __pyx_k_elemdelim, sizeof(__pyx_k_elemdelim), 0, 1, 0, 1}, {&__pyx_n_s_elems, __pyx_k_elems, sizeof(__pyx_k_elems), 0, 0, 1, 1}, {&__pyx_n_u_elemtype, __pyx_k_elemtype, sizeof(__pyx_k_elemtype), 0, 1, 0, 1}, {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, {&__pyx_kp_u_empty_first_buffer, __pyx_k_empty_first_buffer, sizeof(__pyx_k_empty_first_buffer), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_encoder, __pyx_k_encoder, sizeof(__pyx_k_encoder), 0, 0, 1, 1}, {&__pyx_kp_u_end_message_buffer_is_too_small, __pyx_k_end_message_buffer_is_too_small, sizeof(__pyx_k_end_message_buffer_is_too_small), 0, 1, 0, 0}, {&__pyx_kp_u_end_message_can_only_be_called_w, __pyx_k_end_message_can_only_be_called_w, sizeof(__pyx_k_end_message_can_only_be_called_w), 0, 1, 0, 0}, {&__pyx_kp_u_end_message_message_is_too_large, __pyx_k_end_message_message_is_too_large, sizeof(__pyx_k_end_message_message_is_too_large), 0, 1, 0, 0}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_et, __pyx_k_et, sizeof(__pyx_k_et), 0, 0, 1, 1}, {&__pyx_n_u_euc_cn, __pyx_k_euc_cn, sizeof(__pyx_k_euc_cn), 0, 1, 0, 1}, {&__pyx_n_u_euc_jis_2004, __pyx_k_euc_jis_2004, sizeof(__pyx_k_euc_jis_2004), 0, 1, 0, 1}, {&__pyx_n_u_euc_jp, __pyx_k_euc_jp, sizeof(__pyx_k_euc_jp), 0, 1, 0, 1}, {&__pyx_n_u_euc_kr, __pyx_k_euc_kr, sizeof(__pyx_k_euc_kr), 0, 1, 0, 1}, {&__pyx_n_u_euccn, __pyx_k_euccn, sizeof(__pyx_k_euccn), 0, 1, 0, 1}, {&__pyx_n_u_eucjp, __pyx_k_eucjp, sizeof(__pyx_k_eucjp), 0, 1, 0, 1}, {&__pyx_n_u_euckr, __pyx_k_euckr, sizeof(__pyx_k_euckr), 0, 1, 0, 1}, {&__pyx_n_u_event_trigger, __pyx_k_event_trigger, sizeof(__pyx_k_event_trigger), 0, 1, 0, 1}, {&__pyx_n_s_exceptions, __pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 0, 1, 1}, {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_kp_u_expected_0_1_or_2_elements_in_ra, __pyx_k_expected_0_1_or_2_elements_in_ra, sizeof(__pyx_k_expected_0_1_or_2_elements_in_ra), 0, 1, 0, 0}, {&__pyx_kp_u_expected_str_got, __pyx_k_expected_str_got, sizeof(__pyx_k_expected_str_got), 0, 1, 0, 0}, {&__pyx_n_s_exponent, __pyx_k_exponent, sizeof(__pyx_k_exponent), 0, 0, 1, 1}, {&__pyx_kp_u_failed_to_read_one_byte_on_a_non, __pyx_k_failed_to_read_one_byte_on_a_non, sizeof(__pyx_k_failed_to_read_one_byte_on_a_non), 0, 1, 0, 0}, {&__pyx_n_s_family, __pyx_k_family, sizeof(__pyx_k_family), 0, 0, 1, 1}, {&__pyx_n_u_fdw_handler, __pyx_k_fdw_handler, sizeof(__pyx_k_fdw_handler), 0, 1, 0, 1}, {&__pyx_kp_u_feed_data_bytes_object_expected, __pyx_k_feed_data_bytes_object_expected, sizeof(__pyx_k_feed_data_bytes_object_expected), 0, 1, 0, 0}, {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1}, {&__pyx_n_u_float4, __pyx_k_float4, sizeof(__pyx_k_float4), 0, 1, 0, 1}, {&__pyx_n_u_float8, __pyx_k_float8, sizeof(__pyx_k_float8), 0, 1, 0, 1}, {&__pyx_kp_u_float_value_too_large_to_be_enco, __pyx_k_float_value_too_large_to_be_enco, sizeof(__pyx_k_float_value_too_large_to_be_enco), 0, 1, 0, 0}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_frombytes, __pyx_k_frombytes, sizeof(__pyx_k_frombytes), 0, 0, 1, 1}, {&__pyx_n_s_fromordinal, __pyx_k_fromordinal, sizeof(__pyx_k_fromordinal), 0, 0, 1, 1}, {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_extra_info, __pyx_k_get_extra_info, sizeof(__pyx_k_get_extra_info), 0, 0, 1, 1}, {&__pyx_n_s_get_remaining_budget, __pyx_k_get_remaining_budget, sizeof(__pyx_k_get_remaining_budget), 0, 0, 1, 1}, {&__pyx_n_s_get_timeout, __pyx_k_get_timeout, sizeof(__pyx_k_get_timeout), 0, 0, 1, 1}, {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_kp_u_got_result_for_unknown_protocol, __pyx_k_got_result_for_unknown_protocol, sizeof(__pyx_k_got_result_for_unknown_protocol), 0, 1, 0, 0}, {&__pyx_n_u_gtsvector, __pyx_k_gtsvector, sizeof(__pyx_k_gtsvector), 0, 1, 0, 1}, {&__pyx_n_u_has_bin_io, __pyx_k_has_bin_io, sizeof(__pyx_k_has_bin_io), 0, 1, 0, 1}, {&__pyx_n_s_hashlib, __pyx_k_hashlib, sizeof(__pyx_k_hashlib), 0, 0, 1, 1}, {&__pyx_n_s_hashlib_md5, __pyx_k_hashlib_md5, sizeof(__pyx_k_hashlib_md5), 0, 0, 1, 1}, {&__pyx_n_s_hexdigest, __pyx_k_hexdigest, sizeof(__pyx_k_hexdigest), 0, 0, 1, 1}, {&__pyx_n_s_hint, __pyx_k_hint, sizeof(__pyx_k_hint), 0, 0, 1, 1}, {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, {&__pyx_kp_u_hstore_value_is_too_large, __pyx_k_hstore_value_is_too_large, sizeof(__pyx_k_hstore_value_is_too_large), 0, 1, 0, 0}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_kp_u_inconsistent_sub_array_dimension, __pyx_k_inconsistent_sub_array_dimension, sizeof(__pyx_k_inconsistent_sub_array_dimension), 0, 1, 0, 0}, {&__pyx_n_u_index_am_handler, __pyx_k_index_am_handler, sizeof(__pyx_k_index_am_handler), 0, 1, 0, 1}, {&__pyx_n_u_inet, __pyx_k_inet, sizeof(__pyx_k_inet), 0, 1, 0, 1}, {&__pyx_n_s_infinity_date, __pyx_k_infinity_date, sizeof(__pyx_k_infinity_date), 0, 0, 1, 1}, {&__pyx_n_s_infinity_datetime, __pyx_k_infinity_datetime, sizeof(__pyx_k_infinity_datetime), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_inspect, __pyx_k_inspect, sizeof(__pyx_k_inspect), 0, 0, 1, 1}, {&__pyx_kp_u_insufficient_data_in_buffer_requ, __pyx_k_insufficient_data_in_buffer_requ, sizeof(__pyx_k_insufficient_data_in_buffer_requ), 0, 1, 0, 0}, {&__pyx_n_u_int2, __pyx_k_int2, sizeof(__pyx_k_int2), 0, 1, 0, 1}, {&__pyx_n_u_int4, __pyx_k_int4, sizeof(__pyx_k_int4), 0, 1, 0, 1}, {&__pyx_n_u_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 1, 0, 1}, {&__pyx_kp_u_int_too_big_to_be_encoded_as_INT, __pyx_k_int_too_big_to_be_encoded_as_INT, sizeof(__pyx_k_int_too_big_to_be_encoded_as_INT), 0, 1, 0, 0}, {&__pyx_kp_u_int_too_big_to_be_encoded_as_INT_2, __pyx_k_int_too_big_to_be_encoded_as_INT_2, sizeof(__pyx_k_int_too_big_to_be_encoded_as_INT_2), 0, 1, 0, 0}, {&__pyx_kp_u_int_too_big_to_be_encoded_as_INT_3, __pyx_k_int_too_big_to_be_encoded_as_INT_3, sizeof(__pyx_k_int_too_big_to_be_encoded_as_INT_3), 0, 1, 0, 0}, {&__pyx_n_u_internal, __pyx_k_internal, sizeof(__pyx_k_internal), 0, 1, 0, 1}, {&__pyx_n_u_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 1, 0, 1}, {&__pyx_kp_u_interval_tuple_encoder_expecting, __pyx_k_interval_tuple_encoder_expecting, sizeof(__pyx_k_interval_tuple_encoder_expecting), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_address_family_in_value, __pyx_k_invalid_address_family_in_value, sizeof(__pyx_k_invalid_address_family_in_value), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_address_length_in_value, __pyx_k_invalid_address_length_in_value, sizeof(__pyx_k_invalid_address_length_in_value), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_array_element, __pyx_k_invalid_array_element, sizeof(__pyx_k_invalid_array_element), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_array_element_at_index, __pyx_k_invalid_array_element_at_index, sizeof(__pyx_k_invalid_array_element_at_index), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_data_format, __pyx_k_invalid_data_format, sizeof(__pyx_k_invalid_data_format), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_format_argument_expected, __pyx_k_invalid_format_argument_expected, sizeof(__pyx_k_invalid_format_argument_expected), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_network_prefix_length_in, __pyx_k_invalid_network_prefix_length_in, sizeof(__pyx_k_invalid_network_prefix_length_in), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_number_of_elements_in_tx, __pyx_k_invalid_number_of_elements_in_tx, sizeof(__pyx_k_invalid_number_of_elements_in_tx), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_rows_codecs, __pyx_k_invalid_rows_codecs, sizeof(__pyx_k_invalid_rows_codecs), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_timeout_value_expected_n, __pyx_k_invalid_timeout_value_expected_n, sizeof(__pyx_k_invalid_timeout_value_expected_n), 0, 1, 0, 0}, {&__pyx_n_s_ip_address, __pyx_k_ip_address, sizeof(__pyx_k_ip_address), 0, 0, 1, 1}, {&__pyx_n_s_ip_network, __pyx_k_ip_network, sizeof(__pyx_k_ip_network), 0, 0, 1, 1}, {&__pyx_n_s_ipaddr, __pyx_k_ipaddr, sizeof(__pyx_k_ipaddr), 0, 0, 1, 1}, {&__pyx_n_s_ipaddress, __pyx_k_ipaddress, sizeof(__pyx_k_ipaddress), 0, 0, 1, 1}, {&__pyx_n_s_ipnet, __pyx_k_ipnet, sizeof(__pyx_k_ipnet), 0, 0, 1, 1}, {&__pyx_n_s_is_closed, __pyx_k_is_closed, sizeof(__pyx_k_is_closed), 0, 0, 1, 1}, {&__pyx_n_s_isempty, __pyx_k_isempty, sizeof(__pyx_k_isempty), 0, 0, 1, 1}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_u_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 1, 0, 1}, {&__pyx_n_u_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 1, 0, 1}, {&__pyx_n_u_jsonb, __pyx_k_jsonb, sizeof(__pyx_k_jsonb), 0, 1, 0, 1}, {&__pyx_n_u_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 1, 0, 1}, {&__pyx_n_u_koi8_r, __pyx_k_koi8_r, sizeof(__pyx_k_koi8_r), 0, 1, 0, 1}, {&__pyx_n_u_koi8_u, __pyx_k_koi8_u, sizeof(__pyx_k_koi8_u), 0, 1, 0, 1}, {&__pyx_n_u_koi8r, __pyx_k_koi8r, sizeof(__pyx_k_koi8r), 0, 1, 0, 1}, {&__pyx_n_u_koi8u, __pyx_k_koi8u, sizeof(__pyx_k_koi8u), 0, 1, 0, 1}, {&__pyx_n_u_language_handler, __pyx_k_language_handler, sizeof(__pyx_k_language_handler), 0, 1, 0, 1}, {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1}, {&__pyx_n_u_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 1, 0, 1}, {&__pyx_kp_u_list_or_tuple_expected_got_type, __pyx_k_list_or_tuple_expected_got_type, sizeof(__pyx_k_list_or_tuple_expected_got_type), 0, 1, 0, 0}, {&__pyx_kp_u_list_tuple_or_Range_object_expec, __pyx_k_list_tuple_or_Range_object_expec, sizeof(__pyx_k_list_tuple_or_Range_object_expec), 0, 1, 0, 0}, {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, {&__pyx_n_s_loop_2, __pyx_k_loop_2, sizeof(__pyx_k_loop_2), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_lower_inc, __pyx_k_lower_inc, sizeof(__pyx_k_lower_inc), 0, 0, 1, 1}, {&__pyx_n_u_lseg, __pyx_k_lseg, sizeof(__pyx_k_lseg), 0, 1, 0, 1}, {&__pyx_n_u_macaddr, __pyx_k_macaddr, sizeof(__pyx_k_macaddr), 0, 1, 0, 1}, {&__pyx_n_u_macaddr8, __pyx_k_macaddr8, sizeof(__pyx_k_macaddr8), 0, 1, 0, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_kp_u_malformed_array_literal_r, __pyx_k_malformed_array_literal_r, sizeof(__pyx_k_malformed_array_literal_r), 0, 1, 0, 0}, {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1}, {&__pyx_n_b_md5, __pyx_k_md5, sizeof(__pyx_k_md5), 0, 0, 0, 1}, {&__pyx_n_s_md5, __pyx_k_md5, sizeof(__pyx_k_md5), 0, 0, 1, 1}, {&__pyx_n_s_memoryview, __pyx_k_memoryview, sizeof(__pyx_k_memoryview), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1}, {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1}, {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1}, {&__pyx_kp_u_missing_after_array_dimensions, __pyx_k_missing_after_array_dimensions, sizeof(__pyx_k_missing_after_array_dimensions), 0, 1, 0, 0}, {&__pyx_kp_u_missing_after_array_dimensions_2, __pyx_k_missing_after_array_dimensions_2, sizeof(__pyx_k_missing_after_array_dimensions_2), 0, 1, 0, 0}, {&__pyx_kp_u_missing_array_dimension_value, __pyx_k_missing_array_dimension_value, sizeof(__pyx_k_missing_array_dimension_value), 0, 1, 0, 0}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_u_money, __pyx_k_money, sizeof(__pyx_k_money), 0, 1, 0, 1}, {&__pyx_n_s_monotonic, __pyx_k_monotonic, sizeof(__pyx_k_monotonic), 0, 0, 1, 1}, {&__pyx_n_u_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 1, 0, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_negative_infinity_date, __pyx_k_negative_infinity_date, sizeof(__pyx_k_negative_infinity_date), 0, 0, 1, 1}, {&__pyx_n_s_negative_infinity_datetime, __pyx_k_negative_infinity_datetime, sizeof(__pyx_k_negative_infinity_datetime), 0, 0, 1, 1}, {&__pyx_n_s_network_address, __pyx_k_network_address, sizeof(__pyx_k_network_address), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_new_2, __pyx_k_new_2, sizeof(__pyx_k_new_2), 0, 0, 1, 1}, {&__pyx_n_s_new_prefix, __pyx_k_new_prefix, sizeof(__pyx_k_new_prefix), 0, 0, 1, 1}, {&__pyx_kp_u_no_binary_format_encoder_for_typ, __pyx_k_no_binary_format_encoder_for_typ, sizeof(__pyx_k_no_binary_format_encoder_for_typ), 0, 1, 0, 0}, {&__pyx_kp_u_no_codec_for_composite_attribute, __pyx_k_no_codec_for_composite_attribute, sizeof(__pyx_k_no_codec_for_composite_attribute), 0, 1, 0, 0}, {&__pyx_kp_u_no_decoder_for_OID, __pyx_k_no_decoder_for_OID, sizeof(__pyx_k_no_decoder_for_OID), 0, 1, 0, 0}, {&__pyx_kp_u_no_decoder_for_composite_type_el, __pyx_k_no_decoder_for_composite_type_el, sizeof(__pyx_k_no_decoder_for_composite_type_el), 0, 1, 0, 0}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_kp_u_no_encoder_for_OID, __pyx_k_no_encoder_for_OID, sizeof(__pyx_k_no_encoder_for_OID), 0, 1, 0, 0}, {&__pyx_kp_u_no_message_to_consume, __pyx_k_no_message_to_consume, sizeof(__pyx_k_no_message_to_consume), 0, 1, 0, 0}, {&__pyx_kp_u_no_message_to_discard, __pyx_k_no_message_to_discard, sizeof(__pyx_k_no_message_to_discard), 0, 1, 0, 0}, {&__pyx_kp_u_non_homogeneous_array, __pyx_k_non_homogeneous_array, sizeof(__pyx_k_non_homogeneous_array), 0, 1, 0, 0}, {&__pyx_kp_u_not_connected, __pyx_k_not_connected, sizeof(__pyx_k_not_connected), 0, 1, 0, 0}, {&__pyx_kp_u_not_enough_data_to_read_bytes, __pyx_k_not_enough_data_to_read_bytes, sizeof(__pyx_k_not_enough_data_to_read_bytes), 0, 1, 0, 0}, {&__pyx_kp_u_not_enough_data_to_read_one_byte, __pyx_k_not_enough_data_to_read_one_byte, sizeof(__pyx_k_not_enough_data_to_read_one_byte), 0, 1, 0, 0}, {&__pyx_n_u_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 1, 0, 1}, {&__pyx_kp_u_null_value_not_allowed_in_hstore, __pyx_k_null_value_not_allowed_in_hstore, sizeof(__pyx_k_null_value_not_allowed_in_hstore), 0, 1, 0, 0}, {&__pyx_kp_u_number_of_array_dimensions_excee, __pyx_k_number_of_array_dimensions_excee, sizeof(__pyx_k_number_of_array_dimensions_excee), 0, 1, 0, 0}, {&__pyx_kp_u_number_of_columns_in_result_is_d, __pyx_k_number_of_columns_in_result_is_d, sizeof(__pyx_k_number_of_columns_in_result_is_d), 0, 1, 0, 0}, {&__pyx_n_u_numeric, __pyx_k_numeric, sizeof(__pyx_k_numeric), 0, 1, 0, 1}, {&__pyx_kp_u_numeric_type_does_not_support_in, __pyx_k_numeric_type_does_not_support_in, sizeof(__pyx_k_numeric_type_does_not_support_in), 0, 1, 0, 0}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_oid, __pyx_k_oid, sizeof(__pyx_k_oid), 0, 0, 1, 1}, {&__pyx_n_u_oid, __pyx_k_oid, sizeof(__pyx_k_oid), 0, 1, 0, 1}, {&__pyx_kp_u_oid_2, __pyx_k_oid_2, sizeof(__pyx_k_oid_2), 0, 1, 0, 0}, {&__pyx_n_s_on_error, __pyx_k_on_error, sizeof(__pyx_k_on_error), 0, 0, 1, 1}, {&__pyx_kp_u_on_result__prepare_statement_is, __pyx_k_on_result__prepare_statement_is, sizeof(__pyx_k_on_result__prepare_statement_is), 0, 1, 0, 0}, {&__pyx_kp_u_on_result_waiter_is_None, __pyx_k_on_result_waiter_is_None, sizeof(__pyx_k_on_result_waiter_is_None), 0, 1, 0, 0}, {&__pyx_kp_u_on_result_waiter_is_done, __pyx_k_on_result_waiter_is_done, sizeof(__pyx_k_on_result_waiter_is_done), 0, 1, 0, 0}, {&__pyx_n_s_on_timeout, __pyx_k_on_timeout, sizeof(__pyx_k_on_timeout), 0, 0, 1, 1}, {&__pyx_n_s_on_waiter_completed, __pyx_k_on_waiter_completed, sizeof(__pyx_k_on_waiter_completed), 0, 0, 1, 1}, {&__pyx_n_u_opaque, __pyx_k_opaque, sizeof(__pyx_k_opaque), 0, 1, 0, 1}, {&__pyx_n_s_packed, __pyx_k_packed, sizeof(__pyx_k_packed), 0, 0, 1, 1}, {&__pyx_kp_u_parse_data_msgs_first_message_i, __pyx_k_parse_data_msgs_first_message_i, sizeof(__pyx_k_parse_data_msgs_first_message_i), 0, 1, 0, 0}, {&__pyx_kp_u_parse_data_msgs_result_is_not_a, __pyx_k_parse_data_msgs_result_is_not_a, sizeof(__pyx_k_parse_data_msgs_result_is_not_a), 0, 1, 0, 0}, {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1}, {&__pyx_n_u_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 1, 0, 1}, {&__pyx_kp_u_path_value_too_long, __pyx_k_path_value_too_long, sizeof(__pyx_k_path_value_too_long), 0, 1, 0, 0}, {&__pyx_n_s_pause_reading, __pyx_k_pause_reading, sizeof(__pyx_k_pause_reading), 0, 0, 1, 1}, {&__pyx_n_u_pg_catalog, __pyx_k_pg_catalog, sizeof(__pyx_k_pg_catalog), 0, 1, 0, 1}, {&__pyx_kp_u_pg_contrib_hstore, __pyx_k_pg_contrib_hstore, sizeof(__pyx_k_pg_contrib_hstore), 0, 1, 0, 0}, {&__pyx_n_u_pg_ddl_command, __pyx_k_pg_ddl_command, sizeof(__pyx_k_pg_ddl_command), 0, 1, 0, 1}, {&__pyx_n_u_pg_dependencies, __pyx_k_pg_dependencies, sizeof(__pyx_k_pg_dependencies), 0, 1, 0, 1}, {&__pyx_n_s_pg_epoch_date, __pyx_k_pg_epoch_date, sizeof(__pyx_k_pg_epoch_date), 0, 0, 1, 1}, {&__pyx_n_s_pg_epoch_datetime, __pyx_k_pg_epoch_datetime, sizeof(__pyx_k_pg_epoch_datetime), 0, 0, 1, 1}, {&__pyx_n_s_pg_epoch_datetime_utc, __pyx_k_pg_epoch_datetime_utc, sizeof(__pyx_k_pg_epoch_datetime_utc), 0, 0, 1, 1}, {&__pyx_n_u_pg_lsn, __pyx_k_pg_lsn, sizeof(__pyx_k_pg_lsn), 0, 1, 0, 1}, {&__pyx_n_u_pg_ndistinct, __pyx_k_pg_ndistinct, sizeof(__pyx_k_pg_ndistinct), 0, 1, 0, 1}, {&__pyx_n_u_pg_node_tree, __pyx_k_pg_node_tree, sizeof(__pyx_k_pg_node_tree), 0, 1, 0, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_u_point, __pyx_k_point, sizeof(__pyx_k_point), 0, 1, 0, 1}, {&__pyx_n_u_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 1, 0, 1}, {&__pyx_kp_u_polygon_value_too_long, __pyx_k_polygon_value_too_long, sizeof(__pyx_k_polygon_value_too_long), 0, 1, 0, 0}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_popleft, __pyx_k_popleft, sizeof(__pyx_k_popleft), 0, 0, 1, 1}, {&__pyx_n_s_portal_name, __pyx_k_portal_name, sizeof(__pyx_k_portal_name), 0, 0, 1, 1}, {&__pyx_n_s_prefixlen, __pyx_k_prefixlen, sizeof(__pyx_k_prefixlen), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_prepare_2, __pyx_k_prepare_2, sizeof(__pyx_k_prepare_2), 0, 0, 1, 1}, {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, {&__pyx_n_s_process_log_message, __pyx_k_process_log_message, sizeof(__pyx_k_process_log_message), 0, 0, 1, 1}, {&__pyx_n_s_process_notification, __pyx_k_process_notification, sizeof(__pyx_k_process_notification), 0, 0, 1, 1}, {&__pyx_n_s_protocol, __pyx_k_protocol, sizeof(__pyx_k_protocol), 0, 0, 1, 1}, {&__pyx_kp_u_protocol_is_already_in_the_idle, __pyx_k_protocol_is_already_in_the_idle, sizeof(__pyx_k_protocol_is_already_in_the_idle), 0, 1, 0, 0}, {&__pyx_kp_u_protocol_is_in_an_unknown_state, __pyx_k_protocol_is_in_an_unknown_state, sizeof(__pyx_k_protocol_is_in_an_unknown_state), 0, 1, 0, 0}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_BaseProtocol, __pyx_k_pyx_unpickle_BaseProtocol, sizeof(__pyx_k_pyx_unpickle_BaseProtocol), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_CoreProtocol, __pyx_k_pyx_unpickle_CoreProtocol, sizeof(__pyx_k_pyx_unpickle_CoreProtocol), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_DataCodecConfig, __pyx_k_pyx_unpickle_DataCodecConfig, sizeof(__pyx_k_pyx_unpickle_DataCodecConfig), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_FastReadBuffer, __pyx_k_pyx_unpickle_FastReadBuffer, sizeof(__pyx_k_pyx_unpickle_FastReadBuffer), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_Memory, __pyx_k_pyx_unpickle_Memory, sizeof(__pyx_k_pyx_unpickle_Memory), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, {&__pyx_n_b_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 0, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_u_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 1, 0, 1}, {&__pyx_n_u_range_subtype, __pyx_k_range_subtype, sizeof(__pyx_k_range_subtype), 0, 1, 0, 1}, {&__pyx_kp_u_read_cstr_buffer_overread, __pyx_k_read_cstr_buffer_overread, sizeof(__pyx_k_read_cstr_buffer_overread), 0, 1, 0, 0}, {&__pyx_kp_u_read_cstr_only_works_when_the_me, __pyx_k_read_cstr_only_works_when_the_me, sizeof(__pyx_k_read_cstr_only_works_when_the_me), 0, 1, 0, 0}, {&__pyx_n_s_reader, __pyx_k_reader, sizeof(__pyx_k_reader), 0, 0, 1, 1}, {&__pyx_kp_u_reader_is_not_an_asynchronous_it, __pyx_k_reader_is_not_an_asynchronous_it, sizeof(__pyx_k_reader_is_not_an_asynchronous_it), 0, 1, 0, 0}, {&__pyx_n_s_rec, __pyx_k_rec, sizeof(__pyx_k_rec), 0, 0, 1, 1}, {&__pyx_n_u_record, __pyx_k_record, sizeof(__pyx_k_record), 0, 1, 0, 1}, {&__pyx_n_s_record_stmt, __pyx_k_record_stmt, sizeof(__pyx_k_record_stmt), 0, 0, 1, 1}, {&__pyx_n_s_records, __pyx_k_records, sizeof(__pyx_k_records), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_u_refcursor, __pyx_k_refcursor, sizeof(__pyx_k_refcursor), 0, 1, 0, 1}, {&__pyx_n_u_regclass, __pyx_k_regclass, sizeof(__pyx_k_regclass), 0, 1, 0, 1}, {&__pyx_n_u_regconfig, __pyx_k_regconfig, sizeof(__pyx_k_regconfig), 0, 1, 0, 1}, {&__pyx_n_u_regdictionary, __pyx_k_regdictionary, sizeof(__pyx_k_regdictionary), 0, 1, 0, 1}, {&__pyx_n_u_regnamespace, __pyx_k_regnamespace, sizeof(__pyx_k_regnamespace), 0, 1, 0, 1}, {&__pyx_n_u_regoper, __pyx_k_regoper, sizeof(__pyx_k_regoper), 0, 1, 0, 1}, {&__pyx_n_u_regoperator, __pyx_k_regoperator, sizeof(__pyx_k_regoperator), 0, 1, 0, 1}, {&__pyx_n_u_regproc, __pyx_k_regproc, sizeof(__pyx_k_regproc), 0, 1, 0, 1}, {&__pyx_n_u_regprocedure, __pyx_k_regprocedure, sizeof(__pyx_k_regprocedure), 0, 1, 0, 1}, {&__pyx_n_u_regrole, __pyx_k_regrole, sizeof(__pyx_k_regrole), 0, 1, 0, 1}, {&__pyx_n_u_regtype, __pyx_k_regtype, sizeof(__pyx_k_regtype), 0, 1, 0, 1}, {&__pyx_n_s_release, __pyx_k_release, sizeof(__pyx_k_release), 0, 0, 1, 1}, {&__pyx_n_u_reltime, __pyx_k_reltime, sizeof(__pyx_k_reltime), 0, 1, 0, 1}, {&__pyx_n_s_remove_python_codec, __pyx_k_remove_python_codec, sizeof(__pyx_k_remove_python_codec), 0, 0, 1, 1}, {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, {&__pyx_n_s_request_cancel, __pyx_k_request_cancel, sizeof(__pyx_k_request_cancel), 0, 0, 1, 1}, {&__pyx_n_s_resume_reading, __pyx_k_resume_reading, sizeof(__pyx_k_resume_reading), 0, 0, 1, 1}, {&__pyx_n_s_return_extra, __pyx_k_return_extra, sizeof(__pyx_k_return_extra), 0, 0, 1, 1}, {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 1}, {&__pyx_n_u_scalar, __pyx_k_scalar, sizeof(__pyx_k_scalar), 0, 1, 0, 1}, {&__pyx_n_s_schema, __pyx_k_schema, sizeof(__pyx_k_schema), 0, 0, 1, 1}, {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, {&__pyx_n_s_server_settings, __pyx_k_server_settings, sizeof(__pyx_k_server_settings), 0, 0, 1, 1}, {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, {&__pyx_n_s_set_builtin_type_codec, __pyx_k_set_builtin_type_codec, sizeof(__pyx_k_set_builtin_type_codec), 0, 0, 1, 1}, {&__pyx_n_s_set_builtin_type_codec_2, __pyx_k_set_builtin_type_codec_2, sizeof(__pyx_k_set_builtin_type_codec_2), 0, 0, 1, 1}, {&__pyx_n_s_set_exception, __pyx_k_set_exception, sizeof(__pyx_k_set_exception), 0, 0, 1, 1}, {&__pyx_n_s_set_result, __pyx_k_set_result, sizeof(__pyx_k_set_result), 0, 0, 1, 1}, {&__pyx_n_s_setsockopt, __pyx_k_setsockopt, sizeof(__pyx_k_setsockopt), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_u_shift_jis, __pyx_k_shift_jis, sizeof(__pyx_k_shift_jis), 0, 1, 0, 1}, {&__pyx_n_u_shift_jis_2004, __pyx_k_shift_jis_2004, sizeof(__pyx_k_shift_jis_2004), 0, 1, 0, 1}, {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1}, {&__pyx_n_s_sink, __pyx_k_sink, sizeof(__pyx_k_sink), 0, 0, 1, 1}, {&__pyx_n_u_sjis, __pyx_k_sjis, sizeof(__pyx_k_sjis), 0, 1, 0, 1}, {&__pyx_n_u_smgr, __pyx_k_smgr, sizeof(__pyx_k_smgr), 0, 1, 0, 1}, {&__pyx_n_s_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 0, 1, 1}, {&__pyx_n_u_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 1, 0, 1}, {&__pyx_kp_u_specified_array_dimensions_do_no, __pyx_k_specified_array_dimensions_do_no, sizeof(__pyx_k_specified_array_dimensions_do_no), 0, 1, 0, 0}, {&__pyx_n_u_sql_ascii, __pyx_k_sql_ascii, sizeof(__pyx_k_sql_ascii), 0, 1, 0, 1}, {&__pyx_n_s_started, __pyx_k_started, sizeof(__pyx_k_started), 0, 0, 1, 1}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_stmt_name, __pyx_k_stmt_name, sizeof(__pyx_k_stmt_name), 0, 0, 1, 1}, {&__pyx_kp_u_string_too_long, __pyx_k_string_too_long, sizeof(__pyx_k_string_too_long), 0, 1, 0, 0}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_supernet, __pyx_k_supernet, sizeof(__pyx_k_supernet), 0, 0, 1, 1}, {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, {&__pyx_n_u_tcvn, __pyx_k_tcvn, sizeof(__pyx_k_tcvn), 0, 1, 0, 1}, {&__pyx_n_u_tcvn5712, __pyx_k_tcvn5712, sizeof(__pyx_k_tcvn5712), 0, 1, 0, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_u_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 1, 0, 1}, {&__pyx_kp_u_text_2, __pyx_k_text_2, sizeof(__pyx_k_text_2), 0, 1, 0, 0}, {&__pyx_kp_u_text_binary_or_tuple, __pyx_k_text_binary_or_tuple, sizeof(__pyx_k_text_binary_or_tuple), 0, 1, 0, 0}, {&__pyx_kp_u_the_buffer_is_in_read_only_mode, __pyx_k_the_buffer_is_in_read_only_mode, sizeof(__pyx_k_the_buffer_is_in_read_only_mode), 0, 1, 0, 0}, {&__pyx_kp_u_the_number_of_query_arguments_ca, __pyx_k_the_number_of_query_arguments_ca, sizeof(__pyx_k_the_number_of_query_arguments_ca), 0, 1, 0, 0}, {&__pyx_kp_u_the_server_expects_x_argument_s, __pyx_k_the_server_expects_x_argument_s, sizeof(__pyx_k_the_server_expects_x_argument_s), 0, 1, 0, 0}, {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, {&__pyx_n_u_tid, __pyx_k_tid, sizeof(__pyx_k_tid), 0, 1, 0, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_u_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 1, 0, 1}, {&__pyx_kp_u_time_tuple_encoder_expecting_1_e, __pyx_k_time_tuple_encoder_expecting_1_e, sizeof(__pyx_k_time_tuple_encoder_expecting_1_e), 0, 1, 0, 0}, {&__pyx_kp_u_time_tuple_encoder_expecting_2_e, __pyx_k_time_tuple_encoder_expecting_2_e, sizeof(__pyx_k_time_tuple_encoder_expecting_2_e), 0, 1, 0, 0}, {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1}, {&__pyx_n_u_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 1, 0, 1}, {&__pyx_kp_u_timestamp_tuple_encoder_expectin, __pyx_k_timestamp_tuple_encoder_expectin, sizeof(__pyx_k_timestamp_tuple_encoder_expectin), 0, 1, 0, 0}, {&__pyx_n_u_timestamptz, __pyx_k_timestamptz, sizeof(__pyx_k_timestamptz), 0, 1, 0, 1}, {&__pyx_n_u_timetz, __pyx_k_timetz, sizeof(__pyx_k_timetz), 0, 1, 0, 1}, {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1}, {&__pyx_n_u_tinterval, __pyx_k_tinterval, sizeof(__pyx_k_tinterval), 0, 1, 0, 1}, {&__pyx_kp_u_too_many_elements_in_array_value, __pyx_k_too_many_elements_in_array_value, sizeof(__pyx_k_too_many_elements_in_array_value), 0, 1, 0, 0}, {&__pyx_kp_u_too_many_elements_in_composite_t, __pyx_k_too_many_elements_in_composite_t, sizeof(__pyx_k_too_many_elements_in_composite_t), 0, 1, 0, 0}, {&__pyx_n_s_toordinal, __pyx_k_toordinal, sizeof(__pyx_k_toordinal), 0, 0, 1, 1}, {&__pyx_n_u_trigger, __pyx_k_trigger, sizeof(__pyx_k_trigger), 0, 1, 0, 1}, {&__pyx_n_u_tsm_handler, __pyx_k_tsm_handler, sizeof(__pyx_k_tsm_handler), 0, 1, 0, 1}, {&__pyx_n_u_tsquery, __pyx_k_tsquery, sizeof(__pyx_k_tsquery), 0, 1, 0, 1}, {&__pyx_n_u_tsvector, __pyx_k_tsvector, sizeof(__pyx_k_tsvector), 0, 1, 0, 1}, {&__pyx_n_u_tuple, __pyx_k_tuple, sizeof(__pyx_k_tuple), 0, 1, 0, 1}, {&__pyx_n_u_txid_snapshot, __pyx_k_txid_snapshot, sizeof(__pyx_k_txid_snapshot), 0, 1, 0, 1}, {&__pyx_kp_u_txid_snapshot_value_is_too_long, __pyx_k_txid_snapshot_value_is_too_long, sizeof(__pyx_k_txid_snapshot_value_is_too_long), 0, 1, 0, 0}, {&__pyx_kp_u_type_does_not_support_tuple_exc, __pyx_k_type_does_not_support_tuple_exc, sizeof(__pyx_k_type_does_not_support_tuple_exc), 0, 1, 0, 0}, {&__pyx_kp_u_type_record_missing_base_type_fo, __pyx_k_type_record_missing_base_type_fo, sizeof(__pyx_k_type_record_missing_base_type_fo), 0, 1, 0, 0}, {&__pyx_kp_u_type_record_missing_base_type_fo_2, __pyx_k_type_record_missing_base_type_fo_2, sizeof(__pyx_k_type_record_missing_base_type_fo_2), 0, 1, 0, 0}, {&__pyx_kp_u_type_record_missing_field_types, __pyx_k_type_record_missing_field_types, sizeof(__pyx_k_type_record_missing_field_types), 0, 1, 0, 0}, {&__pyx_n_s_typekind, __pyx_k_typekind, sizeof(__pyx_k_typekind), 0, 0, 1, 1}, {&__pyx_n_s_typename, __pyx_k_typename, sizeof(__pyx_k_typename), 0, 0, 1, 1}, {&__pyx_n_s_typeoid, __pyx_k_typeoid, sizeof(__pyx_k_typeoid), 0, 0, 1, 1}, {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, {&__pyx_n_s_typeschema, __pyx_k_typeschema, sizeof(__pyx_k_typeschema), 0, 0, 1, 1}, {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1}, {&__pyx_kp_u_unexpected_JSONB_format, __pyx_k_unexpected_JSONB_format, sizeof(__pyx_k_unexpected_JSONB_format), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_character_r_at_positi, __pyx_k_unexpected_character_r_at_positi, sizeof(__pyx_k_unexpected_character_r_at_positi), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_codec_type, __pyx_k_unexpected_codec_type, sizeof(__pyx_k_unexpected_codec_type), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_data_format, __pyx_k_unexpected_data_format, sizeof(__pyx_k_unexpected_data_format), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_data_type_of_composit, __pyx_k_unexpected_data_type_of_composit, sizeof(__pyx_k_unexpected_data_type_of_composit), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_end_of_string, __pyx_k_unexpected_end_of_string, sizeof(__pyx_k_unexpected_end_of_string), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_exchange_format, __pyx_k_unexpected_exchange_format, sizeof(__pyx_k_unexpected_exchange_format), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_instance_of_anyarray, __pyx_k_unexpected_instance_of_anyarray, sizeof(__pyx_k_unexpected_instance_of_anyarray), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_ndims_value, __pyx_k_unexpected_ndims_value, sizeof(__pyx_k_unexpected_ndims_value), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_trailing_bytes_in_buf, __pyx_k_unexpected_trailing_bytes_in_buf, sizeof(__pyx_k_unexpected_trailing_bytes_in_buf), 0, 1, 0, 0}, {&__pyx_kp_u_unhandled_standard_data_type_r_O, __pyx_k_unhandled_standard_data_type_r_O, sizeof(__pyx_k_unhandled_standard_data_type_r_O), 0, 1, 0, 0}, {&__pyx_n_u_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 1, 0, 1}, {&__pyx_n_u_unknown, __pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 1, 0, 1}, {&__pyx_kp_u_unknown_alias_target, __pyx_k_unknown_alias_target, sizeof(__pyx_k_unknown_alias_target), 0, 1, 0, 0}, {&__pyx_kp_u_unknown_error_in_protocol_implem, __pyx_k_unknown_error_in_protocol_implem, sizeof(__pyx_k_unknown_error_in_protocol_implem), 0, 1, 0, 0}, {&__pyx_kp_u_unsupported_authentication_metho, __pyx_k_unsupported_authentication_metho, sizeof(__pyx_k_unsupported_authentication_metho), 0, 1, 0, 0}, {&__pyx_kp_u_unsupported_authentication_metho_2, __pyx_k_unsupported_authentication_metho_2, sizeof(__pyx_k_unsupported_authentication_metho_2), 0, 1, 0, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, {&__pyx_n_s_upper_inc, __pyx_k_upper_inc, sizeof(__pyx_k_upper_inc), 0, 0, 1, 1}, {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1}, {&__pyx_n_u_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 1, 0, 1}, {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 0, 1, 1}, {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1}, {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, {&__pyx_n_u_utf_8_2, __pyx_k_utf_8_2, sizeof(__pyx_k_utf_8_2), 0, 1, 0, 1}, {&__pyx_n_s_uuid, __pyx_k_uuid, sizeof(__pyx_k_uuid), 0, 0, 1, 1}, {&__pyx_n_u_uuid, __pyx_k_uuid, sizeof(__pyx_k_uuid), 0, 1, 0, 1}, {&__pyx_n_u_varbit, __pyx_k_varbit, sizeof(__pyx_k_varbit), 0, 1, 0, 1}, {&__pyx_n_u_varchar, __pyx_k_varchar, sizeof(__pyx_k_varchar), 0, 1, 0, 1}, {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, {&__pyx_n_u_void, __pyx_k_void, sizeof(__pyx_k_void), 0, 1, 0, 1}, {&__pyx_n_u_vscii, __pyx_k_vscii, sizeof(__pyx_k_vscii), 0, 1, 0, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {&__pyx_n_s_wait_for, __pyx_k_wait_for, sizeof(__pyx_k_wait_for), 0, 0, 1, 1}, {&__pyx_kp_u_waiter_is_not_done_while_handlin, __pyx_k_waiter_is_not_done_while_handlin, sizeof(__pyx_k_waiter_is_not_done_while_handlin), 0, 1, 0, 0}, {&__pyx_n_u_was, __pyx_k_was, sizeof(__pyx_k_was), 0, 1, 0, 1}, {&__pyx_n_u_were, __pyx_k_were, sizeof(__pyx_k_were), 0, 1, 0, 1}, {&__pyx_n_u_win, __pyx_k_win, sizeof(__pyx_k_win), 0, 1, 0, 1}, {&__pyx_n_u_win1250, __pyx_k_win1250, sizeof(__pyx_k_win1250), 0, 1, 0, 1}, {&__pyx_n_u_win1251, __pyx_k_win1251, sizeof(__pyx_k_win1251), 0, 1, 0, 1}, {&__pyx_n_u_win1252, __pyx_k_win1252, sizeof(__pyx_k_win1252), 0, 1, 0, 1}, {&__pyx_n_u_win1253, __pyx_k_win1253, sizeof(__pyx_k_win1253), 0, 1, 0, 1}, {&__pyx_n_u_win1254, __pyx_k_win1254, sizeof(__pyx_k_win1254), 0, 1, 0, 1}, {&__pyx_n_u_win1255, __pyx_k_win1255, sizeof(__pyx_k_win1255), 0, 1, 0, 1}, {&__pyx_n_u_win1256, __pyx_k_win1256, sizeof(__pyx_k_win1256), 0, 1, 0, 1}, {&__pyx_n_u_win1257, __pyx_k_win1257, sizeof(__pyx_k_win1257), 0, 1, 0, 1}, {&__pyx_n_u_win1258, __pyx_k_win1258, sizeof(__pyx_k_win1258), 0, 1, 0, 1}, {&__pyx_n_u_win866, __pyx_k_win866, sizeof(__pyx_k_win866), 0, 1, 0, 1}, {&__pyx_n_u_win874, __pyx_k_win874, sizeof(__pyx_k_win874), 0, 1, 0, 1}, {&__pyx_n_u_win932, __pyx_k_win932, sizeof(__pyx_k_win932), 0, 1, 0, 1}, {&__pyx_n_u_win936, __pyx_k_win936, sizeof(__pyx_k_win936), 0, 1, 0, 1}, {&__pyx_n_u_win949, __pyx_k_win949, sizeof(__pyx_k_win949), 0, 1, 0, 1}, {&__pyx_n_u_win950, __pyx_k_win950, sizeof(__pyx_k_win950), 0, 1, 0, 1}, {&__pyx_n_u_windows1250, __pyx_k_windows1250, sizeof(__pyx_k_windows1250), 0, 1, 0, 1}, {&__pyx_n_u_windows1251, __pyx_k_windows1251, sizeof(__pyx_k_windows1251), 0, 1, 0, 1}, {&__pyx_n_u_windows1252, __pyx_k_windows1252, sizeof(__pyx_k_windows1252), 0, 1, 0, 1}, {&__pyx_n_u_windows1253, __pyx_k_windows1253, sizeof(__pyx_k_windows1253), 0, 1, 0, 1}, {&__pyx_n_u_windows1254, __pyx_k_windows1254, sizeof(__pyx_k_windows1254), 0, 1, 0, 1}, {&__pyx_n_u_windows1255, __pyx_k_windows1255, sizeof(__pyx_k_windows1255), 0, 1, 0, 1}, {&__pyx_n_u_windows1256, __pyx_k_windows1256, sizeof(__pyx_k_windows1256), 0, 1, 0, 1}, {&__pyx_n_u_windows1257, __pyx_k_windows1257, sizeof(__pyx_k_windows1257), 0, 1, 0, 1}, {&__pyx_n_u_windows1258, __pyx_k_windows1258, sizeof(__pyx_k_windows1258), 0, 1, 0, 1}, {&__pyx_n_u_windows866, __pyx_k_windows866, sizeof(__pyx_k_windows866), 0, 1, 0, 1}, {&__pyx_n_u_windows874, __pyx_k_windows874, sizeof(__pyx_k_windows874), 0, 1, 0, 1}, {&__pyx_n_u_windows932, __pyx_k_windows932, sizeof(__pyx_k_windows932), 0, 1, 0, 1}, {&__pyx_n_u_windows936, __pyx_k_windows936, sizeof(__pyx_k_windows936), 0, 1, 0, 1}, {&__pyx_n_u_windows949, __pyx_k_windows949, sizeof(__pyx_k_windows949), 0, 1, 0, 1}, {&__pyx_n_u_windows950, __pyx_k_windows950, sizeof(__pyx_k_windows950), 0, 1, 0, 1}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, {&__pyx_n_s_writing_allowed, __pyx_k_writing_allowed, sizeof(__pyx_k_writing_allowed), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xformat, __pyx_k_xformat, sizeof(__pyx_k_xformat), 0, 0, 1, 1}, {&__pyx_n_u_xid, __pyx_k_xid, sizeof(__pyx_k_xid), 0, 1, 0, 1}, {&__pyx_n_u_xml, __pyx_k_xml, sizeof(__pyx_k_xml), 0, 1, 0, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 88, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 51, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(1, 82, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(1, 83, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 52, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 94, __pyx_L1_error) __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(3, 593, __pyx_L1_error) __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(3, 598, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(4, 194, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(4, 447, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(4, 589, __pyx_L1_error) __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(5, 27, __pyx_L1_error) __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(6, 357, __pyx_L1_error) __pyx_builtin_memoryview = __Pyx_GetBuiltinName(__pyx_n_s_memoryview); if (!__pyx_builtin_memoryview) __PYX_ERR(7, 36, __pyx_L1_error) __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(7, 264, __pyx_L1_error) __pyx_builtin_TimeoutError = __Pyx_GetBuiltinName(__pyx_n_s_TimeoutError); if (!__pyx_builtin_TimeoutError) __PYX_ERR(0, 469, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "asyncpg/protocol/settings.pyx":15 * self._is_utf8 = True * self._settings = {} * self._codec = codecs.lookup('utf-8') # <<<<<<<<<<<<<< * self._data_codecs = DataCodecConfig(conn_key) * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "asyncpg/protocol/settings.pyx":79 * * def __getattr__(self, name): * if not name.startswith('_'): # <<<<<<<<<<<<<< * try: * return self._settings[name] */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_u__3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "(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_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "(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_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "asyncpg/protocol/buffer.pyx":52 * * if self._view_count: * raise RuntimeError( # <<<<<<<<<<<<<< * 'Deallocating buffer with attached memoryviews') * */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Deallocating_buffer_with_attache); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "asyncpg/protocol/buffer.pyx":68 * cdef inline _check_readonly(self): * if self._view_count: * raise BufferError('the buffer is in read-only mode') # <<<<<<<<<<<<<< * * cdef inline len(self): */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_the_buffer_is_in_read_only_mode); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "asyncpg/protocol/buffer.pyx":112 * 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 */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_cannot_start_message_for_a_non_e); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "asyncpg/protocol/buffer.pyx":124 * self._check_readonly() * if not self._message_mode: * raise BufferError( # <<<<<<<<<<<<<< * 'end_message can only be called with start_message') * if self._length < 5: */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_end_message_can_only_be_called_w); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "asyncpg/protocol/buffer.pyx":127 * '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_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_end_message_buffer_is_too_small); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "asyncpg/protocol/buffer.pyx":129 * 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_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_end_message_message_is_too_large); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "(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_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "(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_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "asyncpg/protocol/buffer.pyx":255 * * if not cpython.PyBytes_CheckExact(data): * raise BufferError('feed_data: bytes object expected') # <<<<<<<<<<<<<< * data_bytes = data * */ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_feed_data_bytes_object_expected); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "asyncpg/protocol/buffer.pyx":275 * cdef inline _ensure_first_buf(self): * if self._len0 == 0: * raise BufferError('empty first buffer') # <<<<<<<<<<<<<< * * if self._pos0 == self._len0: */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_empty_first_buffer); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "asyncpg/protocol/buffer.pyx":295 * if ASYNCPG_DEBUG: * if self._len0 < 1: * raise RuntimeError( # <<<<<<<<<<<<<< * 'debug: second buffer of ReadBuffer is empty') * */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_debug_second_buffer_of_ReadBuffe); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "asyncpg/protocol/buffer.pyx":371 * self._current_message_len_unread -= nbytes * if self._current_message_len_unread < 0: * raise BufferError('buffer overread') # <<<<<<<<<<<<<< * * result = PyByteArray_FromStringAndSize(NULL, nbytes) */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_buffer_overread); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "asyncpg/protocol/buffer.pyx":384 * if ASYNCPG_DEBUG: * if not self._buf0: * raise RuntimeError( # <<<<<<<<<<<<<< * 'debug: first buffer of ReadBuffer is empty') * */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_debug_first_buffer_of_ReadBuffer); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "asyncpg/protocol/buffer.pyx":390 * 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_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_not_enough_data_to_read_one_byte); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "asyncpg/protocol/buffer.pyx":435 * cdef inline read_cstr(self): * if not self._current_message_ready: * raise BufferError( # <<<<<<<<<<<<<< * 'read_cstr only works when the message guaranteed ' * 'to be in the buffer') */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_read_cstr_only_works_when_the_me); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "asyncpg/protocol/buffer.pyx":473 * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: * raise BufferError('read_cstr: buffer overread') # <<<<<<<<<<<<<< * * return result */ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_read_cstr_buffer_overread); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "asyncpg/protocol/buffer.pyx":485 * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: * raise BufferError('read_cstr: buffer overread') # <<<<<<<<<<<<<< * * self._ensure_first_buf() */ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_read_cstr_buffer_overread); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(3, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "asyncpg/protocol/buffer.pyx":502 * 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_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_failed_to_read_one_byte_on_a_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(3, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "asyncpg/protocol/buffer.pyx":546 * cdef Memory 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(self._current_message_len_unread) */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_no_message_to_consume); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "asyncpg/protocol/buffer.pyx":589 * * if not self._current_message_ready: * raise BufferError('no message to discard') # <<<<<<<<<<<<<< * * if self._current_message_len_unread: */ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_no_message_to_discard); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "(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_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "(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_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "asyncpg/protocol/codecs/base.pyx":128 * count = len(obj) * if count > _MAXINT32: * raise ValueError('too many elements in composite type record') # <<<<<<<<<<<<<< * * elem_data = WriteBuffer.new() */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_too_many_elements_in_composite_t); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(4, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "(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_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "(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_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); /* "asyncpg/protocol/codecs/base.pyx":404 * * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): # <<<<<<<<<<<<<< * name = name[1:] * name = '{}[]'.format(name) */ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_u__3); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(4, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); /* "asyncpg/protocol/codecs/base.pyx":405 * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): * name = name[1:] # <<<<<<<<<<<<<< * name = '{}[]'.format(name) * */ __pyx_slice__35 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__35)) __PYX_ERR(4, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__35); __Pyx_GIVEREF(__pyx_slice__35); /* "asyncpg/protocol/codecs/base.pyx":714 * kind = 'scalar' * * codec = Codec(INVALIDOID) # <<<<<<<<<<<<<< * codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, * encode, decode, None, None, None, None, None, None, 0) */ __pyx_tuple__42 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(4, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "asyncpg/protocol/codecs/text.pyx":21 * * if size[0] > 0x7fffffff: * raise ValueError('string too long') # <<<<<<<<<<<<<< * * */ __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_string_too_long); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(10, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); /* "asyncpg/protocol/codecs/bits.pyx":35 * try: * if bitlen > _MAXINT32: * raise ValueError('bit value too long') # <<<<<<<<<<<<<< * wbuf.write_int32(4 + len) * wbuf.write_int32(bitlen) */ __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_bit_value_too_long); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(11, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "asyncpg/protocol/codecs/datetime.pyx":275 * * cdef timetz_encode(ConnectionSettings settings, WriteBuffer buf, obj): * offset = obj.tzinfo.utcoffset(None) # <<<<<<<<<<<<<< * * cdef: */ __pyx_tuple__45 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(12, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); /* "asyncpg/protocol/codecs/float.pyx":15 * cdef float fval = dval * if math.isinf(fval) and not math.isinf(dval): * raise ValueError('float value too large to be encoded as FLOAT4') # <<<<<<<<<<<<<< * * buf.write_int32(4) */ __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_float_value_too_large_to_be_enco); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(13, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); /* "asyncpg/protocol/codecs/geometry.pyx":115 * encoded_len = 1 + 4 + 16 * npts * if encoded_len > _MAXINT32: * raise ValueError('path value too long') # <<<<<<<<<<<<<< * * wbuf.write_int32(encoded_len) */ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_u_path_value_too_long); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(14, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); /* "asyncpg/protocol/codecs/geometry.pyx":141 * encoded_len = 4 + 16 * npts * if encoded_len > _MAXINT32: * raise ValueError('polygon value too long') # <<<<<<<<<<<<<< * * wbuf.write_int32(encoded_len) */ __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_u_polygon_value_too_long); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(14, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); /* "asyncpg/protocol/codecs/json.pyx":16 * * if size > 0x7fffffff - 1: * raise ValueError('string too long') # <<<<<<<<<<<<<< * * buf.write_int32(size + 1) */ __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_u_string_too_long); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(15, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); /* "asyncpg/protocol/codecs/numeric.pyx":57 * dt = dec.as_tuple() * if dt.exponent == 'F': * raise ValueError('numeric type does not support infinite values') # <<<<<<<<<<<<<< * * if dt.exponent == 'n' or dt.exponent == 'N': */ __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_u_numeric_type_does_not_support_in); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(18, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); /* "asyncpg/protocol/codecs/numeric.pyx":68 * exponent = dt.exponent * if exponent < 0 and -exponent > MAX_DSCALE: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too small') */ __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_u_cannot_encode_Decimal_value_into); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(18, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); /* "asyncpg/protocol/codecs/numeric.pyx":87 * * if weight > 2 ** 16 - 1: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too large') */ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_u_cannot_encode_Decimal_value_into_2); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(18, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); /* "asyncpg/protocol/codecs/numeric.pyx":97 * * if num_pgdigits > 2 ** 16 - 1: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'number of digits is too large') */ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_u_cannot_encode_Decimal_value_into_3); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(18, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); /* "asyncpg/protocol/codecs/numeric.pyx":103 * # Pad decimal digits to provide room for correct Postgres * # digit alignment in the digit computation loop. * pydigits = (0,) * DEC_DIGITS + pydigits + (0,) * DEC_DIGITS # <<<<<<<<<<<<<< * * if exponent < 0: */ __pyx_tuple__54 = PyTuple_New(1 * 4); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(18, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 4; __pyx_temp++) { __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_tuple__54, __pyx_temp, __pyx_int_0); } } __Pyx_GIVEREF(__pyx_tuple__54); __pyx_tuple__55 = PyTuple_New(1 * 4); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(18, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 4; __pyx_temp++) { __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_tuple__55, __pyx_temp, __pyx_int_0); } } __Pyx_GIVEREF(__pyx_tuple__55); /* "asyncpg/protocol/codecs/numeric.pyx":107 * if exponent < 0: * if -exponent > MAX_DSCALE: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too small') */ __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_u_cannot_encode_Decimal_value_into); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(18, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); /* "asyncpg/protocol/codecs/numeric.pyx":160 * if sign == NUMERIC_NAN: * # Not-a-number * return _Dec('NaN') # <<<<<<<<<<<<<< * * if num_pgdigits == 0: */ __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_u_NaN); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(18, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); /* "asyncpg/protocol/codecs/txid.pyx":21 * * if len(obj) != 3: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid number of elements in txid_snapshot tuple, expecting 4') * */ __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_u_invalid_number_of_elements_in_tx); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(20, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); /* "asyncpg/protocol/codecs/txid.pyx":26 * nxip = len(obj[2]) * if nxip > _MAXINT32: * raise ValueError('txid_snapshot value is too long') # <<<<<<<<<<<<<< * * xmin = obj[0] */ __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_u_txid_snapshot_value_is_too_long); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(20, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); /* "asyncpg/protocol/codecs/array.pyx":49 * * if mylen > _MAXINT32: * raise ValueError('too many elements in array value') # <<<<<<<<<<<<<< * * if ndims[0] > ARRAY_MAXDIM: */ __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_u_too_many_elements_in_array_value); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(6, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); /* "asyncpg/protocol/codecs/array.pyx":63 * elemlen = len(elem) * if elemlen > _MAXINT32: * raise ValueError('too many elements in array value') # <<<<<<<<<<<<<< * ndims[0] += 1 * _get_array_shape(elem, dims, ndims) */ __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_u_too_many_elements_in_array_value); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(6, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); /* "asyncpg/protocol/codecs/array.pyx":68 * else: * if len(elem) != elemlen: * raise ValueError('non-homogeneous array') # <<<<<<<<<<<<<< * else: * if elemlen >= 0: */ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_u_non_homogeneous_array); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(6, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); /* "asyncpg/protocol/codecs/array.pyx":71 * else: * if elemlen >= 0: * raise ValueError('non-homogeneous array') # <<<<<<<<<<<<<< * else: * elemlen = -1 */ __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_u_non_homogeneous_array); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(6, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); /* "asyncpg/protocol/codecs/array.pyx":470 * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: * raise ValueError('missing array dimension value') # <<<<<<<<<<<<<< * * if ptr[0] == ':': */ __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_u_missing_array_dimension_value); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(6, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); /* "asyncpg/protocol/codecs/array.pyx":479 * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: * raise ValueError('missing array dimension value') # <<<<<<<<<<<<<< * else: * lbound = 1 */ __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_u_missing_array_dimension_value); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(6, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); /* "asyncpg/protocol/codecs/array.pyx":484 * * if ptr[0] != ']': * raise ValueError('missing \']\' after array dimensions') # <<<<<<<<<<<<<< * * ptr += 1 # ']' */ __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_u_missing_after_array_dimensions); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(6, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); /* "asyncpg/protocol/codecs/array.pyx":494 * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': * raise ValueError('missing \'=\' after array dimensions') # <<<<<<<<<<<<<< * * ptr += 1 # '=' */ __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_u_missing_after_array_dimensions_2); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(6, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); /* "asyncpg/protocol/codecs/array.pyx":509 * * if inferred_ndims != ndims: * raise ValueError( # <<<<<<<<<<<<<< * 'specified array dimensions do not match array content') * */ __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_u_specified_array_dimensions_do_no); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(6, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); /* "asyncpg/protocol/codecs/array.pyx":514 * for i in range(ndims): * if inferred_dims[i] != dims[i]: * raise ValueError( # <<<<<<<<<<<<<< * 'specified array dimensions do not match array content') * else: */ __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_u_specified_array_dimensions_do_no); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(6, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); /* "asyncpg/protocol/codecs/array.pyx":687 * while not end_of_item: * if ptr[0] == '\0': * raise ValueError('unexpected end of string') # <<<<<<<<<<<<<< * * elif ptr[0] == '"': */ __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_u_unexpected_end_of_string); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(6, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); /* "asyncpg/protocol/codecs/array.pyx":712 * ptr += 1 * else: * raise ValueError('unexpected end of string') # <<<<<<<<<<<<<< * * elif in_quotes: */ __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_u_unexpected_end_of_string); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(6, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); /* "asyncpg/protocol/codecs/array.pyx":843 * # Instances of anyarray (or any other polymorphic pseudotype) are * # never supposed to be returned from actual queries. * raise RuntimeError('unexpected instance of \'anyarray\' type') # <<<<<<<<<<<<<< * * */ __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_u_unexpected_instance_of_anyarray); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(6, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); /* "asyncpg/protocol/codecs/hstore.pyx":18 * count = len(obj) * if count > _MAXINT32: * raise ValueError('hstore value is too large') # <<<<<<<<<<<<<< * item_buf.write_int32(count) * */ __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_u_hstore_value_is_too_large); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(25, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); /* "asyncpg/protocol/codecs/hstore.pyx":28 * for k, v in items: * if k is None: * raise ValueError('null value not allowed in hstore key') # <<<<<<<<<<<<<< * as_pg_string_and_size(settings, k, &str, &size) * item_buf.write_int32(size) */ __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_u_null_value_not_allowed_in_hstore); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(25, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); /* "asyncpg/protocol/codecs/hstore.pyx":61 * elem_len = hton.unpack_int32(buf.read(4)) * if elem_len < 0: * raise ValueError('null value not allowed in hstore key') # <<<<<<<<<<<<<< * * k = decode_pg_string(settings, buf.read(elem_len), elem_len) */ __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_u_null_value_not_allowed_in_hstore); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(25, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); /* "asyncpg/protocol/coreproto.pyx":119 * if self.result_type != RESULT_FAILED: * self.result_type = RESULT_FAILED * self.result = RuntimeError( # <<<<<<<<<<<<<< * 'unknown error in protocol implementation') * */ __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_u_unknown_error_in_protocol_implem); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(7, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); /* "asyncpg/protocol/coreproto.pyx":475 * if ASYNCPG_DEBUG: * if buf.get_message_type() != b'D': * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_parse_data_msgs: first message is not "D"') * */ __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_u_parse_data_msgs_first_message_i); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(7, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); /* "asyncpg/protocol/coreproto.pyx":569 * * msg = WriteBuffer.new_message(b'p') * msg.write_bytestring(self.password.encode('ascii')) # <<<<<<<<<<<<<< * msg.end_message() * */ __pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(7, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); /* "asyncpg/protocol/coreproto.pyx":581 * * # 'md5' + md5(md5(password + username) + salt)) * userpass = ((self.password or '') + (self.user or '')).encode('ascii') # <<<<<<<<<<<<<< * hash = hashlib_md5(hashlib_md5(userpass).hexdigest().\ * encode('ascii') + salt).hexdigest().encode('ascii') */ __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(7, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__80); __Pyx_GIVEREF(__pyx_tuple__80); /* "asyncpg/protocol/coreproto.pyx":583 * userpass = ((self.password or '') + (self.user or '')).encode('ascii') * hash = hashlib_md5(hashlib_md5(userpass).hexdigest().\ * encode('ascii') + salt).hexdigest().encode('ascii') # <<<<<<<<<<<<<< * * msg.write_bytestring(b'md5' + hash) */ __pyx_tuple__81 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(7, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(7, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); /* "asyncpg/protocol/coreproto.pyx":642 * 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_tuple__83 = PyTuple_Pack(1, __pyx_kp_u_cannot_switch_to_idle_state_prot); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(7, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); /* "asyncpg/protocol/coreproto.pyx":646 * 'protocol is in the "failed" state') * elif self.state == PROTOCOL_IDLE: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'protocol is already in the "idle" state') * else: */ __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_u_protocol_is_already_in_the_idle); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(7, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); /* "asyncpg/protocol/coreproto.pyx":685 * cdef _ensure_connected(self): * if self.con_status != CONNECTION_OK: * raise apg_exc.InternalClientError('not connected') # <<<<<<<<<<<<<< * * cdef WriteBuffer _build_bind_message(self, str portal_name, */ __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_u_not_connected); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(7, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); /* "asyncpg/protocol/coreproto.pyx":710 * * if self.con_status != CONNECTION_BAD: * raise apg_exc.InternalClientError('already connected') # <<<<<<<<<<<<<< * * self._set_state(PROTOCOL_AUTH) */ __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_u_already_connected); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(7, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__86); __Pyx_GIVEREF(__pyx_tuple__86); /* "asyncpg/protocol/coreproto.pyx":723 * * buf.write_bytestring(b'client_encoding') * buf.write_bytestring("'{}'".format(self.encoding).encode('ascii')) # <<<<<<<<<<<<<< * * buf.write_str('user', self.encoding) */ __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_u_ascii); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(7, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__88); __Pyx_GIVEREF(__pyx_tuple__88); /* "asyncpg/protocol/coreproto.pyx":936 * self.transport = transport * * sock = transport.get_extra_info('socket') # <<<<<<<<<<<<<< * if (sock is not None and * (not hasattr(socket, 'AF_UNIX') */ __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_u_socket); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(7, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); /* "asyncpg/protocol/prepared_stmt.pyx":101 * * if len(args) > 32767: * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * 'the number of query arguments cannot exceed 32767') * */ __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_u_the_number_of_query_arguments_ca); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(27, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__90); __Pyx_GIVEREF(__pyx_tuple__90); /* "asyncpg/protocol/prepared_stmt.pyx":253 * if fnum > 0: * # It's OK to have no rows_codecs for empty records * raise RuntimeError('invalid rows_codecs') # <<<<<<<<<<<<<< * * dec_row = record.ApgRecord_New(self.cols_desc, fnum) */ __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_u_invalid_rows_codecs); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(27, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); /* "(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_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__92); __Pyx_GIVEREF(__pyx_tuple__92); /* "(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_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); /* "asyncpg/protocol/protocol.pyx":340 * self.resume_reading() * * with timer: # <<<<<<<<<<<<<< * buffer, done, status_msg = await waiter * */ __pyx_tuple__94 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__94); __Pyx_GIVEREF(__pyx_tuple__94); /* "asyncpg/protocol/protocol.pyx":347 * if buffer: * try: * with timer: # <<<<<<<<<<<<<< * await asyncio.wait_for( * sink(buffer), */ __pyx_tuple__95 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95); /* "asyncpg/protocol/protocol.pyx":428 * * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) */ __pyx_tuple__96 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__96); __Pyx_GIVEREF(__pyx_tuple__96); /* "asyncpg/protocol/protocol.pyx":441 * aiter = reader.__aiter__ * except AttributeError: * raise TypeError('reader is not an asynchronous iterable') # <<<<<<<<<<<<<< * else: * iterator = aiter() */ __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_u_reader_is_not_an_asynchronous_it); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); /* "asyncpg/protocol/protocol.pyx":449 * # We rely on protocol flow control to moderate the * # rate of data messages. * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * with timer: */ __pyx_tuple__98 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__98); __Pyx_GIVEREF(__pyx_tuple__98); /* "asyncpg/protocol/protocol.pyx":451 * with timer: * await self.writing_allowed.wait() * with timer: # <<<<<<<<<<<<<< * chunk = await asyncio.wait_for( * iterator.__anext__(), */ __pyx_tuple__99 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__99); __Pyx_GIVEREF(__pyx_tuple__99); /* "asyncpg/protocol/protocol.pyx":472 * raise * else: * raise apg_exc.InternalClientError('TimoutError was not raised') # <<<<<<<<<<<<<< * * except Exception as e: */ __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_u_TimoutError_was_not_raised); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__100); __Pyx_GIVEREF(__pyx_tuple__100); /* "asyncpg/protocol/protocol.pyx":571 * 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_tuple__101 = PyTuple_Pack(1, __pyx_kp_u_connection_was_closed_in_the_mid); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__101); __Pyx_GIVEREF(__pyx_tuple__101); /* "asyncpg/protocol/protocol.pyx":609 * 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_tuple__102 = PyTuple_Pack(1, __pyx_kp_u_cannot_perform_operation_another); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102); /* "asyncpg/protocol/protocol.pyx":612 * '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_tuple__103 = PyTuple_Pack(1, __pyx_kp_u_cannot_perform_operation_connect); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103); /* "asyncpg/protocol/protocol.pyx":615 * '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_tuple__104 = PyTuple_Pack(1, __pyx_kp_u_cannot_perform_operation_another_2); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__104); __Pyx_GIVEREF(__pyx_tuple__104); /* "asyncpg/protocol/protocol.pyx":622 * 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_tuple__105 = PyTuple_Pack(1, __pyx_kp_u_waiter_is_not_done_while_handlin); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__105); __Pyx_GIVEREF(__pyx_tuple__105); /* "asyncpg/protocol/protocol.pyx":631 * 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_tuple__106 = PyTuple_Pack(1, __pyx_kp_u_cannot_perform_operation_another_2); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__106); __Pyx_GIVEREF(__pyx_tuple__106); /* "asyncpg/protocol/protocol.pyx":641 * * cdef _on_result__connect(self, object waiter): * waiter.set_result(True) # <<<<<<<<<<<<<< * * cdef _on_result__prepare(self, object waiter): */ __pyx_tuple__107 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107); /* "asyncpg/protocol/protocol.pyx":646 * if ASYNCPG_DEBUG: * if self.statement is None: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_on_result__prepare: statement is None') * */ __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_u_on_result__prepare_statement_is); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108); /* "asyncpg/protocol/protocol.pyx":693 * if ASYNCPG_DEBUG: * if self.statement is None: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_decode_row: statement is None') * */ __pyx_tuple__109 = PyTuple_Pack(1, __pyx_kp_u_decode_row_statement_is_None); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__109); __Pyx_GIVEREF(__pyx_tuple__109); /* "asyncpg/protocol/protocol.pyx":704 * if ASYNCPG_DEBUG: * if waiter is None: * raise apg_exc.InternalClientError('_on_result: waiter is None') # <<<<<<<<<<<<<< * * if waiter.cancelled(): */ __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_u_on_result_waiter_is_None); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__110); __Pyx_GIVEREF(__pyx_tuple__110); /* "asyncpg/protocol/protocol.pyx":710 * * if waiter.done(): * raise apg_exc.InternalClientError('_on_result: waiter is done') # <<<<<<<<<<<<<< * * if self.result_type == RESULT_FAILED: */ __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_u_on_result_waiter_is_done); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__111); __Pyx_GIVEREF(__pyx_tuple__111); /* "asyncpg/protocol/protocol.pyx":769 * # We have received the result of a cancelled operation. * # Simply ignore the result. * self.cancel_waiter.set_result(None) # <<<<<<<<<<<<<< * self.cancel_waiter = None * self.waiter = None */ __pyx_tuple__112 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__112); __Pyx_GIVEREF(__pyx_tuple__112); /* "asyncpg/protocol/protocol.pyx":793 * 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_tuple__113 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__113); __Pyx_GIVEREF(__pyx_tuple__113); /* "asyncpg/protocol/pgtypes.pxi":102 * DEF REGROLEOID = 4096 * * cdef ARRAY_TYPES = (_TEXTOID, _OIDOID,) # <<<<<<<<<<<<<< * * TYPEMAP = { */ __pyx_tuple__114 = PyTuple_Pack(2, __pyx_int_1009, __pyx_int_1028); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(33, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__114); __Pyx_GIVEREF(__pyx_tuple__114); /* "asyncpg/protocol/codecs/datetime.pyx":14 * timedelta = datetime.timedelta * * pg_epoch_datetime = datetime.datetime(2000, 1, 1) # <<<<<<<<<<<<<< * cdef int32_t pg_epoch_datetime_ts = \ * cpython.PyLong_AsLong(int(pg_epoch_datetime.timestamp())) */ __pyx_tuple__115 = PyTuple_Pack(3, __pyx_int_2000, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__115); __Pyx_GIVEREF(__pyx_tuple__115); /* "asyncpg/protocol/codecs/datetime.pyx":18 * 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(pg_epoch_datetime_utc.timestamp()) */ __pyx_tuple__116 = PyTuple_Pack(3, __pyx_int_2000, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(12, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__116); __Pyx_GIVEREF(__pyx_tuple__116); /* "asyncpg/protocol/codecs/datetime.pyx":22 * cpython.PyLong_AsLong(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_tuple__117 = PyTuple_Pack(3, __pyx_int_2000, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(12, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__117); __Pyx_GIVEREF(__pyx_tuple__117); /* "asyncpg/protocol/protocol.pyx":812 * * class Timer: * def __init__(self, budget): # <<<<<<<<<<<<<< * self._budget = budget * self._started = 0 */ __pyx_tuple__118 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_budget); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__118); __Pyx_GIVEREF(__pyx_tuple__118); __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_init, 812, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 812, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":816 * self._started = 0 * * def __enter__(self): # <<<<<<<<<<<<<< * if self._budget is not None: * self._started = time.monotonic() */ __pyx_tuple__120 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__120); __Pyx_GIVEREF(__pyx_tuple__120); __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_enter, 816, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 816, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":820 * self._started = time.monotonic() * * def __exit__(self, et, e, tb): # <<<<<<<<<<<<<< * if self._budget is not None: * self._budget -= time.monotonic() - self._started */ __pyx_tuple__122 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_et, __pyx_n_s_e, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__122); __Pyx_GIVEREF(__pyx_tuple__122); __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_exit, 820, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 820, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":824 * self._budget -= time.monotonic() - self._started * * def get_remaining_budget(self): # <<<<<<<<<<<<<< * return self._budget * */ __pyx_tuple__124 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__124); __Pyx_GIVEREF(__pyx_tuple__124); __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_get_remaining_budget, 824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 824, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":832 * * * def _create_record(object mapping, tuple elems): # <<<<<<<<<<<<<< * # Exposed only for testing purposes. * */ __pyx_tuple__126 = PyTuple_Pack(6, __pyx_n_s_mapping, __pyx_n_s_elems, __pyx_n_s_rec, __pyx_n_s_i, __pyx_n_s_desc, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__126); __Pyx_GIVEREF(__pyx_tuple__126); __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_create_record, 832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 832, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_Memory(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0xe0abff4: * from pickle import PickleError as __pyx_PickleError */ __pyx_tuple__128 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__128); __Pyx_GIVEREF(__pyx_tuple__128); __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Memory, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(2, 1, __pyx_L1_error) __pyx_tuple__130 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__130); __Pyx_GIVEREF(__pyx_tuple__130); __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FastReadBuffer, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(2, 1, __pyx_L1_error) __pyx_tuple__132 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__132); __Pyx_GIVEREF(__pyx_tuple__132); __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_DataCodecConfig, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(2, 1, __pyx_L1_error) __pyx_tuple__134 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__134); __Pyx_GIVEREF(__pyx_tuple__134); __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CoreProtocol, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(2, 1, __pyx_L1_error) __pyx_tuple__136 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__136); __Pyx_GIVEREF(__pyx_tuple__136); __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BaseProtocol, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_27 = PyInt_FromLong(27); if (unlikely(!__pyx_int_27)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_114 = PyInt_FromLong(114); if (unlikely(!__pyx_int_114)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_142 = PyInt_FromLong(142); if (unlikely(!__pyx_int_142)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_194 = PyInt_FromLong(194); if (unlikely(!__pyx_int_194)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_210 = PyInt_FromLong(210); if (unlikely(!__pyx_int_210)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_325 = PyInt_FromLong(325); if (unlikely(!__pyx_int_325)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_600 = PyInt_FromLong(600); if (unlikely(!__pyx_int_600)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_601 = PyInt_FromLong(601); if (unlikely(!__pyx_int_601)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_602 = PyInt_FromLong(602); if (unlikely(!__pyx_int_602)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_603 = PyInt_FromLong(603); if (unlikely(!__pyx_int_603)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_604 = PyInt_FromLong(604); if (unlikely(!__pyx_int_604)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_628 = PyInt_FromLong(628); if (unlikely(!__pyx_int_628)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_650 = PyInt_FromLong(650); if (unlikely(!__pyx_int_650)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_700 = PyInt_FromLong(700); if (unlikely(!__pyx_int_700)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_701 = PyInt_FromLong(701); if (unlikely(!__pyx_int_701)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_702 = PyInt_FromLong(702); if (unlikely(!__pyx_int_702)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_703 = PyInt_FromLong(703); if (unlikely(!__pyx_int_703)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_704 = PyInt_FromLong(704); if (unlikely(!__pyx_int_704)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_705 = PyInt_FromLong(705); if (unlikely(!__pyx_int_705)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_718 = PyInt_FromLong(718); if (unlikely(!__pyx_int_718)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_774 = PyInt_FromLong(774); if (unlikely(!__pyx_int_774)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_790 = PyInt_FromLong(790); if (unlikely(!__pyx_int_790)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_829 = PyInt_FromLong(829); if (unlikely(!__pyx_int_829)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_869 = PyInt_FromLong(869); if (unlikely(!__pyx_int_869)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1009 = PyInt_FromLong(1009); if (unlikely(!__pyx_int_1009)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1028 = PyInt_FromLong(1028); if (unlikely(!__pyx_int_1028)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1033 = PyInt_FromLong(1033); if (unlikely(!__pyx_int_1033)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1042 = PyInt_FromLong(1042); if (unlikely(!__pyx_int_1042)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1043 = PyInt_FromLong(1043); if (unlikely(!__pyx_int_1043)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1082 = PyInt_FromLong(1082); if (unlikely(!__pyx_int_1082)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1083 = PyInt_FromLong(1083); if (unlikely(!__pyx_int_1083)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1114 = PyInt_FromLong(1114); if (unlikely(!__pyx_int_1114)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1184 = PyInt_FromLong(1184); if (unlikely(!__pyx_int_1184)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1186 = PyInt_FromLong(1186); if (unlikely(!__pyx_int_1186)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1266 = PyInt_FromLong(1266); if (unlikely(!__pyx_int_1266)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1560 = PyInt_FromLong(1560); if (unlikely(!__pyx_int_1560)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1562 = PyInt_FromLong(1562); if (unlikely(!__pyx_int_1562)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1700 = PyInt_FromLong(1700); if (unlikely(!__pyx_int_1700)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1790 = PyInt_FromLong(1790); if (unlikely(!__pyx_int_1790)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2000 = PyInt_FromLong(2000); if (unlikely(!__pyx_int_2000)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2202 = PyInt_FromLong(2202); if (unlikely(!__pyx_int_2202)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2203 = PyInt_FromLong(2203); if (unlikely(!__pyx_int_2203)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2204 = PyInt_FromLong(2204); if (unlikely(!__pyx_int_2204)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2205 = PyInt_FromLong(2205); if (unlikely(!__pyx_int_2205)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2206 = PyInt_FromLong(2206); if (unlikely(!__pyx_int_2206)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2249 = PyInt_FromLong(2249); if (unlikely(!__pyx_int_2249)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2275 = PyInt_FromLong(2275); if (unlikely(!__pyx_int_2275)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2276 = PyInt_FromLong(2276); if (unlikely(!__pyx_int_2276)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2277 = PyInt_FromLong(2277); if (unlikely(!__pyx_int_2277)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2278 = PyInt_FromLong(2278); if (unlikely(!__pyx_int_2278)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2279 = PyInt_FromLong(2279); if (unlikely(!__pyx_int_2279)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2280 = PyInt_FromLong(2280); if (unlikely(!__pyx_int_2280)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2281 = PyInt_FromLong(2281); if (unlikely(!__pyx_int_2281)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2282 = PyInt_FromLong(2282); if (unlikely(!__pyx_int_2282)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2283 = PyInt_FromLong(2283); if (unlikely(!__pyx_int_2283)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2776 = PyInt_FromLong(2776); if (unlikely(!__pyx_int_2776)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2950 = PyInt_FromLong(2950); if (unlikely(!__pyx_int_2950)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2970 = PyInt_FromLong(2970); if (unlikely(!__pyx_int_2970)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3115 = PyInt_FromLong(3115); if (unlikely(!__pyx_int_3115)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3220 = PyInt_FromLong(3220); if (unlikely(!__pyx_int_3220)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3310 = PyInt_FromLong(3310); if (unlikely(!__pyx_int_3310)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3361 = PyInt_FromLong(3361); if (unlikely(!__pyx_int_3361)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3402 = PyInt_FromLong(3402); if (unlikely(!__pyx_int_3402)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3500 = PyInt_FromLong(3500); if (unlikely(!__pyx_int_3500)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3614 = PyInt_FromLong(3614); if (unlikely(!__pyx_int_3614)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3615 = PyInt_FromLong(3615); if (unlikely(!__pyx_int_3615)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3642 = PyInt_FromLong(3642); if (unlikely(!__pyx_int_3642)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3734 = PyInt_FromLong(3734); if (unlikely(!__pyx_int_3734)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3769 = PyInt_FromLong(3769); if (unlikely(!__pyx_int_3769)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3802 = PyInt_FromLong(3802); if (unlikely(!__pyx_int_3802)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3831 = PyInt_FromLong(3831); if (unlikely(!__pyx_int_3831)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3838 = PyInt_FromLong(3838); if (unlikely(!__pyx_int_3838)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4089 = PyInt_FromLong(4089); if (unlikely(!__pyx_int_4089)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_524288 = PyInt_FromLong(524288L); if (unlikely(!__pyx_int_524288)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_999999 = PyInt_FromLong(999999L); if (unlikely(!__pyx_int_999999)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_26708044 = PyInt_FromLong(26708044L); if (unlikely(!__pyx_int_26708044)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_51347564 = PyInt_FromLong(51347564L); if (unlikely(!__pyx_int_51347564)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_132800114 = PyInt_FromLong(132800114L); if (unlikely(!__pyx_int_132800114)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_192266185 = PyInt_FromLong(192266185L); if (unlikely(!__pyx_int_192266185)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_235585524 = PyInt_FromLong(235585524L); if (unlikely(!__pyx_int_235585524)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_9223372036854775807 = PyInt_FromString((char *)"9223372036854775807", 0, 0); if (unlikely(!__pyx_int_9223372036854775807)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_9223372036854775808 = PyInt_FromString((char *)"-9223372036854775808", 0, 0); if (unlikely(!__pyx_int_neg_9223372036854775808)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initprotocol(void); /*proto*/ PyMODINIT_FUNC initprotocol(void) #else PyMODINIT_FUNC PyInit_protocol(void); /*proto*/ PyMODINIT_FUNC PyInit_protocol(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { result = PyDict_SetItemString(moddict, to_name, value); Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; 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__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static int __pyx_pymod_exec_protocol(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; long __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; static Py_UCS4 __pyx_t_8[5]; PyTypeObject *__pyx_t_9; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0; #endif #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("PyMODINIT_FUNC PyInit_protocol(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("protocol", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_asyncpg__protocol__protocol) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "asyncpg.protocol.protocol")) { if (unlikely(PyDict_SetItemString(modules, "asyncpg.protocol.protocol", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global init code ---*/ __pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES = Py_None; Py_INCREF(Py_None); __pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_7asyncpg_8protocol_8protocol_TYPE_CODECS_CACHE = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE = ((PyObject*)Py_None); Py_INCREF(Py_None); /*--- Variable export code ---*/ if (__Pyx_ExportVoidPtr(__pyx_n_s_ARRAY_TYPES, (void *)&__pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_7asyncpg_8protocol_8protocol_Memory = &__pyx_vtable_7asyncpg_8protocol_8protocol_Memory; __pyx_vtable_7asyncpg_8protocol_8protocol_Memory.as_bytes = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *))__pyx_f_7asyncpg_8protocol_8protocol_6Memory_as_bytes; __pyx_vtable_7asyncpg_8protocol_8protocol_Memory.new = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *(*)(char const *, PyObject *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_6Memory_new; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol_Memory) < 0) __PYX_ERR(3, 18, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol_Memory.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_7asyncpg_8protocol_8protocol_Memory.tp_dict, __pyx_vtabptr_7asyncpg_8protocol_8protocol_Memory) < 0) __PYX_ERR(3, 18, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "Memory", (PyObject *)&__pyx_type_7asyncpg_8protocol_8protocol_Memory) < 0) __PYX_ERR(3, 18, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7asyncpg_8protocol_8protocol_Memory) < 0) __PYX_ERR(3, 18, __pyx_L1_error) __pyx_ptype_7asyncpg_8protocol_8protocol_Memory = &__pyx_type_7asyncpg_8protocol_8protocol_Memory; __pyx_vtabptr_7asyncpg_8protocol_8protocol_WriteBuffer = &__pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer._check_readonly = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__check_readonly; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.len = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_len; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer._ensure_alloced = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__ensure_alloced; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer._reallocate = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer__reallocate; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.start_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, char))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_start_message; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.end_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_buffer = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_buffer; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_byte = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, char))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_byte; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_bytes = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytes; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_bytestring = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_bytestring; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_str = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_str; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_cstr = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, char const *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_cstr; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_int16 = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int16_t))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int16; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_int32 = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int32_t))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int32; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_int64 = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, int64_t))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_int64; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_float = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, float))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_float; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.write_double = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *, double))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_write_double; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.new_message = (struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *(*)(char))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message; __pyx_vtable_7asyncpg_8protocol_8protocol_WriteBuffer.new = (struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *(*)(void))__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol_WriteBuffer) < 0) __PYX_ERR(3, 36, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol_WriteBuffer.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_7asyncpg_8protocol_8protocol_WriteBuffer.tp_dict, __pyx_vtabptr_7asyncpg_8protocol_8protocol_WriteBuffer) < 0) __PYX_ERR(3, 36, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "WriteBuffer", (PyObject *)&__pyx_type_7asyncpg_8protocol_8protocol_WriteBuffer) < 0) __PYX_ERR(3, 36, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7asyncpg_8protocol_8protocol_WriteBuffer) < 0) __PYX_ERR(3, 36, __pyx_L1_error) __pyx_ptype_7asyncpg_8protocol_8protocol_WriteBuffer = &__pyx_type_7asyncpg_8protocol_8protocol_WriteBuffer; __pyx_vtabptr_7asyncpg_8protocol_8protocol_ReadBuffer = &__pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.feed_data = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_feed_data; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer._ensure_first_buf = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__ensure_first_buf; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer._switch_to_next_buf = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__switch_to_next_buf; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.read_byte = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_byte; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer._try_read_bytes = (char const *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__try_read_bytes; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer._read = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, char *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__read; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.read = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.read_bytes = (char const *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_bytes; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.read_int32 = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int32; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.read_int16 = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_int16; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.read_cstr = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_read_cstr; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.has_message = (int32_t (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.has_message_type = (int32_t (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, char))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_has_message_type; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.try_consume_message = (char const *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, Py_ssize_t *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_try_consume_message; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.consume_message = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Memory *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_message; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.consume_messages = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *, char))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_consume_messages; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.discard_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_discard_message; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer._discard_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer__discard_message; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.get_message_type = (char (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_type; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.get_message_length = (int32_t (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_get_message_length; __pyx_vtable_7asyncpg_8protocol_8protocol_ReadBuffer.new_message_parser = (struct __pyx_obj_7asyncpg_8protocol_8protocol_ReadBuffer *(*)(PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_10ReadBuffer_new_message_parser; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol_ReadBuffer) < 0) __PYX_ERR(3, 231, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol_ReadBuffer.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_7asyncpg_8protocol_8protocol_ReadBuffer.tp_dict, __pyx_vtabptr_7asyncpg_8protocol_8protocol_ReadBuffer) < 0) __PYX_ERR(3, 231, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "ReadBuffer", (PyObject *)&__pyx_type_7asyncpg_8protocol_8protocol_ReadBuffer) < 0) __PYX_ERR(3, 231, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7asyncpg_8protocol_8protocol_ReadBuffer) < 0) __PYX_ERR(3, 231, __pyx_L1_error) __pyx_ptype_7asyncpg_8protocol_8protocol_ReadBuffer = &__pyx_type_7asyncpg_8protocol_8protocol_ReadBuffer; __pyx_vtabptr_7asyncpg_8protocol_8protocol_FastReadBuffer = &__pyx_vtable_7asyncpg_8protocol_8protocol_FastReadBuffer; __pyx_vtable_7asyncpg_8protocol_8protocol_FastReadBuffer.read = (char const *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read; __pyx_vtable_7asyncpg_8protocol_8protocol_FastReadBuffer.read_all = (char const *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_read_all; __pyx_vtable_7asyncpg_8protocol_8protocol_FastReadBuffer.slice_from = (struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_slice_from; __pyx_vtable_7asyncpg_8protocol_8protocol_FastReadBuffer._raise_ins_err = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *, Py_ssize_t, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer__raise_ins_err; __pyx_vtable_7asyncpg_8protocol_8protocol_FastReadBuffer.new = (struct __pyx_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *(*)(void))__pyx_f_7asyncpg_8protocol_8protocol_14FastReadBuffer_new; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol_FastReadBuffer) < 0) __PYX_ERR(3, 632, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol_FastReadBuffer.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_7asyncpg_8protocol_8protocol_FastReadBuffer.tp_dict, __pyx_vtabptr_7asyncpg_8protocol_8protocol_FastReadBuffer) < 0) __PYX_ERR(3, 632, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "FastReadBuffer", (PyObject *)&__pyx_type_7asyncpg_8protocol_8protocol_FastReadBuffer) < 0) __PYX_ERR(3, 632, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7asyncpg_8protocol_8protocol_FastReadBuffer) < 0) __PYX_ERR(3, 632, __pyx_L1_error) __pyx_ptype_7asyncpg_8protocol_8protocol_FastReadBuffer = &__pyx_type_7asyncpg_8protocol_8protocol_FastReadBuffer; __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, 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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_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_8protocol_8protocol_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range; __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_8protocol_8protocol_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_8protocol_8protocol_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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *))__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *))__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *))__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range; __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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *))__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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *))__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_8protocol_8protocol_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_obj_7asyncpg_8protocol_8protocol_FastReadBuffer *))__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_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, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol_Codec) < 0) __PYX_ERR(4, 15, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol_Codec.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_7asyncpg_8protocol_8protocol_Codec.tp_dict, __pyx_vtabptr_7asyncpg_8protocol_8protocol_Codec) < 0) __PYX_ERR(4, 15, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "Codec", (PyObject *)&__pyx_type_7asyncpg_8protocol_8protocol_Codec) < 0) __PYX_ERR(4, 15, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7asyncpg_8protocol_8protocol_Codec) < 0) __PYX_ERR(4, 15, __pyx_L1_error) __pyx_ptype_7asyncpg_8protocol_8protocol_Codec = &__pyx_type_7asyncpg_8protocol_8protocol_Codec; __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))__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec; __pyx_vtable_7asyncpg_8protocol_8protocol_DataCodecConfig.get_local_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t))__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_local_codec; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig) < 0) __PYX_ERR(4, 359, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig.tp_dict, __pyx_vtabptr_7asyncpg_8protocol_8protocol_DataCodecConfig) < 0) __PYX_ERR(4, 359, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "DataCodecConfig", (PyObject *)&__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig) < 0) __PYX_ERR(4, 359, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig) < 0) __PYX_ERR(4, 359, __pyx_L1_error) __pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig = &__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig; __pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings = &__pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings; __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.is_encoding_utf8 = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_is_encoding_utf8; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.get_text_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec; __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 *, 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.set_builtin_type_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, 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 (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings) < 0) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings.tp_dict, __pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings) < 0) __PYX_ERR(1, 9, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "ConnectionSettings", (PyObject *)&__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings) < 0) __PYX_ERR(1, 9, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings) < 0) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings = &__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings; __pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol = &__pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol; __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._write = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._write_sync_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_sync_message; __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_bind_message = (struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_bind_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 = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__prepare; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._send_bind_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_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_8protocol_8protocol_WriteBuffer *, int32_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind_execute_many = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_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 (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol) < 0) __PYX_ERR(7, 11, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol.tp_dict, __pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol) < 0) __PYX_ERR(7, 11, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "CoreProtocol", (PyObject *)&__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol) < 0) __PYX_ERR(7, 11, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol) < 0) __PYX_ERR(7, 11, __pyx_L1_error) __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol = &__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol; __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 *))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg; __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 (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState) < 0) __PYX_ERR(27, 12, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState.tp_dict, __pyx_vtabptr_7asyncpg_8protocol_8protocol_PreparedStatementState) < 0) __PYX_ERR(27, 12, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "PreparedStatementState", (PyObject *)&__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState) < 0) __PYX_ERR(27, 12, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState) < 0) __PYX_ERR(27, 12, __pyx_L1_error) __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState = &__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState; __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._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_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; __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol.tp_base = __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol) < 0) __PYX_ERR(0, 91, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol.tp_print = 0; if (__Pyx_SetVtable(__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol.tp_dict, __pyx_vtabptr_7asyncpg_8protocol_8protocol_BaseProtocol) < 0) __PYX_ERR(0, 91, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "BaseProtocol", (PyObject *)&__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol) < 0) __PYX_ERR(0, 91, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol) < 0) __PYX_ERR(0, 91, __pyx_L1_error) __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol = &__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare) < 0) __PYX_ERR(0, 149, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__prepare; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute) < 0) __PYX_ERR(0, 170, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1_bind_execute; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many) < 0) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_bind_execute_many; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 217, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_bind; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute) < 0) __PYX_ERR(0, 265, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_execute; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query) < 0) __PYX_ERR(0, 294, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_query; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out) < 0) __PYX_ERR(0, 318, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_copy_out; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in) < 0) __PYX_ERR(0, 369, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_copy_in; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement) < 0) __PYX_ERR(0, 485, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_close_statement; if (PyType_Ready(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close) < 0) __PYX_ERR(0, 524, __pyx_L1_error) __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close.tp_print = 0; __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_close; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", #if CYTHON_COMPILING_IN_PYPY sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(30, 9, __pyx_L1_error) __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) __PYX_ERR(31, 8, __pyx_L1_error) __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) __PYX_ERR(32, 15, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "asyncpg/protocol/protocol.pyx":13 * cimport cpython * * import asyncio # <<<<<<<<<<<<<< * import builtins * import codecs */ __pyx_t_1 = __Pyx_patch_asyncio(__Pyx_Import(__pyx_n_s_asyncio, 0, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_asyncio, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":14 * * import asyncio * import builtins # <<<<<<<<<<<<<< * import codecs * import collections */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_builtins, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtins, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":15 * import asyncio * import builtins * import codecs # <<<<<<<<<<<<<< * import collections * import socket */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_codecs, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":16 * import builtins * import codecs * import collections # <<<<<<<<<<<<<< * import socket * import time */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":17 * import codecs * import collections * import socket # <<<<<<<<<<<<<< * import time * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_socket, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_socket, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":18 * import collections * import socket * import time # <<<<<<<<<<<<<< * * from libc.stdint cimport int8_t, uint8_t, int16_t, uint16_t, \ */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":37 * from cpython cimport PyBuffer_FillInfo, PyBytes_AsString * * from asyncpg.exceptions import _base as apg_exc_base # <<<<<<<<<<<<<< * from asyncpg import compat * from asyncpg import types as apg_types */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_base); __Pyx_GIVEREF(__pyx_n_s_base); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_base); __pyx_t_2 = __Pyx_Import(__pyx_n_s_asyncpg_exceptions, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_apg_exc_base, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":38 * * from asyncpg.exceptions import _base as apg_exc_base * from asyncpg import compat # <<<<<<<<<<<<<< * from asyncpg import types as apg_types * from asyncpg import exceptions as apg_exc */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_compat); __Pyx_GIVEREF(__pyx_n_s_compat); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_compat); __pyx_t_1 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_compat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_compat, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":39 * from asyncpg.exceptions import _base as apg_exc_base * from asyncpg import compat * from asyncpg import types as apg_types # <<<<<<<<<<<<<< * from asyncpg import exceptions as apg_exc * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_types); __Pyx_GIVEREF(__pyx_n_s_types); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_types); __pyx_t_2 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_apg_types, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":40 * from asyncpg import compat * from asyncpg import types as apg_types * from asyncpg import exceptions as apg_exc # <<<<<<<<<<<<<< * * from asyncpg.protocol cimport hton */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_exceptions); __Pyx_GIVEREF(__pyx_n_s_exceptions); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_exceptions); __pyx_t_1 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_apg_exc, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/pgtypes.pxi":102 * DEF REGROLEOID = 4096 * * cdef ARRAY_TYPES = (_TEXTOID, _OIDOID,) # <<<<<<<<<<<<<< * * TYPEMAP = { */ __Pyx_INCREF(__pyx_tuple__114); __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES, __pyx_tuple__114); __Pyx_GIVEREF(__pyx_tuple__114); /* "asyncpg/protocol/pgtypes.pxi":105 * * TYPEMAP = { * ABSTIMEOID: 'abstime', # <<<<<<<<<<<<<< * ACLITEMOID: 'aclitem', * ANYARRAYOID: 'anyarray', */ __pyx_t_1 = __Pyx_PyDict_NewPresized(86); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_int_702, __pyx_n_u_abstime) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1033, __pyx_n_u_aclitem) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2277, __pyx_n_u_anyarray) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2283, __pyx_n_u_anyelement) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3500, __pyx_n_u_anyenum) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2776, __pyx_n_u_anynonarray) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2276, __pyx_n_u_any) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3831, __pyx_n_u_anyrange) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1560, __pyx_n_u_bit) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_16, __pyx_n_u_bool) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_603, __pyx_n_u_box) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1042, __pyx_n_u_bpchar) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_17, __pyx_n_u_bytea) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_18, __pyx_n_u_char) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_29, __pyx_n_u_cid) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_650, __pyx_n_u_cidr) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_718, __pyx_n_u_circle) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2275, __pyx_n_u_cstring) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1082, __pyx_n_u_date) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3838, __pyx_n_u_event_trigger) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3115, __pyx_n_u_fdw_handler) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_700, __pyx_n_u_float4) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_701, __pyx_n_u_float8) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3642, __pyx_n_u_gtsvector) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_325, __pyx_n_u_index_am_handler) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_869, __pyx_n_u_inet) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_21, __pyx_n_u_int2) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_23, __pyx_n_u_int4) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_20, __pyx_n_u_int8) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2281, __pyx_n_u_internal) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1186, __pyx_n_u_interval) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3802, __pyx_n_u_jsonb) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_114, __pyx_n_u_json) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2280, __pyx_n_u_language_handler) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_628, __pyx_n_u_line) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_601, __pyx_n_u_lseg) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_774, __pyx_n_u_macaddr8) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_829, __pyx_n_u_macaddr) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_790, __pyx_n_u_money) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_19, __pyx_n_u_name) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1700, __pyx_n_u_numeric) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_26, __pyx_n_u_oid) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2282, __pyx_n_u_opaque) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_602, __pyx_n_u_path) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_32, __pyx_n_u_pg_ddl_command) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3402, __pyx_n_u_pg_dependencies) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3220, __pyx_n_u_pg_lsn) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3361, __pyx_n_u_pg_ndistinct) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_194, __pyx_n_u_pg_node_tree) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_600, __pyx_n_u_point) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_604, __pyx_n_u_polygon) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2249, __pyx_n_u_record) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1790, __pyx_n_u_refcursor) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2205, __pyx_n_u_regclass) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3734, __pyx_n_u_regconfig) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3769, __pyx_n_u_regdictionary) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_4089, __pyx_n_u_regnamespace) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2204, __pyx_n_u_regoperator) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2203, __pyx_n_u_regoper) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2202, __pyx_n_u_regprocedure) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_24, __pyx_n_u_regproc) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_4096, __pyx_n_u_regrole) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2206, __pyx_n_u_regtype) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_703, __pyx_n_u_reltime) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_210, __pyx_n_u_smgr) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_25, __pyx_n_u_text) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_27, __pyx_n_u_tid) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1083, __pyx_n_u_time) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1114, __pyx_n_u_timestamp) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1184, __pyx_n_u_timestamptz) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1266, __pyx_n_u_timetz) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_704, __pyx_n_u_tinterval) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2279, __pyx_n_u_trigger) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3310, __pyx_n_u_tsm_handler) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3615, __pyx_n_u_tsquery) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_3614, __pyx_n_u_tsvector) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2970, __pyx_n_u_txid_snapshot) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_705, __pyx_n_u_unknown) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2950, __pyx_n_u_uuid) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1562, __pyx_n_u_varbit) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1043, __pyx_n_u_varchar) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_2278, __pyx_n_u_void) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_28, __pyx_n_u_xid) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_142, __pyx_n_u_xml) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1028, __pyx_kp_u_oid_2) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_int_1009, __pyx_kp_u_text_2) < 0) __PYX_ERR(33, 105, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_TYPEMAP, __pyx_t_1) < 0) __PYX_ERR(33, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/encodings.pyx":14 * * cdef dict ENCODINGS_MAP = { * 'abc': 'cp1258', # <<<<<<<<<<<<<< * 'alt': 'cp866', * 'euc_cn': 'euccn', */ __pyx_t_1 = __Pyx_PyDict_NewPresized(45); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_abc, __pyx_n_u_cp1258) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_alt, __pyx_n_u_cp866) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_euc_cn, __pyx_n_u_euccn) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_euc_jp, __pyx_n_u_eucjp) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_euc_kr, __pyx_n_u_euckr) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_koi8r, __pyx_n_u_koi8_r) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_koi8u, __pyx_n_u_koi8_u) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_shift_jis_2004, __pyx_n_u_euc_jis_2004) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_sjis, __pyx_n_u_shift_jis) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_sql_ascii, __pyx_n_u_ascii) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_vscii, __pyx_n_u_cp1258) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tcvn, __pyx_n_u_cp1258) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tcvn5712, __pyx_n_u_cp1258) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_unicode, __pyx_n_u_utf_8_2) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win, __pyx_n_u_cp1521) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win1250, __pyx_n_u_cp1250) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win1251, __pyx_n_u_cp1251) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win1252, __pyx_n_u_cp1252) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win1253, __pyx_n_u_cp1253) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win1254, __pyx_n_u_cp1254) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win1255, __pyx_n_u_cp1255) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win1256, __pyx_n_u_cp1256) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win1257, __pyx_n_u_cp1257) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win1258, __pyx_n_u_cp1258) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win866, __pyx_n_u_cp866) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win874, __pyx_n_u_cp874) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win932, __pyx_n_u_cp932) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win936, __pyx_n_u_cp936) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win949, __pyx_n_u_cp949) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_win950, __pyx_n_u_cp950) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows1250, __pyx_n_u_cp1250) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows1251, __pyx_n_u_cp1251) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows1252, __pyx_n_u_cp1252) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows1253, __pyx_n_u_cp1253) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows1254, __pyx_n_u_cp1254) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows1255, __pyx_n_u_cp1255) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows1256, __pyx_n_u_cp1256) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows1257, __pyx_n_u_cp1257) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows1258, __pyx_n_u_cp1258) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows866, __pyx_n_u_cp866) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows874, __pyx_n_u_cp874) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows932, __pyx_n_u_cp932) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows936, __pyx_n_u_cp936) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows949, __pyx_n_u_cp949) < 0) __PYX_ERR(8, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_windows950, __pyx_n_u_cp950) < 0) __PYX_ERR(8, 14, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":69 * * cpdef inline Codec get_data_codec(self, uint32_t oid, * ServerDataFormat format=PG_FORMAT_ANY): # <<<<<<<<<<<<<< * if format == PG_FORMAT_ANY: * codec = self._data_codecs.get_codec(oid, PG_FORMAT_BINARY) */ __pyx_k__2 = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY; /* "asyncpg/protocol/settings.pyx":68 * typekind, alias_to) * * cpdef inline Codec get_data_codec(self, uint32_t oid, # <<<<<<<<<<<<<< * ServerDataFormat format=PG_FORMAT_ANY): * if format == PG_FORMAT_ANY: */ __pyx_k__2 = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY; /* "asyncpg/protocol/buffer.pyx":12 * * * class BufferError(Exception): # <<<<<<<<<<<<<< * pass * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_BufferError, __pyx_n_s_BufferError, (PyObject *) NULL, __pyx_n_s_asyncpg_protocol_protocol, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_BufferError, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BufferError, __pyx_t_4) < 0) __PYX_ERR(3, 12, __pyx_L1_error) __Pyx_DECREF(__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; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":10 * cdef void* binary_codec_map[(MAXSUPPORTEDOID + 1) * 2] * cdef void* text_codec_map[(MAXSUPPORTEDOID + 1) * 2] * cdef dict TYPE_CODECS_CACHE = {} # <<<<<<<<<<<<<< * cdef dict EXTRA_CODECS = {} * */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_TYPE_CODECS_CACHE); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_TYPE_CODECS_CACHE, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":11 * cdef void* text_codec_map[(MAXSUPPORTEDOID + 1) * 2] * cdef dict TYPE_CODECS_CACHE = {} * cdef dict EXTRA_CODECS = {} # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":533 * * def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, * alias_to, format=PG_FORMAT_ANY): # <<<<<<<<<<<<<< * cdef: * Codec codec */ __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_k__37 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":568 * * 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_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_k__38 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":634 * cdef inline Codec get_core_codec( * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): # <<<<<<<<<<<<<< * cdef: * void *ptr = NULL */ __pyx_k__39 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/codecs/base.pyx":653 * cdef inline Codec get_any_core_codec( * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): # <<<<<<<<<<<<<< * """A version of get_core_codec that accepts PG_FORMAT_ANY.""" * cdef: */ __pyx_k__40 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/codecs/base.pyx":676 * decode_func decode, * ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): # <<<<<<<<<<<<<< * * if oid > MAXSUPPORTEDOID: */ __pyx_k__41 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/codecs/bytea.pyx":48 * PG_FORMAT_BINARY) * * init_bytea_codecs() # <<<<<<<<<<<<<< */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_bytea_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/text.pyx":71 * PG_FORMAT_TEXT) * * init_text_codecs() # <<<<<<<<<<<<<< */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_text_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/bits.pyx":8 * * * from asyncpg.types import BitString # <<<<<<<<<<<<<< * * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_BitString); __Pyx_GIVEREF(__pyx_n_s_BitString); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BitString); __pyx_t_2 = __Pyx_Import(__pyx_n_s_asyncpg_types, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_BitString); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BitString, __pyx_t_1) < 0) __PYX_ERR(11, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/bits.pyx":64 * PG_FORMAT_BINARY) * * init_bits_codecs() # <<<<<<<<<<<<<< */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_init_bits_codecs(); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":8 * * * import datetime # <<<<<<<<<<<<<< * * utc = datetime.timezone.utc */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_2) < 0) __PYX_ERR(12, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":10 * import datetime * * utc = datetime.timezone.utc # <<<<<<<<<<<<<< * date_from_ordinal = datetime.date.fromordinal * timedelta = datetime.timedelta */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timezone); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_utc); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_utc, __pyx_t_2) < 0) __PYX_ERR(12, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":11 * * utc = datetime.timezone.utc * date_from_ordinal = datetime.date.fromordinal # <<<<<<<<<<<<<< * timedelta = datetime.timedelta * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fromordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_date_from_ordinal, __pyx_t_2) < 0) __PYX_ERR(12, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":12 * utc = datetime.timezone.utc * date_from_ordinal = datetime.date.fromordinal * timedelta = datetime.timedelta # <<<<<<<<<<<<<< * * pg_epoch_datetime = datetime.datetime(2000, 1, 1) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_timedelta, __pyx_t_1) < 0) __PYX_ERR(12, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":14 * 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_pg_epoch_datetime, __pyx_t_1) < 0) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":16 * 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pg_epoch_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 16, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = PyLong_AsLong(__pyx_t_3); if (unlikely(__pyx_t_5 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_7asyncpg_8protocol_8protocol_pg_epoch_datetime_ts = ((int32_t)__pyx_t_5); /* "asyncpg/protocol/codecs/datetime.pyx":18 * 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(pg_epoch_datetime_utc.timestamp()) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_utc); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tzinfo, __pyx_t_2) < 0) __PYX_ERR(12, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__116, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 18, __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 (PyDict_SetItem(__pyx_d, __pyx_n_s_pg_epoch_datetime_utc, __pyx_t_2) < 0) __PYX_ERR(12, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":20 * pg_epoch_datetime_utc = datetime.datetime(2000, 1, 1, tzinfo=utc) * cdef int32_t pg_epoch_datetime_utc_ts = \ * cpython.PyLong_AsLong(pg_epoch_datetime_utc.timestamp()) # <<<<<<<<<<<<<< * * pg_epoch_date = datetime.date(2000, 1, 1) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pg_epoch_datetime_utc); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 20, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_5 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7asyncpg_8protocol_8protocol_pg_epoch_datetime_utc_ts = ((int32_t)__pyx_t_5); /* "asyncpg/protocol/codecs/datetime.pyx":22 * cpython.PyLong_AsLong(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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_pg_epoch_date, __pyx_t_2) < 0) __PYX_ERR(12, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":24 * 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pg_epoch_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 24, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_5 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7asyncpg_8protocol_8protocol_pg_date_offset_ord = ((int32_t)__pyx_t_5); /* "asyncpg/protocol/codecs/datetime.pyx":27 * * # Binary representations of infinity for datetimes. * cdef int64_t pg_time64_infinity = 0x7fffffffffffffff # <<<<<<<<<<<<<< * cdef int64_t pg_time64_negative_infinity = 0x8000000000000000 * cdef int32_t pg_date_infinity = 0x7fffffff */ __pyx_v_7asyncpg_8protocol_8protocol_pg_time64_infinity = 0x7fffffffffffffff; /* "asyncpg/protocol/codecs/datetime.pyx":28 * # Binary representations of infinity for datetimes. * cdef int64_t pg_time64_infinity = 0x7fffffffffffffff * cdef int64_t pg_time64_negative_infinity = 0x8000000000000000 # <<<<<<<<<<<<<< * cdef int32_t pg_date_infinity = 0x7fffffff * cdef int32_t pg_date_negative_infinity = 0x80000000 */ __pyx_v_7asyncpg_8protocol_8protocol_pg_time64_negative_infinity = ((int64_t)0x8000000000000000); /* "asyncpg/protocol/codecs/datetime.pyx":29 * cdef int64_t pg_time64_infinity = 0x7fffffffffffffff * cdef int64_t pg_time64_negative_infinity = 0x8000000000000000 * cdef int32_t pg_date_infinity = 0x7fffffff # <<<<<<<<<<<<<< * cdef int32_t pg_date_negative_infinity = 0x80000000 * */ __pyx_v_7asyncpg_8protocol_8protocol_pg_date_infinity = 0x7fffffff; /* "asyncpg/protocol/codecs/datetime.pyx":30 * cdef int64_t pg_time64_negative_infinity = 0x8000000000000000 * cdef int32_t pg_date_infinity = 0x7fffffff * cdef int32_t pg_date_negative_infinity = 0x80000000 # <<<<<<<<<<<<<< * * infinity_datetime = datetime.datetime( */ __pyx_v_7asyncpg_8protocol_8protocol_pg_date_negative_infinity = ((int32_t)0x80000000); /* "asyncpg/protocol/codecs/datetime.pyx":32 * cdef int32_t pg_date_negative_infinity = 0x80000000 * * infinity_datetime = datetime.datetime( # <<<<<<<<<<<<<< * datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":33 * * infinity_datetime = datetime.datetime( * datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) # <<<<<<<<<<<<<< * * cdef int32_t infinity_datetime_ord = cpython.PyLong_AsLong( */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_MAXYEAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[8] = {__pyx_t_3, __pyx_t_4, __pyx_int_12, __pyx_int_31, __pyx_int_23, __pyx_int_59, __pyx_int_59, __pyx_int_999999}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 7+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 32, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[8] = {__pyx_t_3, __pyx_t_4, __pyx_int_12, __pyx_int_31, __pyx_int_23, __pyx_int_59, __pyx_int_59, __pyx_int_999999}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 7+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 32, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(7+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_int_12); __Pyx_GIVEREF(__pyx_int_12); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_int_12); __Pyx_INCREF(__pyx_int_31); __Pyx_GIVEREF(__pyx_int_31); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_int_31); __Pyx_INCREF(__pyx_int_23); __Pyx_GIVEREF(__pyx_int_23); PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_int_23); __Pyx_INCREF(__pyx_int_59); __Pyx_GIVEREF(__pyx_int_59); PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_int_59); __Pyx_INCREF(__pyx_int_59); __Pyx_GIVEREF(__pyx_int_59); PyTuple_SET_ITEM(__pyx_t_7, 5+__pyx_t_6, __pyx_int_59); __Pyx_INCREF(__pyx_int_999999); __Pyx_GIVEREF(__pyx_int_999999); PyTuple_SET_ITEM(__pyx_t_7, 6+__pyx_t_6, __pyx_int_999999); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_infinity_datetime, __pyx_t_2) < 0) __PYX_ERR(12, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":36 * * cdef int32_t infinity_datetime_ord = cpython.PyLong_AsLong( * infinity_datetime.toordinal()) # <<<<<<<<<<<<<< * * cdef int64_t infinity_datetime_ts = 252455615999999999 */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_infinity_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 36, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":35 * datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) * * cdef int32_t infinity_datetime_ord = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * infinity_datetime.toordinal()) * */ __pyx_t_5 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_5 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7asyncpg_8protocol_8protocol_infinity_datetime_ord = ((int32_t)__pyx_t_5); /* "asyncpg/protocol/codecs/datetime.pyx":38 * infinity_datetime.toordinal()) * * cdef int64_t infinity_datetime_ts = 252455615999999999 # <<<<<<<<<<<<<< * * negative_infinity_datetime = datetime.datetime( */ __pyx_v_7asyncpg_8protocol_8protocol_infinity_datetime_ts = 0x380E70B913B7FFF; /* "asyncpg/protocol/codecs/datetime.pyx":40 * cdef int64_t infinity_datetime_ts = 252455615999999999 * * negative_infinity_datetime = datetime.datetime( # <<<<<<<<<<<<<< * datetime.MINYEAR, 1, 1, 0, 0, 0, 0) * */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":41 * * negative_infinity_datetime = datetime.datetime( * datetime.MINYEAR, 1, 1, 0, 0, 0, 0) # <<<<<<<<<<<<<< * * cdef int32_t negative_infinity_datetime_ord = cpython.PyLong_AsLong( */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_MINYEAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[8] = {__pyx_t_7, __pyx_t_4, __pyx_int_1, __pyx_int_1, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 7+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 40, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[8] = {__pyx_t_7, __pyx_t_4, __pyx_int_1, __pyx_int_1, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 7+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 40, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_3 = PyTuple_New(7+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_int_1); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_int_1); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_6, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 4+__pyx_t_6, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 5+__pyx_t_6, __pyx_int_0); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 6+__pyx_t_6, __pyx_int_0); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_negative_infinity_datetime, __pyx_t_2) < 0) __PYX_ERR(12, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":44 * * cdef int32_t negative_infinity_datetime_ord = cpython.PyLong_AsLong( * negative_infinity_datetime.toordinal()) # <<<<<<<<<<<<<< * * cdef int64_t negative_infinity_datetime_ts = -63082281600000000 */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_negative_infinity_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 44, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":43 * datetime.MINYEAR, 1, 1, 0, 0, 0, 0) * * cdef int32_t negative_infinity_datetime_ord = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * negative_infinity_datetime.toordinal()) * */ __pyx_t_5 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_5 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7asyncpg_8protocol_8protocol_negative_infinity_datetime_ord = ((int32_t)__pyx_t_5); /* "asyncpg/protocol/codecs/datetime.pyx":46 * negative_infinity_datetime.toordinal()) * * cdef int64_t negative_infinity_datetime_ts = -63082281600000000 # <<<<<<<<<<<<<< * * infinity_date = datetime.date(datetime.MAXYEAR, 12, 31) */ __pyx_v_7asyncpg_8protocol_8protocol_negative_infinity_datetime_ts = -63082281600000000L; /* "asyncpg/protocol/codecs/datetime.pyx":48 * 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_MAXYEAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_4, __pyx_int_12, __pyx_int_31}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 48, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_4, __pyx_int_12, __pyx_int_31}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 48, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_int_12); __Pyx_GIVEREF(__pyx_int_12); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_int_12); __Pyx_INCREF(__pyx_int_31); __Pyx_GIVEREF(__pyx_int_31); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_int_31); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_infinity_date, __pyx_t_2) < 0) __PYX_ERR(12, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":51 * * cdef int32_t infinity_date_ord = cpython.PyLong_AsLong( * infinity_date.toordinal()) # <<<<<<<<<<<<<< * * negative_infinity_date = datetime.date(datetime.MINYEAR, 1, 1) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_infinity_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 51, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":50 * infinity_date = datetime.date(datetime.MAXYEAR, 12, 31) * * cdef int32_t infinity_date_ord = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * infinity_date.toordinal()) * */ __pyx_t_5 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_5 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7asyncpg_8protocol_8protocol_infinity_date_ord = ((int32_t)__pyx_t_5); /* "asyncpg/protocol/codecs/datetime.pyx":53 * infinity_date.toordinal()) * * negative_infinity_date = datetime.date(datetime.MINYEAR, 1, 1) # <<<<<<<<<<<<<< * * cdef int32_t negative_infinity_date_ord = cpython.PyLong_AsLong( */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_MINYEAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_int_1, __pyx_int_1}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 53, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_int_1, __pyx_int_1}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 53, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_3 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_int_1); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_int_1); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_negative_infinity_date, __pyx_t_2) < 0) __PYX_ERR(12, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":56 * * cdef int32_t negative_infinity_date_ord = cpython.PyLong_AsLong( * negative_infinity_date.toordinal()) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_negative_infinity_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 56, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/datetime.pyx":55 * 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_5 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_5 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(12, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7asyncpg_8protocol_8protocol_negative_infinity_date_ord = ((int32_t)__pyx_t_5); /* "asyncpg/protocol/codecs/datetime.pyx":480 * PG_FORMAT_TEXT) * * init_datetime_codecs() # <<<<<<<<<<<<<< */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_init_datetime_codecs(); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/float.pyx":49 * * * init_float_codecs() # <<<<<<<<<<<<<< */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_init_float_codecs(); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":8 * * * from asyncpg.types import Box, Line, LineSegment, Path, Point, Polygon, Circle # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Box); __Pyx_GIVEREF(__pyx_n_s_Box); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Box); __Pyx_INCREF(__pyx_n_s_Line); __Pyx_GIVEREF(__pyx_n_s_Line); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Line); __Pyx_INCREF(__pyx_n_s_LineSegment); __Pyx_GIVEREF(__pyx_n_s_LineSegment); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_LineSegment); __Pyx_INCREF(__pyx_n_s_Path); __Pyx_GIVEREF(__pyx_n_s_Path); PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_Path); __Pyx_INCREF(__pyx_n_s_Point); __Pyx_GIVEREF(__pyx_n_s_Point); PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_Point); __Pyx_INCREF(__pyx_n_s_Polygon); __Pyx_GIVEREF(__pyx_n_s_Polygon); PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_Polygon); __Pyx_INCREF(__pyx_n_s_Circle); __Pyx_GIVEREF(__pyx_n_s_Circle); PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_Circle); __pyx_t_3 = __Pyx_Import(__pyx_n_s_asyncpg_types, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Box); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Box, __pyx_t_2) < 0) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Line, __pyx_t_2) < 0) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_LineSegment); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LineSegment, __pyx_t_2) < 0) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Path); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Path, __pyx_t_2) < 0) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Point, __pyx_t_2) < 0) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Polygon, __pyx_t_2) < 0) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Circle, __pyx_t_2) < 0) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/geometry.pyx":205 * * * init_geometry_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_geometry_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/int.pyx":111 * * * init_int_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_int_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/json.pyx":42 * PG_FORMAT_BINARY) * * init_json_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_json_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/money.pyx":20 * * * init_monetary_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_monetary_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/network.pyx":8 * * * import ipaddress # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_Import(__pyx_n_s_ipaddress, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipaddress, __pyx_t_3) < 0) __PYX_ERR(17, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/network.pyx":17 * * * _ipaddr = ipaddress.ip_address # <<<<<<<<<<<<<< * _ipnet = ipaddress.ip_network * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipaddr, __pyx_t_2) < 0) __PYX_ERR(17, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/network.pyx":18 * * _ipaddr = ipaddress.ip_address * _ipnet = ipaddress.ip_network # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ipaddress); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ip_network); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipnet, __pyx_t_3) < 0) __PYX_ERR(17, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/network.pyx":144 * * * init_network_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_network_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":11 * from libc.stdio cimport snprintf * * import decimal # <<<<<<<<<<<<<< * * from asyncpg.protocol cimport python */ __pyx_t_3 = __Pyx_Import(__pyx_n_s_decimal, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_decimal, __pyx_t_3) < 0) __PYX_ERR(18, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":22 * DEF NUMERIC_NAN = 0xC000 * * _Dec = decimal.Decimal # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decimal); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dec, __pyx_t_2) < 0) __PYX_ERR(18, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/numeric.pyx":323 * PG_FORMAT_BINARY) * * init_numeric_codecs() # <<<<<<<<<<<<<< */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_init_numeric_codecs(); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/tsearch.pyx":26 * * * init_tsearch_codecs() # <<<<<<<<<<<<<< */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_init_tsearch_codecs(); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/txid.pyx":71 * * * init_txid_codecs() # <<<<<<<<<<<<<< */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_init_txid_codecs(); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/uuid.pyx":8 * * * import uuid # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_uuid, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_uuid, __pyx_t_2) < 0) __PYX_ERR(21, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/uuid.pyx":11 * * * _UUID = uuid.UUID # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UUID_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_UUID, __pyx_t_3) < 0) __PYX_ERR(21, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/uuid.pyx":31 * PG_FORMAT_BINARY) * * init_uuid_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_uuid_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/misc.pyx":120 * PG_FORMAT_TEXT) * * init_pseudo_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_pseudo_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":8 * * * from collections.abc import Container as ContainerABC # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Container); __Pyx_GIVEREF(__pyx_n_s_Container); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Container); __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Container); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ContainerABC, __pyx_t_3) < 0) __PYX_ERR(6, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/array.pyx":14 * * # "NULL" * cdef Py_UCS4 *APG_NULL = [0x004E, 0x0055, 0x004C, 0x004C, 0x0000] # <<<<<<<<<<<<<< * * */ __pyx_t_8[0] = 0x004E; __pyx_t_8[1] = 0x0055; __pyx_t_8[2] = 0x004C; __pyx_t_8[3] = 0x004C; __pyx_t_8[4] = 0x0000; __pyx_v_7asyncpg_8protocol_8protocol_APG_NULL = __pyx_t_8; /* "asyncpg/protocol/codecs/array.pyx":865 * PG_FORMAT_BINARY) * * init_array_codecs() # <<<<<<<<<<<<<< */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_init_array_codecs(); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/range.pyx":8 * * * from asyncpg import types as apg_types # <<<<<<<<<<<<<< * * # defined in postgresql/src/include/utils/rangetypes.h */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_types); __Pyx_GIVEREF(__pyx_n_s_types); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_types); __pyx_t_3 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_apg_types, __pyx_t_2) < 0) __PYX_ERR(23, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/range.pyx":149 * * * init_range_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_range_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/record.pyx":57 * PG_FORMAT_BINARY) * * init_record_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_record_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/hstore.pyx":82 * PG_FORMAT_BINARY) * * init_hstore_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_hstore_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":8 * * * from hashlib import md5 as hashlib_md5 # for MD5 authentication # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_md5); __Pyx_GIVEREF(__pyx_n_s_md5); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_md5); __pyx_t_2 = __Pyx_Import(__pyx_n_s_hashlib, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_md5); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hashlib_md5, __pyx_t_3) < 0) __PYX_ERR(7, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":957 * * * cdef bytes SYNC_MESSAGE = bytes(WriteBuffer.new_message(b'S').end_message()) # <<<<<<<<<<<<<< */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_new_message('S')); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_11WriteBuffer_end_message(((struct __pyx_obj_7asyncpg_8protocol_8protocol_WriteBuffer *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":8 * * * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_exceptions); __Pyx_GIVEREF(__pyx_n_s_exceptions); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_exceptions); __pyx_t_2 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_exceptions, __pyx_t_3) < 0) __PYX_ERR(27, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":88 * * * NO_TIMEOUT = object() # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_TIMEOUT, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":811 * * * class Timer: # <<<<<<<<<<<<<< * def __init__(self, budget): * self._budget = budget */ __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Timer, __pyx_n_s_Timer, (PyObject *) NULL, __pyx_n_s_asyncpg_protocol_protocol, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/protocol.pyx":812 * * class Timer: * def __init__(self, budget): # <<<<<<<<<<<<<< * self._budget = budget * self._started = 0 */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_1__init__, 0, __pyx_n_s_Timer___init, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":816 * self._started = 0 * * def __enter__(self): # <<<<<<<<<<<<<< * if self._budget is not None: * self._started = time.monotonic() */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_3__enter__, 0, __pyx_n_s_Timer___enter, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_enter, __pyx_t_3) < 0) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":820 * self._started = time.monotonic() * * def __exit__(self, et, e, tb): # <<<<<<<<<<<<<< * if self._budget is not None: * self._budget -= time.monotonic() - self._started */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_5__exit__, 0, __pyx_n_s_Timer___exit, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_exit, __pyx_t_3) < 0) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":824 * self._budget -= time.monotonic() - self._started * * def get_remaining_budget(self): # <<<<<<<<<<<<<< * return self._budget * */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget, 0, __pyx_n_s_Timer_get_remaining_budget, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_remaining_budget, __pyx_t_3) < 0) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":811 * * * class Timer: # <<<<<<<<<<<<<< * def __init__(self, budget): * self._budget = budget */ __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Timer, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timer, __pyx_t_3) < 0) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":828 * * * class Protocol(BaseProtocol, asyncio.Protocol): # <<<<<<<<<<<<<< * pass * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Protocol); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol)); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_Protocol, __pyx_n_s_Protocol, (PyObject *) NULL, __pyx_n_s_asyncpg_protocol_protocol, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Protocol, __pyx_t_2, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Protocol, __pyx_t_4) < 0) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __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; /* "asyncpg/protocol/protocol.pyx":832 * * * def _create_record(object mapping, tuple elems): # <<<<<<<<<<<<<< * # Exposed only for testing purposes. * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7asyncpg_8protocol_8protocol_1_create_record, NULL, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_record, __pyx_t_2) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":853 * * * Record = record.ApgRecord_InitTypes() # <<<<<<<<<<<<<< */ __pyx_t_9 = ApgRecord_InitTypes(); if (unlikely(__pyx_t_9 == ((PyTypeObject *)NULL))) __PYX_ERR(0, 853, __pyx_L1_error) __pyx_t_2 = ((PyObject *)__pyx_t_9); __Pyx_INCREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Record, __pyx_t_2) < 0) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_Memory(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0xe0abff4: * from pickle import PickleError as __pyx_PickleError */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7asyncpg_8protocol_8protocol_3__pyx_unpickle_Memory, NULL, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Memory, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":9 * __pyx_unpickle_Memory__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Memory__set_state(Memory __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.buf = __pyx_state[0]; __pyx_result.length = __pyx_state[1]; __pyx_result.owner = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7asyncpg_8protocol_8protocol_5__pyx_unpickle_FastReadBuffer, NULL, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FastReadBuffer, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0xb75bfc9: * from pickle import PickleError as __pyx_PickleError */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7asyncpg_8protocol_8protocol_7__pyx_unpickle_DataCodecConfig, NULL, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_DataCodecConfig, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":9 * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._local_type_codecs = __pyx_state[0]; __pyx_result._type_codecs_cache = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7asyncpg_8protocol_8protocol_9__pyx_unpickle_CoreProtocol, NULL, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CoreProtocol, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0x30f806c: * from pickle import PickleError as __pyx_PickleError */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7asyncpg_8protocol_8protocol_11__pyx_unpickle_BaseProtocol, NULL, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BaseProtocol, __pyx_t_2) < 0) __PYX_ERR(2, 1, __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_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "hton.pxd":81 * * * cdef inline double unpack_double(const char* buf): # <<<<<<<<<<<<<< * cdef _doubleconv v * v.i = unpack_int64(buf) */ /*--- Wrapped vars code ---*/ 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_7); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init asyncpg.protocol.protocol", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init asyncpg.protocol.protocol"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- 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((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } else { if (default_value == Py_None) default_value = NULL; value = PyObject_CallMethodObjArgs( d, __pyx_n_s_get, key, default_value, NULL); } #endif return value; } /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); } } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = f->f_localsplus; for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" 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 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" 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 /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* RaiseArgTupleInvalid */ 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_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY 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_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { 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); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *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 /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY 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); #else 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); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; 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; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; icurexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #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, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; 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; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif 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 PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE 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; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* GetAttr3 */ 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; } static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r = __Pyx_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #ifdef _MSC_VER else state = (PyGILState_STATE)-1; #endif #endif __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(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* None */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* 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) { #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #endif 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 = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); bad: return NULL; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } 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])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); return 0; } /* 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; 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; *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 /* None */ static CYTHON_INLINE int64_t __Pyx_mod_int64_t(int64_t a, int64_t b) { int64_t r = a % b; r += ((r != 0) & ((r ^ b) < 0)) * b; return r; } /* None */ static CYTHON_INLINE long __Pyx_div_long(long a, long b) { long q = a / b; long r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } /* None */ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { long r = a % b; r += ((r != 0) & ((r ^ b) < 0)) * b; return r; } /* None */ static CYTHON_INLINE int64_t __Pyx_div_int64_t(int64_t a, int64_t b) { int64_t q = a / b; int64_t r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long x; long b = PyInt_AS_LONG(op2); x = (long)((unsigned long)a + b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; #endif const digit* digits = ((PyLongObject*)op2)->ob_digit; const Py_ssize_t size = Py_SIZE(op2); if (likely(__Pyx_sst_abs(size) <= 1)) { b = likely(size) ? digits[0] : 0; if (size == -1) b = -b; } 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])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; double b = PyFloat_AS_DOUBLE(op2); double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a - b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } 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])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla - llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (unlikely(!r)) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* 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) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* IterNext */ static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_Occurred(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return NULL; if (defval) { __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) { PyErr_Format(PyExc_TypeError, "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name); } static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { PyObject* next; iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; if (likely(iternext)) { #if CYTHON_USE_TYPE_SLOTS next = iternext(iterator); if (likely(next)) return next; #if PY_VERSION_HEX >= 0x02070000 if (unlikely(iternext == &_PyObject_NextNotImplemented)) return NULL; #endif #else next = PyIter_Next(iterator); if (likely(next)) return next; #endif } else if (CYTHON_USE_TYPE_SLOTS || !PyIter_Check(iterator)) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; } return __Pyx_PyIter_Next2Default(defval); } /* decode_c_bytes */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { if (unlikely((start < 0) | (stop < 0))) { if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (stop > length) stop = length; length = stop - start; if (unlikely(length <= 0)) return PyUnicode_FromUnicode(NULL, 0); cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *function = PyMethod_GET_FUNCTION(method); result = __Pyx_PyObject_CallOneArg(function, self); Py_DECREF(method); return result; } } #endif result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = Py_TYPE(iter)->tp_iternext; 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 */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* FetchCommonType */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* PyObjectCallMethod1 */ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = NULL; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {self, arg}; result = __Pyx_PyFunction_FastCall(function, args, 2); goto done; } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {self, arg}; result = __Pyx_PyCFunction_FastCall(function, args, 2); goto done; } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); goto done; done: return result; } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto done; result = __Pyx__PyObject_CallMethod1(method, arg); done: Py_XDECREF(method); return result; } /* CoroutineBase */ #include #include #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; __Pyx_ErrFetch(&et, &ev, &tb); if (!et) { Py_XDECREF(tb); Py_XDECREF(ev); Py_INCREF(Py_None); *pvalue = Py_None; return 0; } if (likely(et == PyExc_StopIteration)) { if (!ev) { Py_INCREF(Py_None); value = Py_None; } #if PY_VERSION_HEX >= 0x030300A0 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) { value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); } #endif else if (unlikely(PyTuple_Check(ev))) { if (PyTuple_GET_SIZE(ev) >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); #else value = PySequence_ITEM(ev, 0); #endif } else { Py_INCREF(Py_None); value = Py_None; } Py_DECREF(ev); } else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { value = ev; } if (likely(value)) { Py_XDECREF(tb); Py_DECREF(et); *pvalue = value; return 0; } } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { __Pyx_ErrRestore(et, ev, tb); return -1; } PyErr_NormalizeException(&et, &ev, &tb); if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { __Pyx_ErrRestore(et, ev, tb); return -1; } Py_XDECREF(tb); Py_DECREF(et); #if PY_VERSION_HEX >= 0x030300A0 value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); #else { PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); Py_DECREF(ev); if (likely(args)) { value = PySequence_GetItem(args, 0); Py_DECREF(args); } if (unlikely(!value)) { __Pyx_ErrRestore(NULL, NULL, NULL); Py_INCREF(Py_None); value = Py_None; } } #endif *pvalue = value; return 0; } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) { PyObject *exc_type = self->exc_type; PyObject *exc_value = self->exc_value; PyObject *exc_traceback = self->exc_traceback; self->exc_type = NULL; self->exc_value = NULL; self->exc_traceback = NULL; Py_XDECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_traceback); } #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) { const char *msg; if (0) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_CheckExact((PyObject*)gen)) { msg = "coroutine already executing"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { msg = "async generator already executing"; #endif } else { msg = "generator already executing"; } PyErr_SetString(PyExc_ValueError, msg); } #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) { const char *msg; if (0) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_CheckExact(gen)) { msg = "can't send non-None value to a just-started coroutine"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(gen)) { msg = "can't send non-None value to a just-started async generator"; #endif } else { msg = "can't send non-None value to a just-started generator"; } PyErr_SetString(PyExc_TypeError, msg); } #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) { #ifdef __Pyx_Coroutine_USED if (!closing && __Pyx_Coroutine_CheckExact(gen)) { PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); } else #endif if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; PyObject *retval; assert(!self->is_running); if (unlikely(self->resume_label == 0)) { if (unlikely(value && value != Py_None)) { return __Pyx_Coroutine_NotStartedError((PyObject*)self); } } if (unlikely(self->resume_label == -1)) { return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign tstate = __pyx_tstate; #else tstate = __Pyx_PyThreadState_Current; #endif if (self->exc_type) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON #else if (self->exc_traceback) { PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; PyFrameObject *f = tb->tb_frame; Py_XINCREF(tstate->frame); assert(f->f_back == NULL); f->f_back = tstate->frame; } #endif __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback); } else { __Pyx_Coroutine_ExceptionClear(self); __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback); } self->is_running = 1; retval = self->body((PyObject *) self, tstate, value); self->is_running = 0; return retval; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *self) { if (likely(self->exc_traceback)) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON #else PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; PyFrameObject *f = tb->tb_frame; Py_CLEAR(f->f_back); #endif } } static CYTHON_INLINE PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) { if (unlikely(!retval)) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { PyObject *exc = PyExc_StopIteration; #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) exc = __Pyx_PyExc_StopAsyncIteration; #endif __Pyx_PyErr_SetNone(exc); } } return retval; } static CYTHON_INLINE PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { PyObject *ret; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); ret = __Pyx_Coroutine_SendEx(gen, val, 0); Py_XDECREF(val); return ret; } static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { PyObject *retval; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000) if (PyGen_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000) if (PyCoro_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif { if (value == Py_None) ret = Py_TYPE(yf)->tp_iternext(yf); else ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); } gen->is_running = 0; if (likely(ret)) { return ret; } retval = __Pyx_Coroutine_FinishDelegation(gen); } else { retval = __Pyx_Coroutine_SendEx(gen, value, 0); } return __Pyx_Coroutine_MethodReturn(self, retval); } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { PyObject *retval = NULL; int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_CheckExact(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); if (!retval) return -1; } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); } else #endif { PyObject *meth; gen->is_running = 1; meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close); if (unlikely(!meth)) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_WriteUnraisable(yf); } PyErr_Clear(); } else { retval = PyObject_CallFunction(meth, NULL); Py_DECREF(meth); if (!retval) err = -1; } gen->is_running = 0; } Py_XDECREF(retval); return err; } static PyObject *__Pyx_Generator_Next(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000) if (PyGen_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, NULL); } else #endif ret = Py_TYPE(yf)->tp_iternext(yf); gen->is_running = 0; if (likely(ret)) { return ret; } return __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_SendEx(gen, Py_None, 0); } static PyObject *__Pyx_Coroutine_Close(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *retval, *raised_exception; PyObject *yf = gen->yieldfrom; int err = 0; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); __Pyx_Coroutine_Undelegate(gen); Py_DECREF(yf); } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); if (unlikely(retval)) { const char *msg; Py_DECREF(retval); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_CheckExact(self)) { msg = "coroutine ignored GeneratorExit"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { #if PY_VERSION_HEX < 0x03060000 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; #else msg = "async generator ignored GeneratorExit"; #endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); return NULL; } raised_exception = PyErr_Occurred(); if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { if (raised_exception) PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { int err = __Pyx_Coroutine_CloseIter(gen, yf); Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); goto throw_here; } gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) #endif #ifdef __Pyx_Coroutine_USED || __Pyx_Coroutine_CheckExact(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_GetAttrStr(yf, __pyx_n_s_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { gen->is_running = 0; return NULL; } PyErr_Clear(); __Pyx_Coroutine_Undelegate(gen); gen->is_running = 0; goto throw_here; } if (likely(args)) { ret = PyObject_CallObject(meth, args); } else { ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL); } Py_DECREF(meth); } gen->is_running = 0; Py_DECREF(yf); if (!ret) { ret = __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_MethodReturn(self, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); Py_VISIT(gen->exc_type); Py_VISIT(gen->exc_value); Py_VISIT(gen->exc_traceback); return 0; } static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); Py_CLEAR(gen->yieldfrom); Py_CLEAR(gen->exc_type); Py_CLEAR(gen->exc_value); Py_CLEAR(gen->exc_traceback); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); } #endif Py_CLEAR(gen->gi_name); Py_CLEAR(gen->gi_qualname); return 0; } static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); if (gen->gi_weakreflist != NULL) PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE if (PyObject_CallFinalizerFromDealloc(self)) #else Py_TYPE(gen)->tp_del(self); if (self->ob_refcnt > 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); PyObject_GC_Del(gen); } static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; __Pyx_PyThreadState_declare if (gen->resume_label < 0) { return; } #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt == 0); self->ob_refcnt = 1; #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; PyObject *finalizer = agen->ag_finalizer; if (finalizer && !agen->ag_closed) { PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); if (unlikely(!res)) { PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } __Pyx_ErrRestore(error_type, error_value, error_traceback); return; } } #endif if (unlikely(gen->resume_label == 0 && !error_value)) { #ifdef __Pyx_Coroutine_USED #ifdef __Pyx_Generator_USED if (!__Pyx_Generator_CheckExact(self)) #endif { PyObject_GC_UnTrack(self); #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); #else {PyObject *msg; char *cmsg; #if CYTHON_COMPILING_IN_PYPY msg = NULL; cmsg = (char*) "coroutine was never awaited"; #else char *cname; PyObject *qualname; qualname = gen->gi_qualname; cname = PyString_AS_STRING(qualname); msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); if (unlikely(!msg)) { PyErr_Clear(); cmsg = (char*) "coroutine was never awaited"; } else { cmsg = PyString_AS_STRING(msg); } #endif if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) PyErr_WriteUnraisable(self); Py_XDECREF(msg);} #endif PyObject_GC_Track(self); } #endif } else { PyObject *res = __Pyx_Coroutine_Close(self); if (unlikely(!res)) { if (PyErr_Occurred()) PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt > 0); if (--self->ob_refcnt == 0) { return; } { Py_ssize_t refcnt = self->ob_refcnt; _Py_NewReference(self); self->ob_refcnt = refcnt; } #if CYTHON_COMPILING_IN_CPYTHON assert(PyType_IS_GC(self->ob_type) && _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); _Py_DEC_REFTOTAL; #endif #ifdef COUNT_ALLOCS --Py_TYPE(self)->tp_frees; --Py_TYPE(self)->tp_allocs; #endif #endif } static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self) { PyObject *name = self->gi_name; if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = self->gi_name; Py_INCREF(value); self->gi_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self) { PyObject *name = self->gi_qualname; if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = self->gi_qualname; Py_INCREF(value); self->gi_qualname = value; Py_XDECREF(tmp); return 0; } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, 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, closure, name, qualname, module_name); } static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, 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->exc_type = NULL; gen->exc_value = NULL; gen->exc_traceback = NULL; gen->gi_weakreflist = NULL; Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); gen->gi_name = name; Py_XINCREF(module_name); gen->gi_modulename = module_name; PyObject_GC_Track(gen); return gen; } /* PatchModuleWithCoroutine */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; globals = PyDict_New(); if (unlikely(!globals)) goto ignore; result = PyDict_SetItemString(globals, "_cython_coroutine_type", #ifdef __Pyx_Coroutine_USED (PyObject*)__pyx_CoroutineType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; result = PyDict_SetItemString(globals, "_cython_generator_type", #ifdef __Pyx_Generator_USED (PyObject*)__pyx_GeneratorType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; result_obj = PyRun_String(py_code, Py_file_input, globals, globals); if (unlikely(!result_obj)) goto ignore; Py_DECREF(result_obj); Py_DECREF(globals); return module; ignore: Py_XDECREF(globals); PyErr_WriteUnraisable(module); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { Py_DECREF(module); module = NULL; } #else py_code++; #endif return module; } /* PatchGeneratorABC */ #ifndef CYTHON_REGISTER_ABCS #define CYTHON_REGISTER_ABCS 1 #endif #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( module, "" "if _cython_generator_type is not None:\n" " try: Generator = _module.Generator\n" " except AttributeError: pass\n" " else: Generator.register(_cython_generator_type)\n" "if _cython_coroutine_type is not None:\n" " try: Coroutine = _module.Coroutine\n" " except AttributeError: pass\n" " else: Coroutine.register(_cython_coroutine_type)\n" ); return module; } #endif static int __Pyx_patch_abc(void) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static int abc_patched = 0; if (CYTHON_REGISTER_ABCS && !abc_patched) { PyObject *module; module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); if (!module) { PyErr_WriteUnraisable(NULL); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, ((PY_MAJOR_VERSION >= 3) ? "Cython module failed to register with collections.abc module" : "Cython module failed to register with collections module"), 1) < 0)) { return -1; } } else { module = __Pyx_patch_abc_module(module); abc_patched = 1; if (unlikely(!module)) return -1; Py_DECREF(module); } module = PyImport_ImportModule("backports_abc"); if (module) { module = __Pyx_patch_abc_module(module); Py_XDECREF(module); } if (!module) { PyErr_Clear(); } } #else if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); #endif return 0; } /* Coroutine */ static void __Pyx_CoroutineAwait_dealloc(PyObject *self) { PyObject_GC_UnTrack(self); Py_CLEAR(((__pyx_CoroutineAwaitObject*)self)->coroutine); PyObject_GC_Del(self); } static int __Pyx_CoroutineAwait_traverse(__pyx_CoroutineAwaitObject *self, visitproc visit, void *arg) { Py_VISIT(self->coroutine); return 0; } static int __Pyx_CoroutineAwait_clear(__pyx_CoroutineAwaitObject *self) { Py_CLEAR(self->coroutine); return 0; } static PyObject *__Pyx_CoroutineAwait_Next(__pyx_CoroutineAwaitObject *self) { return __Pyx_Generator_Next(self->coroutine); } static PyObject *__Pyx_CoroutineAwait_Send(__pyx_CoroutineAwaitObject *self, PyObject *value) { return __Pyx_Coroutine_Send(self->coroutine, value); } static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args) { return __Pyx_Coroutine_Throw(self->coroutine, args); } static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self) { return __Pyx_Coroutine_Close(self->coroutine); } static PyObject *__Pyx_CoroutineAwait_self(PyObject *self) { Py_INCREF(self); return self; } #if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_CoroutineAwait_no_new(CYTHON_UNUSED PyTypeObject *type, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *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, (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_CoroutineAwait_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_CoroutineAwait_Close, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")}, {0, 0, 0, 0} }; static PyTypeObject __pyx_CoroutineAwaitType_type = { PyVarObject_HEAD_INIT(0, 0) "coroutine_wrapper", sizeof(__pyx_CoroutineAwaitObject), 0, (destructor) __Pyx_CoroutineAwait_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, PyDoc_STR("A wrapper object implementing __await__ for coroutines."), (traverseproc) __Pyx_CoroutineAwait_traverse, (inquiry) __Pyx_CoroutineAwait_clear, 0, 0, __Pyx_CoroutineAwait_self, (iternextfunc) __Pyx_CoroutineAwait_Next, __pyx_CoroutineAwait_methods, 0 , 0 , 0, 0, 0, 0, 0, 0, 0, #if !CYTHON_COMPILING_IN_PYPY __Pyx_CoroutineAwait_no_new, #else 0, #endif 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) { __pyx_CoroutineAwaitObject *await = PyObject_GC_New(__pyx_CoroutineAwaitObject, __pyx_CoroutineAwaitType); if (unlikely(!await)) return NULL; Py_INCREF(coroutine); await->coroutine = coroutine; PyObject_GC_Track(await); return (PyObject*)await; } static PyObject *__Pyx_Coroutine_await(PyObject *coroutine) { if (unlikely(!coroutine || !__Pyx_Coroutine_CheckExact(coroutine))) { PyErr_SetString(PyExc_TypeError, "invalid input, expected coroutine"); return NULL; } return __Pyx__Coroutine_await(coroutine); } #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1 static PyObject *__Pyx_Coroutine_compare(PyObject *obj, PyObject *other, int op) { PyObject* result; switch (op) { case Py_EQ: result = (other == obj) ? Py_True : Py_False; break; case Py_NE: result = (other != obj) ? Py_True : Py_False; break; default: result = Py_NotImplemented; } Py_INCREF(result); return result; } #endif static PyMethodDef __pyx_Coroutine_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next iterated value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next iterated value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")}, #if PY_VERSION_HEX < 0x030500B1 {"__await__", (PyCFunction) __Pyx_Coroutine_await, METH_NOARGS, (char*) PyDoc_STR("__await__() -> return an iterator to be used in await expression.")}, #endif {0, 0, 0, 0} }; static PyMemberDef __pyx_Coroutine_memberlist[] = { {(char *) "cr_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, {(char*) "cr_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, (char*) PyDoc_STR("object being awaited, or None")}, {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Coroutine_getsets[] = { {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, (char*) PyDoc_STR("name of the coroutine"), 0}, {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, (char*) PyDoc_STR("qualified name of the coroutine"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_ASYNC_SLOTS static __Pyx_PyAsyncMethodsStruct __pyx_Coroutine_as_async = { __Pyx_Coroutine_await, 0, 0, }; #endif static PyTypeObject __pyx_CoroutineType_type = { PyVarObject_HEAD_INIT(0, 0) "coroutine", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, #if CYTHON_USE_ASYNC_SLOTS &__pyx_Coroutine_as_async, #else 0, #endif 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, #if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1 __Pyx_Coroutine_compare, #else 0, #endif offsetof(__pyx_CoroutineObject, gi_weakreflist), __Pyx_Coroutine_await, /* tp_iter */ (iternextfunc) __Pyx_Generator_Next, /* tp_iternext */ __pyx_Coroutine_methods, __pyx_Coroutine_memberlist, __pyx_Coroutine_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if CYTHON_USE_TP_FINALIZE 0, #else __Pyx_Coroutine_del, #endif 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, #elif PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_Coroutine_init(void) { __pyx_CoroutineType_type.tp_getattro = PyObject_GenericGetAttr; __pyx_CoroutineType = __Pyx_FetchCommonType(&__pyx_CoroutineType_type); if (unlikely(!__pyx_CoroutineType)) return -1; __pyx_CoroutineAwaitType = __Pyx_FetchCommonType(&__pyx_CoroutineAwaitType_type); if (unlikely(!__pyx_CoroutineAwaitType)) return -1; return 0; } /* GetAwaitIter */ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) { #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_CheckExact(o)) { return __Pyx_NewRef(o); } #endif return __Pyx__Coroutine_GetAwaitableIter(o); } static void __Pyx_Coroutine_AwaitableIterError(PyObject *source) { #if PY_VERSION_HEX >= 0x030600B3 || defined(_PyErr_FormatFromCause) _PyErr_FormatFromCause( PyExc_TypeError, "'async for' received an invalid object " "from __anext__: %.100s", Py_TYPE(source)->tp_name); #elif PY_MAJOR_VERSION >= 3 PyObject *exc, *val, *val2, *tb; 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__: %.100s", Py_TYPE(source)->tp_name); PyErr_Fetch(&exc, &val2, &tb); PyErr_NormalizeException(&exc, &val2, &tb); Py_INCREF(val); PyException_SetCause(val2, val); PyException_SetContext(val2, val); PyErr_Restore(exc, val2, tb); #else source++; #endif } static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) { PyObject *res; #if CYTHON_USE_ASYNC_SLOTS __Pyx_PyAsyncMethodsStruct* am = __Pyx_PyType_AsAsync(obj); if (likely(am && am->am_await)) { res = (*am->am_await)(obj); } else #endif #if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact) if (PyCoro_CheckExact(obj)) { return __Pyx_NewRef(obj); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && defined(CO_ITERABLE_COROUTINE) if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) { return __Pyx_NewRef(obj); } else #endif { PyObject *method = __Pyx_PyObject_GetAttrStr(obj, __pyx_n_s_await); if (unlikely(!method)) goto slot_error; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *function = PyMethod_GET_FUNCTION(method); res = __Pyx_PyObject_CallOneArg(function, self); } else res = __Pyx_PyObject_CallNoArg(method); } else #endif res = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); } if (unlikely(!res)) { __Pyx_Coroutine_AwaitableIterError(obj); goto bad; } if (unlikely(!PyIter_Check(res))) { PyErr_Format(PyExc_TypeError, "__await__() returned non-iterator of type '%.100s'", Py_TYPE(res)->tp_name); Py_CLEAR(res); } else { int is_coroutine = 0; #ifdef __Pyx_Coroutine_USED is_coroutine |= __Pyx_Coroutine_CheckExact(res); #endif #if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact) is_coroutine |= PyCoro_CheckExact(res); #endif if (unlikely(is_coroutine)) { /* __await__ must return an *iterator*, not a coroutine or another awaitable (see PEP 492) */ PyErr_SetString(PyExc_TypeError, "__await__() returned a coroutine"); Py_CLEAR(res); } } return res; slot_error: PyErr_Format(PyExc_TypeError, "object %.100s can't be used in 'await' expression", Py_TYPE(obj)->tp_name); bad: return NULL; } /* CoroutineYieldFrom */ static PyObject* __Pyx__Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen, PyObject *source) { PyObject *retval; PyObject *source_gen = __Pyx__Coroutine_GetAwaitableIter(source); if (unlikely(!source_gen)) { return NULL; } if (__Pyx_Coroutine_CheckExact(source_gen)) { retval = __Pyx_Generator_Next(source_gen); } else { #if CYTHON_USE_TYPE_SLOTS retval = Py_TYPE(source_gen)->tp_iternext(source_gen); #else retval = PyIter_Next(source_gen); #endif } if (retval) { gen->yieldfrom = source_gen; return retval; } Py_DECREF(source_gen); return NULL; } static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source) { PyObject *retval; if (__Pyx_Coroutine_CheckExact(source)) { if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) { PyErr_SetString( PyExc_RuntimeError, "coroutine is being awaited already"); return NULL; } retval = __Pyx_Generator_Next(source); #ifdef __Pyx_AsyncGen_USED } else if (__pyx_PyAsyncGenASend_CheckExact(source)) { retval = __Pyx_async_gen_asend_iternext(source); #endif } else { return __Pyx__Coroutine_Yield_From_Generic(gen, source); } if (retval) { Py_INCREF(source); gen->yieldfrom = source; } return retval; } /* ReturnWithStopIteration */ static void __Pyx__ReturnWithStopIteration(PyObject* value) { PyObject *exc, *args; #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_PYSTON __Pyx_PyThreadState_declare if ((PY_VERSION_HEX >= 0x03030000 && PY_VERSION_HEX < 0x030500B1) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { args = PyTuple_New(1); if (unlikely(!args)) return; Py_INCREF(value); PyTuple_SET_ITEM(args, 0, value); exc = PyType_Type.tp_call(PyExc_StopIteration, args, NULL); Py_DECREF(args); if (!exc) return; } else { Py_INCREF(value); exc = value; } __Pyx_PyThreadState_assign if (!__pyx_tstate->exc_type) { Py_INCREF(PyExc_StopIteration); __Pyx_ErrRestore(PyExc_StopIteration, exc, NULL); return; } #else args = PyTuple_Pack(1, value); if (unlikely(!args)) return; exc = PyObject_Call(PyExc_StopIteration, args, NULL); Py_DECREF(args); if (unlikely(!exc)) return; #endif PyErr_SetObject(PyExc_StopIteration, exc); Py_DECREF(exc); } /* None */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* SetVTable */ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; #if CYTHON_USE_PYTYPE_LOOKUP if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; #else if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; #endif #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; } PyType_Modified((PyTypeObject*)type_obj); } } goto GOOD; BAD: if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); ret = -1; GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } /* PatchInspect */ static PyObject* __Pyx_patch_inspect(PyObject* module) { #if defined(__Pyx_Generator_USED) && (!defined(CYTHON_PATCH_INSPECT) || CYTHON_PATCH_INSPECT) static int inspect_patched = 0; if (unlikely((!inspect_patched) && module)) { module = __Pyx_Coroutine_patch_module( module, "" "old_types = getattr(_module.isgenerator, '_cython_generator_types', None)\n" "if old_types is None or not isinstance(old_types, set):\n" " old_types = set()\n" " def cy_wrap(orig_func, type=type, cython_generator_types=old_types):\n" " def cy_isgenerator(obj): return type(obj) in cython_generator_types or orig_func(obj)\n" " cy_isgenerator._cython_generator_types = cython_generator_types\n" " return cy_isgenerator\n" " _module.isgenerator = cy_wrap(_module.isgenerator)\n" "old_types.add(_cython_generator_type)\n" ); inspect_patched = 1; } #else if ((0)) return __Pyx_Coroutine_patch_module(module, NULL); #endif return module; } /* PatchAsyncIO */ static PyObject* __Pyx_patch_asyncio(PyObject* module) { #if PY_VERSION_HEX < 0x030500B2 &&\ (defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED)) &&\ (!defined(CYTHON_PATCH_ASYNCIO) || CYTHON_PATCH_ASYNCIO) PyObject *patch_module = NULL; static int asyncio_patched = 0; if (unlikely((!asyncio_patched) && module)) { PyObject *package; package = __Pyx_Import(__pyx_n_s_asyncio_coroutines, NULL, 0); if (package) { patch_module = __Pyx_Coroutine_patch_module( PyObject_GetAttrString(package, "coroutines"), "" "try:\n" " coro_types = _module._COROUTINE_TYPES\n" "except AttributeError: pass\n" "else:\n" " if _cython_coroutine_type is not None and _cython_coroutine_type not in coro_types:\n" " coro_types = tuple(coro_types) + (_cython_coroutine_type,)\n" " if _cython_generator_type is not None and _cython_generator_type not in coro_types:\n" " coro_types = tuple(coro_types) + (_cython_generator_type,)\n" "_module._COROUTINE_TYPES = coro_types\n" ); } else { PyErr_Clear(); package = __Pyx_Import(__pyx_n_s_asyncio_tasks, NULL, 0); if (unlikely(!package)) goto asyncio_done; patch_module = __Pyx_Coroutine_patch_module( PyObject_GetAttrString(package, "tasks"), "" "if hasattr(_module, 'iscoroutine'):\n" " old_types = getattr(_module.iscoroutine, '_cython_coroutine_types', None)\n" " if old_types is None or not isinstance(old_types, set):\n" " old_types = set()\n" " def cy_wrap(orig_func, type=type, cython_coroutine_types=old_types):\n" " def cy_iscoroutine(obj): return type(obj) in cython_coroutine_types or orig_func(obj)\n" " cy_iscoroutine._cython_coroutine_types = cython_coroutine_types\n" " return cy_iscoroutine\n" " _module.iscoroutine = cy_wrap(_module.iscoroutine)\n" " if _cython_coroutine_type is not None:\n" " old_types.add(_cython_coroutine_type)\n" " if _cython_generator_type is not None:\n" " old_types.add(_cython_generator_type)\n" ); } Py_DECREF(package); if (unlikely(!patch_module)) goto ignore; asyncio_done: PyErr_Clear(); asyncio_patched = 1; #ifdef __Pyx_Generator_USED { PyObject *inspect_module; if (patch_module) { inspect_module = PyObject_GetAttr(patch_module, __pyx_n_s_inspect); Py_DECREF(patch_module); } else { inspect_module = __Pyx_Import(__pyx_n_s_inspect, NULL, 0); } if (unlikely(!inspect_module)) goto ignore; inspect_module = __Pyx_patch_inspect(inspect_module); if (unlikely(!inspect_module)) { Py_DECREF(module); module = NULL; } Py_XDECREF(inspect_module); } #else if ((0)) return __Pyx_patch_inspect(module); #endif } return module; ignore: PyErr_WriteUnraisable(module); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch asyncio package with custom generator type", 1) < 0)) { Py_DECREF(module); module = NULL; } #else if ((0)) return __Pyx_patch_inspect(__Pyx_Coroutine_patch_module(module, NULL)); #endif return module; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare_2); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_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, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } /* CythonFunction */ static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; 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 = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = 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) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__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 PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_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)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = 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; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); 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); 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; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; 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); } /* CLineInTraceback */ static int __Pyx_CLineForTraceback(int c_line) { #ifdef CYTHON_CLINE_IN_TRACEBACK return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0; #else PyObject *use_cline; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { use_cline = PyDict_GetItem(*cython_runtime_dict, __pyx_n_s_cline_in_traceback); } else #endif { PyObject *ptype, *pvalue, *ptraceback; PyObject *use_cline_obj; PyErr_Fetch(&ptype, &pvalue, &ptraceback); use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { use_cline = NULL; } PyErr_Restore(ptype, pvalue, ptraceback); } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (PyObject_Not(use_cline) != 0) { c_line = 0; } return c_line; #endif } /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); 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; if (c_line) { c_line = __Pyx_CLineForTraceback(c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( __Pyx_PyThreadState_Current, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage value) { 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; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); } } /* 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;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus value) { 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; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType value) { 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; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value) { 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; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus value) { 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; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint64_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat value) { 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; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat value) { 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; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) { const char neg_one = (char) -1, const_zero = (char) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(char) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(char) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(char) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(char), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType value) { 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; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* UnicodeAsUCS4 */ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length; #if CYTHON_PEP393_ENABLED length = PyUnicode_GET_LENGTH(x); if (likely(length == 1)) { return PyUnicode_READ_CHAR(x, 0); } #else length = PyUnicode_GET_SIZE(x); if (likely(length == 1)) { return PyUnicode_AS_UNICODE(x)[0]; } #if Py_UNICODE_SIZE == 2 else if (PyUnicode_GET_SIZE(x) == 2) { Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; if (high_val >= 0xD800 && high_val <= 0xDBFF) { Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; if (low_val >= 0xDC00 && low_val <= 0xDFFF) { return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); } } } #endif #endif PyErr_Format(PyExc_ValueError, "only single character unicode strings can be converted to Py_UCS4, " "got length %" CYTHON_FORMAT_SSIZE_T "d", length); return (Py_UCS4)-1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) { const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PY_LONG_LONG) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PY_LONG_LONG) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = (ptrdiff_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ptrdiff_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ptrdiff_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ptrdiff_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ptrdiff_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int32_t, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int32_t, digit, +digits[0]) case -2: if (8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) { return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 2: if (8 * sizeof(int32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) { return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -3: if (8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) { return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 3: if (8 * sizeof(int32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) { return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -4: if (8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT) { return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 4: if (8 * sizeof(int32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT) { return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; } #endif if (sizeof(int32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int32_t) -1; } } else { int32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int32_t) -1; val = __Pyx_PyInt_As_int32_t(tmp); Py_DECREF(tmp); return val; } 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 enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(PyObject *x) { 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; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) 0; case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) 0; case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, digit, +digits[0]) case -2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; case 2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; case -3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; case 3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; case -4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; case 4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1; } } else { enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(tmp); Py_DECREF(tmp); return val; } 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; } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(PyObject *x) { 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; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) 0; case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) 0; case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, digit, +digits[0]) case -2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; case 2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; case -3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; case 3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; case -4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; case 4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1; } } else { enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(tmp); Py_DECREF(tmp); return val; } 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; } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(PyObject *x) { 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; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0; case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0; case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, digit, +digits[0]) case -2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; case 2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; case -3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; case 3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; case -4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; case 4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1; } } else { enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(tmp); Py_DECREF(tmp); return val; } 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; } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(PyObject *x) { 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; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) 0; case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) 0; case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, digit, +digits[0]) case -2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; case 2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; case -3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; case 3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; case -4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; case 4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1; } } else { enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(tmp); Py_DECREF(tmp); return val; } 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; } /* CIntFromPy */ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint64_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint64_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint64_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint64_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint64_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint64_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, +digits[0]) case -2: if (8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) { return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint64_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) { return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) { return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint64_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) { return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) { return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint64_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT) { return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; } #endif if (sizeof(uint64_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint64_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint64_t) -1; } } else { uint64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint64_t) -1; val = __Pyx_PyInt_As_uint64_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint64_t"); return (uint64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint64_t"); return (uint64_t) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(PyObject *x) { 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; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) 0; case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) 0; case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, digit, +digits[0]) case -2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; case 2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; case -3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; case 3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; case -4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; case 4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1; } } else { enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(tmp); Py_DECREF(tmp); return val; } 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; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); 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 int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int64_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int64_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int64_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int64_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int64_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, +digits[0]) case -2: if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } #endif if (sizeof(int64_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int64_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int64_t) -1; } } else { int64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } 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 long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); 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; } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(PyObject *x) { 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; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) 0; case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) 0; case -1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, digit, +digits[0]) case -2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; case 2: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 2 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; case -3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; case 3: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 3 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; case -4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; case 4: if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 4 * PyLong_SHIFT) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; } #endif if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1; } } else { enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(tmp); Py_DECREF(tmp); return val; } 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 int8_t __Pyx_PyInt_As_int8_t(PyObject *x) { const int8_t neg_one = (int8_t) -1, const_zero = (int8_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int8_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int8_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int8_t, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int8_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int8_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int8_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int8_t, digit, +digits[0]) case -2: if (8 * sizeof(int8_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT) { return (int8_t) (((int8_t)-1)*(((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; case 2: if (8 * sizeof(int8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT) { return (int8_t) ((((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; case -3: if (8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT) { return (int8_t) (((int8_t)-1)*(((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; case 3: if (8 * sizeof(int8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT) { return (int8_t) ((((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; case -4: if (8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int8_t) - 1 > 4 * PyLong_SHIFT) { return (int8_t) (((int8_t)-1)*(((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; case 4: if (8 * sizeof(int8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int8_t) - 1 > 4 * PyLong_SHIFT) { return (int8_t) ((((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; } #endif if (sizeof(int8_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int8_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int8_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int8_t) -1; } } else { int8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int8_t) -1; val = __Pyx_PyInt_As_int8_t(tmp); Py_DECREF(tmp); return val; } 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 int16_t __Pyx_PyInt_As_int16_t(PyObject *x) { const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int16_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int16_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int16_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int16_t, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int16_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int16_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int16_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int16_t, digit, +digits[0]) case -2: if (8 * sizeof(int16_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) { return (int16_t) (((int16_t)-1)*(((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 2: if (8 * sizeof(int16_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) { return (int16_t) ((((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -3: if (8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) { return (int16_t) (((int16_t)-1)*(((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 3: if (8 * sizeof(int16_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) { return (int16_t) ((((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -4: if (8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT) { return (int16_t) (((int16_t)-1)*(((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 4: if (8 * sizeof(int16_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT) { return (int16_t) ((((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; } #endif if (sizeof(int16_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int16_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int16_t) -1; } } else { int16_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int16_t) -1; val = __Pyx_PyInt_As_int16_t(tmp); Py_DECREF(tmp); return val; } 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_PyInt_As_char(PyObject *x) { const char neg_one = (char) -1, const_zero = (char) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(char) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (char) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (char) 0; case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) 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 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (char) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(char) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (char) 0; case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) case -2: if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 2: if (8 * sizeof(char) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case -3: if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 3: if (8 * sizeof(char) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case -4: if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 4: if (8 * sizeof(char) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; } #endif if (sizeof(char) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (char) -1; } } else { char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (char) -1; val = __Pyx_PyInt_As_char(tmp); Py_DECREF(tmp); 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; } /* ObjectAsUCS4 */ static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject* x) { long ival; ival = __Pyx_PyInt_As_long(x); if (unlikely(ival < 0)) { if (!PyErr_Occurred()) PyErr_SetString(PyExc_OverflowError, "cannot convert negative value to Py_UCS4"); return (Py_UCS4)-1; } else if (unlikely(ival > 1114111)) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to Py_UCS4"); return (Py_UCS4)-1; } return (Py_UCS4)ival; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; 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); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { if (likely(err == exc_type)) return 1; if (likely(PyExceptionClass_Check(err))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); } return PyErr_GivenExceptionMatches(err, exc_type); } static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { if (likely(err == exc_type1 || err == exc_type2)) return 1; if (likely(PyExceptionClass_Check(err))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); } return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); } #endif /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, (char*) PyDoc_STR("name of the generator"), 0}, {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, (char*) PyDoc_STR("qualified name of the generator"), 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) "generator", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, 0, offsetof(__pyx_CoroutineObject, gi_weakreflist), 0, (iternextfunc) __Pyx_Generator_Next, __pyx_Generator_methods, __pyx_Generator_memberlist, __pyx_Generator_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if CYTHON_USE_TP_FINALIZE 0, #else __Pyx_Coroutine_del, #endif 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, #elif PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_Generator_init(void) { __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); if (unlikely(!__pyx_GeneratorType)) { return -1; } return 0; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* VoidPtrExport */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { PyObject *d; PyObject *cobj = 0; d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); Py_XINCREF(d); if (!d) { d = PyDict_New(); if (!d) goto bad; if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) goto bad; } #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItem(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* ModuleImport */ #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; 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; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", module_name, class_name, basicsize, size); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", module_name, class_name, basicsize, size); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) PyErr_Clear(); ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ asyncpg-0.13.0/asyncpg/protocol/consts.pxi0000664000372000037200000000100413172407302021433 0ustar travistravis00000000000000# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 DEF _BUFFER_INITIAL_SIZE = 1024 DEF _BUFFER_MAX_GROW = 65536 DEF _BUFFER_FREELIST_SIZE = 256 DEF _RECORD_FREELIST_SIZE = 1024 DEF _MEMORY_FREELIST_SIZE = 1024 DEF _MAXINT32 = 2**31 - 1 DEF _COPY_BUFFER_SIZE = 524288 DEF _COPY_SIGNATURE = b"PGCOPY\n\377\r\n\0" DEF _NUMERIC_DECODER_SMALLBUF_SIZE = 256 asyncpg-0.13.0/asyncpg/protocol/coreproto.pxd0000664000372000037200000001221213172407302022134 0ustar travistravis00000000000000# 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 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_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_METHOD_NAME = { AUTH_REQUIRED_KERBEROS: 'kerberosv5', AUTH_REQUIRED_PASSWORD: 'password', AUTH_REQUIRED_PASSWORDMD5: 'md5', AUTH_REQUIRED_GSS: 'gss', AUTH_REQUIRED_SSPI: 'sspi', } 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 # Instance of _ConnectionParameters object con_params 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 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 _write(self, buf) cdef inline _write_sync_message(self) 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_bind_message(self, str portal_name, str stmt_name, WriteBuffer bind_data) cdef _connect(self) cdef _prepare(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 _bind_execute_many(self, str portal_name, str stmt_name, object bind_data) 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) asyncpg-0.13.0/asyncpg/protocol/protocol.pxd0000664000372000037200000000344313172407302021767 0ustar travistravis00000000000000# 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 from libc.stdint cimport int16_t, int32_t, uint16_t, uint32_t, int64_t, uint64_t from .debug cimport ASYNCPG_DEBUG include "consts.pxi" include "pgtypes.pxi" include "buffer.pxd" include "codecs/base.pxd" include "settings.pxd" include "coreproto.pxd" include "prepared_stmt.pxd" cdef class BaseProtocol(CoreProtocol): cdef: object loop object address ConnectionSettings settings object cancel_sent_waiter object cancel_waiter object waiter bint return_extra object create_future object timeout_handle object timeout_callback object completed_callback object connection bint is_reading str last_query bint writing_paused bint closing readonly uint64_t queries_count PreparedStatementState statement 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) asyncpg-0.13.0/asyncpg/protocol/record/0000775000372000037200000000000013172407445020673 5ustar travistravis00000000000000asyncpg-0.13.0/asyncpg/protocol/record/recordobj.c0000664000372000037200000006365113172407302023013 0ustar travistravis00000000000000/* Big parts of this file are copied (with modifications) from CPython/Objects/tupleobject.c. Portions Copyright (c) PSF (and other CPython copyright holders). Portions Copyright (c) 2016-present MagicStack Inc. License: PSFL v2; see CPython/LICENSE for details. */ #include "recordobj.h" static PyObject * record_iter(PyObject *); static PyObject * record_new_items_iter(PyObject *); static ApgRecordObject *free_list[ApgRecord_MAXSAVESIZE]; static int numfree[ApgRecord_MAXSAVESIZE]; PyObject * ApgRecord_New(PyObject *desc, Py_ssize_t size) { ApgRecordObject *o; Py_ssize_t i; if (size < 0 || desc == NULL || !ApgRecordDesc_CheckExact(desc)) { PyErr_BadInternalCall(); return NULL; } if (size < ApgRecord_MAXSAVESIZE && (o = free_list[size]) != NULL) { free_list[size] = (ApgRecordObject *) o->ob_item[0]; numfree[size]--; _Py_NewReference((PyObject *)o); } else { /* Check for overflow */ if ((size_t)size > ((size_t)PY_SSIZE_T_MAX - sizeof(ApgRecordObject) - sizeof(PyObject *)) / sizeof(PyObject *)) { return PyErr_NoMemory(); } o = PyObject_GC_NewVar(ApgRecordObject, &ApgRecord_Type, size); if (o == NULL) { return NULL; } } for (i = 0; i < size; i++) { o->ob_item[i] = NULL; } Py_INCREF(desc); o->desc = (ApgRecordDescObject*)desc; o->self_hash = -1; PyObject_GC_Track(o); return (PyObject *) o; } static void record_dealloc(ApgRecordObject *o) { Py_ssize_t i; Py_ssize_t len = Py_SIZE(o); PyObject_GC_UnTrack(o); o->self_hash = -1; Py_CLEAR(o->desc); Py_TRASHCAN_SAFE_BEGIN(o) if (len > 0) { i = len; while (--i >= 0) { Py_CLEAR(o->ob_item[i]); } if (len < ApgRecord_MAXSAVESIZE && numfree[len] < ApgRecord_MAXFREELIST && ApgRecord_CheckExact(o)) { o->ob_item[0] = (PyObject *) free_list[len]; numfree[len]++; free_list[len] = o; goto done; /* return */ } } Py_TYPE(o)->tp_free((PyObject *)o); done: Py_TRASHCAN_SAFE_END(o) } static int record_traverse(ApgRecordObject *o, visitproc visit, void *arg) { Py_ssize_t i; Py_VISIT(o->desc); for (i = Py_SIZE(o); --i >= 0;) { if (o->ob_item[i] != NULL) { Py_VISIT(o->ob_item[i]); } } return 0; } static Py_ssize_t record_length(ApgRecordObject *o) { return Py_SIZE(o); } static Py_hash_t record_hash(ApgRecordObject *v) { Py_uhash_t x; /* Unsigned for defined overflow behavior. */ Py_hash_t y; Py_ssize_t len; PyObject **p; Py_uhash_t mult; if (v->self_hash != -1) { return v->self_hash; } len = Py_SIZE(v); mult = _PyHASH_MULTIPLIER; x = 0x345678UL; p = v->ob_item; while (--len >= 0) { y = PyObject_Hash(*p++); if (y == -1) { return -1; } x = (x ^ (Py_uhash_t)y) * mult; /* the cast might truncate len; that doesn't change hash stability */ mult += (Py_uhash_t)(82520UL + (size_t)len + (size_t)len); } x += 97531UL; if (x == (Py_uhash_t)-1) { x = (Py_uhash_t)-2; } v->self_hash = (Py_hash_t)x; return (Py_hash_t)x; } 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 comp; if (!ApgRecord_CheckExact(v)) { if (!PyTuple_Check(v)) { Py_RETURN_NOTIMPLEMENTED; } v_is_tuple = 1; } if (!ApgRecord_CheckExact(w)) { if (!PyTuple_Check(w)) { Py_RETURN_NOTIMPLEMENTED; } w_is_tuple = 1; } #define V_ITEM(i) \ (v_is_tuple ? (PyTuple_GET_ITEM(v, i)) : (ApgRecord_GET_ITEM(v, i))) #define W_ITEM(i) \ (w_is_tuple ? (PyTuple_GET_ITEM(w, i)) : (ApgRecord_GET_ITEM(w, i))) vlen = Py_SIZE(v); wlen = Py_SIZE(w); if (op == Py_EQ && vlen != wlen) { /* Checking if v == w, but len(v) != len(w): return False */ Py_RETURN_FALSE; } if (op == Py_NE && vlen != wlen) { /* Checking if v != w, and len(v) != len(w): return True */ Py_RETURN_TRUE; } /* Search for the first index where items are different. * Note that because tuples are immutable, it's safe to reuse * vlen and wlen across the comparison calls. */ for (i = 0; i < vlen && i < wlen; i++) { comp = PyObject_RichCompareBool(V_ITEM(i), W_ITEM(i), Py_EQ); if (comp < 0) { return NULL; } if (!comp) { break; } } if (i >= vlen || i >= wlen) { /* No more items to compare -- compare sizes */ int cmp; switch (op) { case Py_LT: cmp = vlen < wlen; break; case Py_LE: cmp = vlen <= wlen; break; case Py_EQ: cmp = vlen == wlen; break; case Py_NE: cmp = vlen != wlen; break; case Py_GT: cmp = vlen > wlen; break; case Py_GE: cmp = vlen >= wlen; break; default: return NULL; /* cannot happen */ } if (cmp) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } /* We have an item that differs -- shortcuts for EQ/NE */ if (op == Py_EQ) { Py_RETURN_FALSE; } if (op == Py_NE) { Py_RETURN_TRUE; } /* Compare the final item again using the proper operator */ return PyObject_RichCompare(V_ITEM(i), W_ITEM(i), op); #undef V_ITEM #undef W_ITEM } static PyObject * record_item(ApgRecordObject *o, Py_ssize_t i) { if (i < 0 || i >= Py_SIZE(o)) { PyErr_SetString(PyExc_IndexError, "record index out of range"); return NULL; } Py_INCREF(o->ob_item[i]); return o->ob_item[i]; } static PyObject * record_subscript(ApgRecordObject* o, PyObject* item) { if (PyIndex_Check(item)) { Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return NULL; if (i < 0) { i += Py_SIZE(o); } return record_item(o, i); } else if (PySlice_Check(item)) { Py_ssize_t start, stop, step, slicelength, cur, i; PyObject* result; PyObject* it; PyObject **src, **dest; if (PySlice_GetIndicesEx( item, Py_SIZE(o), &start, &stop, &step, &slicelength) < 0) { return NULL; } if (slicelength <= 0) { return PyTuple_New(0); } else { result = PyTuple_New(slicelength); if (!result) return NULL; src = o->ob_item; dest = ((PyTupleObject *)result)->ob_item; for (cur = start, i = 0; i < slicelength; cur += step, i++) { it = src[cur]; Py_INCREF(it); dest[i] = it; } return result; } } else { PyObject *mapped; mapped = PyObject_GetItem(o->desc->mapping, item); if (mapped != NULL) { Py_ssize_t i; PyObject *result; if (!PyIndex_Check(mapped)) { Py_DECREF(mapped); goto noitem; } i = PyNumber_AsSsize_t(mapped, PyExc_IndexError); Py_DECREF(mapped); if (i < 0) { if (PyErr_Occurred()) { PyErr_Clear(); } goto noitem; } result = record_item(o, i); if (result == NULL) { PyErr_Clear(); goto noitem; } return result; } else { goto noitem; } } noitem: _PyErr_SetKeyError(item); return NULL; } static PyObject * record_repr(ApgRecordObject *v) { Py_ssize_t i, n; PyObject *keys_iter; _PyUnicodeWriter writer; n = Py_SIZE(v); if (n == 0) { return PyUnicode_FromString(""); } 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); return i > 0 ? PyUnicode_FromString("") : NULL; } _PyUnicodeWriter_Init(&writer); writer.overallocate = 1; writer.min_length = 12; /* */ if (_PyUnicodeWriter_WriteASCIIString(&writer, " 0) { if (_PyUnicodeWriter_WriteChar(&writer, ' ') < 0) { goto error; } } if (Py_EnterRecursiveCall(" while getting the repr of a record")) { goto error; } val_repr = PyObject_Repr(v->ob_item[i]); Py_LeaveRecursiveCall(); if (val_repr == NULL) { goto error; } key = PyIter_Next(keys_iter); if (key == NULL) { Py_DECREF(val_repr); PyErr_SetString(PyExc_RuntimeError, "invalid record mapping"); goto error; } key_repr = PyObject_Str(key); Py_DECREF(key); if (key_repr == NULL) { Py_DECREF(val_repr); goto error; } if (_PyUnicodeWriter_WriteStr(&writer, key_repr) < 0) { Py_DECREF(key_repr); Py_DECREF(val_repr); goto error; } Py_DECREF(key_repr); if (_PyUnicodeWriter_WriteChar(&writer, '=') < 0) { Py_DECREF(val_repr); goto error; } if (_PyUnicodeWriter_WriteStr(&writer, val_repr) < 0) { Py_DECREF(val_repr); goto error; } Py_DECREF(val_repr); } writer.overallocate = 0; if (_PyUnicodeWriter_WriteChar(&writer, '>') < 0) { goto error; } Py_DECREF(keys_iter); Py_ReprLeave((PyObject *)v); return _PyUnicodeWriter_Finish(&writer); error: Py_DECREF(keys_iter); _PyUnicodeWriter_Dealloc(&writer); Py_ReprLeave((PyObject *)v); return NULL; } static PyObject * record_values(PyObject *o, PyObject *args) { return record_iter(o); } static PyObject * record_keys(PyObject *o, PyObject *args) { if (!ApgRecord_CheckExact(o)) { PyErr_BadInternalCall(); return NULL; } return PyObject_GetIter(((ApgRecordObject*)o)->desc->keys); } static PyObject * record_items(PyObject *o, PyObject *args) { if (!ApgRecord_CheckExact(o)) { PyErr_BadInternalCall(); return NULL; } return record_new_items_iter(o); } static int record_contains(ApgRecordObject *o, PyObject *arg) { if (!ApgRecord_CheckExact(o)) { PyErr_BadInternalCall(); return -1; } return PySequence_Contains(o->desc->mapping, arg); } static PySequenceMethods record_as_sequence = { (lenfunc)record_length, /* sq_length */ 0, /* sq_concat */ 0, /* sq_repeat */ (ssizeargfunc)record_item, /* sq_item */ 0, /* sq_slice */ 0, /* sq_ass_item */ 0, /* sq_ass_slice */ (objobjproc)record_contains, /* sq_contains */ }; static PyMappingMethods record_as_mapping = { (lenfunc)record_length, /* mp_length */ (binaryfunc)record_subscript, /* mp_subscript */ 0 /* mp_ass_subscript */ }; static PyMethodDef record_methods[] = { {"values", (PyCFunction)record_values, METH_NOARGS}, {"keys", (PyCFunction)record_keys, METH_NOARGS}, {"items", (PyCFunction)record_items, METH_NOARGS}, {NULL, NULL} /* sentinel */ }; PyTypeObject ApgRecord_Type = { PyVarObject_HEAD_INIT(NULL, 0) "asyncpg.Record", /* tp_name */ sizeof(ApgRecordObject) - sizeof(PyObject *), /* tp_basic_size */ sizeof(PyObject *), /* tp_itemsize */ (destructor)record_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_reserved */ (reprfunc)record_repr, /* tp_repr */ 0, /* tp_as_number */ &record_as_sequence, /* tp_as_sequence */ &record_as_mapping, /* tp_as_mapping */ (hashfunc)record_hash, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /* tp_flags */ 0, /* tp_doc */ (traverseproc)record_traverse, /* tp_traverse */ 0, /* tp_clear */ record_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ record_iter, /* tp_iter */ 0, /* tp_iternext */ record_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ 0, /* tp_new */ PyObject_GC_Del, /* tp_free */ }; /* Record Iterator */ typedef struct { PyObject_HEAD Py_ssize_t it_index; ApgRecordObject *it_seq; /* Set to NULL when iterator is exhausted */ } ApgRecordIterObject; static void record_iter_dealloc(ApgRecordIterObject *it) { PyObject_GC_UnTrack(it); Py_CLEAR(it->it_seq); PyObject_GC_Del(it); } static int record_iter_traverse(ApgRecordIterObject *it, visitproc visit, void *arg) { Py_VISIT(it->it_seq); return 0; } static PyObject * record_iter_next(ApgRecordIterObject *it) { ApgRecordObject *seq; PyObject *item; assert(it != NULL); seq = it->it_seq; if (seq == NULL) return NULL; assert(ApgRecord_CheckExact(seq)); if (it->it_index < Py_SIZE(seq)) { item = ApgRecord_GET_ITEM(seq, it->it_index); ++it->it_index; Py_INCREF(item); return item; } it->it_seq = NULL; Py_DECREF(seq); return NULL; } static PyObject * record_iter_len(ApgRecordIterObject *it) { Py_ssize_t len = 0; if (it->it_seq) { len = Py_SIZE(it->it_seq) - it->it_index; } return PyLong_FromSsize_t(len); } PyDoc_STRVAR(record_iter_len_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef record_iter_methods[] = { {"__length_hint__", (PyCFunction)record_iter_len, METH_NOARGS, record_iter_len_doc}, {NULL, NULL} /* sentinel */ }; PyTypeObject ApgRecordIter_Type = { PyVarObject_HEAD_INIT(NULL, 0) "RecordIterator", /* tp_name */ sizeof(ApgRecordIterObject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ (destructor)record_iter_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)record_iter_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ PyObject_SelfIter, /* tp_iter */ (iternextfunc)record_iter_next, /* tp_iternext */ record_iter_methods, /* tp_methods */ 0, }; static PyObject * record_iter(PyObject *seq) { ApgRecordIterObject *it; if (!ApgRecord_CheckExact(seq)) { PyErr_BadInternalCall(); return NULL; } it = PyObject_GC_New(ApgRecordIterObject, &ApgRecordIter_Type); if (it == NULL) return NULL; it->it_index = 0; Py_INCREF(seq); it->it_seq = (ApgRecordObject *)seq; PyObject_GC_Track(it); return (PyObject *)it; } /* Record Items Iterator */ typedef struct { PyObject_HEAD Py_ssize_t it_index; PyObject *it_key_iter; ApgRecordObject *it_seq; /* Set to NULL when iterator is exhausted */ } ApgRecordItemsObject; static void record_items_dealloc(ApgRecordItemsObject *it) { PyObject_GC_UnTrack(it); Py_CLEAR(it->it_key_iter); Py_CLEAR(it->it_seq); PyObject_GC_Del(it); } static int record_items_traverse(ApgRecordItemsObject *it, visitproc visit, void *arg) { Py_VISIT(it->it_key_iter); Py_VISIT(it->it_seq); return 0; } static PyObject * record_items_next(ApgRecordItemsObject *it) { ApgRecordObject *seq; PyObject *key; PyObject *val; PyObject *tup; assert(it != NULL); seq = it->it_seq; if (seq == NULL) { return NULL; } assert(ApgRecord_CheckExact(seq)); assert(it->it_key_iter != NULL); key = PyIter_Next(it->it_key_iter); if (key == NULL) { /* likely it_key_iter had less items than seq has values */ goto exhausted; } if (it->it_index < Py_SIZE(seq)) { val = ApgRecord_GET_ITEM(seq, it->it_index); ++it->it_index; Py_INCREF(val); } else { /* it_key_iter had more items than seq has values */ Py_DECREF(key); goto exhausted; } tup = PyTuple_New(2); if (tup == NULL) { Py_DECREF(val); Py_DECREF(key); goto exhausted; } PyTuple_SET_ITEM(tup, 0, key); PyTuple_SET_ITEM(tup, 1, val); return tup; exhausted: Py_CLEAR(it->it_key_iter); Py_CLEAR(it->it_seq); return NULL; } static PyObject * record_items_len(ApgRecordItemsObject *it) { Py_ssize_t len = 0; if (it->it_seq) { len = Py_SIZE(it->it_seq) - it->it_index; } return PyLong_FromSsize_t(len); } PyDoc_STRVAR(record_items_len_doc, "Private method returning an estimate of len(list(it()))."); static PyMethodDef record_items_methods[] = { {"__length_hint__", (PyCFunction)record_items_len, METH_NOARGS, record_items_len_doc}, {NULL, NULL} /* sentinel */ }; PyTypeObject ApgRecordItems_Type = { PyVarObject_HEAD_INIT(NULL, 0) "RecordItemsIterator", /* tp_name */ sizeof(ApgRecordItemsObject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ (destructor)record_items_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)record_items_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ PyObject_SelfIter, /* tp_iter */ (iternextfunc)record_items_next, /* tp_iternext */ record_items_methods, /* tp_methods */ 0, }; static PyObject * record_new_items_iter(PyObject *seq) { ApgRecordItemsObject *it; PyObject *key_iter; if (!ApgRecord_CheckExact(seq)) { PyErr_BadInternalCall(); return NULL; } key_iter = PyObject_GetIter(((ApgRecordObject*)seq)->desc->keys); if (key_iter == NULL) { return NULL; } it = PyObject_GC_New(ApgRecordItemsObject, &ApgRecordItems_Type); if (it == NULL) return NULL; it->it_key_iter = key_iter; it->it_index = 0; Py_INCREF(seq); it->it_seq = (ApgRecordObject *)seq; PyObject_GC_Track(it); return (PyObject *)it; } PyTypeObject * ApgRecord_InitTypes(void) { if (PyType_Ready(&ApgRecord_Type) < 0) { return NULL; } if (PyType_Ready(&ApgRecordDesc_Type) < 0) { return NULL; } if (PyType_Ready(&ApgRecordIter_Type) < 0) { return NULL; } if (PyType_Ready(&ApgRecordItems_Type) < 0) { return NULL; } return &ApgRecord_Type; } /* ----------------- */ static void record_desc_dealloc(ApgRecordDescObject *o) { PyObject_GC_UnTrack(o); Py_CLEAR(o->mapping); Py_CLEAR(o->keys); PyObject_GC_Del(o); } static int record_desc_traverse(ApgRecordDescObject *o, visitproc visit, void *arg) { Py_VISIT(o->mapping); Py_VISIT(o->keys); return 0; } PyTypeObject ApgRecordDesc_Type = { PyVarObject_HEAD_INIT(NULL, 0) "RecordDescriptor", /* tp_name */ sizeof(ApgRecordDescObject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ (destructor)record_desc_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)record_desc_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ PyObject_SelfIter, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ 0, }; PyObject * ApgRecordDesc_New(PyObject *mapping, PyObject *keys) { ApgRecordDescObject *o; if (!mapping || !keys || !PyTuple_CheckExact(keys)) { PyErr_BadInternalCall(); return NULL; } o = PyObject_GC_New(ApgRecordDescObject, &ApgRecordDesc_Type); if (o == NULL) { return NULL; } Py_INCREF(mapping); o->mapping = mapping; Py_INCREF(keys); o->keys = keys; PyObject_GC_Track(o); return (PyObject *) o; } asyncpg-0.13.0/asyncpg/protocol/record/__init__.pxd0000664000372000037200000000075113172407302023142 0ustar travistravis00000000000000# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cimport cpython cdef extern from "record/recordobj.h": cpython.PyTypeObject *ApgRecord_InitTypes() except NULL int ApgRecord_CheckExact(object) object ApgRecord_New(object, int) void ApgRecord_SET_ITEM(object, int, object) object ApgRecordDesc_New(object, object) asyncpg-0.13.0/asyncpg/protocol/record/recordobj.h0000664000372000037200000000243013172407302023004 0ustar travistravis00000000000000#ifndef APG_RECORDOBJ_H #define APG_RECORDOBJ_H #include "Python.h" /* Largest record to save on free list */ #define ApgRecord_MAXSAVESIZE 20 /* Maximum number of records of each size to save */ #define ApgRecord_MAXFREELIST 2000 typedef struct { PyObject_HEAD PyObject *mapping; PyObject *keys; } ApgRecordDescObject; typedef struct { PyObject_VAR_HEAD Py_hash_t self_hash; ApgRecordDescObject *desc; PyObject *ob_item[1]; /* ob_item contains space for 'ob_size' elements. * Items must normally not be NULL, except during construction when * the record is not yet visible outside the function that builds it. */ } ApgRecordObject; extern PyTypeObject ApgRecord_Type; extern PyTypeObject ApgRecordIter_Type; extern PyTypeObject ApgRecordItems_Type; extern PyTypeObject ApgRecordDesc_Type; #define ApgRecord_CheckExact(o) (Py_TYPE(o) == &ApgRecord_Type) #define ApgRecordDesc_CheckExact(o) (Py_TYPE(o) == &ApgRecordDesc_Type) #define ApgRecord_SET_ITEM(op, i, v) \ (((ApgRecordObject *)(op))->ob_item[i] = v) #define ApgRecord_GET_ITEM(op, i) \ (((ApgRecordObject *)(op))->ob_item[i]) PyTypeObject *ApgRecord_InitTypes(void); PyObject *ApgRecord_New(PyObject *, Py_ssize_t); PyObject *ApgRecordDesc_New(PyObject *, PyObject *); #endif asyncpg-0.13.0/asyncpg/protocol/prepared_stmt.pxd0000664000372000037200000000177713172407302023007 0ustar travistravis00000000000000# 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 int refs FastReadBuffer buffer list row_desc list parameters_desc BaseProtocol protocol 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) 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) asyncpg-0.13.0/asyncpg/protocol/hton.pxd0000664000372000037200000000405313172407302021074 0ustar travistravis00000000000000# 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 IF UNAME_SYSNAME == "Windows": cdef extern from "winsock2.h": uint32_t htonl(uint32_t hostlong) uint16_t htons(uint16_t hostshort) uint32_t ntohl(uint32_t netlong) uint16_t ntohs(uint16_t netshort) ELSE: cdef extern from "arpa/inet.h": uint32_t htonl(uint32_t hostlong) uint16_t htons(uint16_t hostshort) uint32_t ntohl(uint32_t netlong) uint16_t ntohs(uint16_t netshort) cdef inline void pack_int16(char* buf, int16_t x): (buf)[0] = htons(x) cdef inline int16_t unpack_int16(const char* buf): return ntohs((buf)[0]) cdef inline void pack_int32(char* buf, int32_t x): (buf)[0] = htonl(x) cdef inline int32_t unpack_int32(const char* buf): return ntohl((buf)[0]) cdef inline void pack_int64(char* buf, int64_t x): (buf)[0] = htonl(((x) >> 32)) (&buf[4])[0] = htonl((x)) cdef inline int64_t unpack_int64(const char* buf): cdef int64_t hh = unpack_int32(buf) cdef uint32_t hl = unpack_int32(&buf[4]) return (hh << 32) | hl cdef union _floatconv: uint32_t i float f cdef inline int32_t pack_float(char* buf, float f): cdef _floatconv v v.f = f pack_int32(buf, v.i) cdef inline float unpack_float(const char* buf): cdef _floatconv v v.i = unpack_int32(buf) return v.f cdef union _doubleconv: uint64_t i double f cdef inline int64_t pack_double(char* buf, double f): cdef _doubleconv v v.f = f pack_int64(buf, v.i) cdef inline double unpack_double(const char* buf): cdef _doubleconv v v.i = unpack_int64(buf) return v.f asyncpg-0.13.0/asyncpg/protocol/buffer.pxd0000664000372000037200000000751213172407302021400 0ustar travistravis00000000000000# 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 Memory: cdef: const char *buf object owner ssize_t length cdef as_bytes(self) @staticmethod cdef inline Memory new(const char *buf, object owner, ssize_t length) 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 _check_readonly(self) cdef inline len(self) cdef inline _ensure_alloced(self, ssize_t extra_length) cdef _reallocate(self, ssize_t new_size) 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_bytestring(self, bytes string) cdef write_str(self, str string, str encoding) 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() 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 int _current_message_len ssize_t _current_message_len_unread bint _current_message_ready cdef feed_data(self, data) cdef inline _ensure_first_buf(self) cdef _switch_to_next_buf(self) cdef inline read_byte(self) cdef inline const char* _try_read_bytes(self, ssize_t nbytes) cdef inline _read(self, char *buf, ssize_t nbytes) cdef read(self, ssize_t nbytes) cdef inline const char* read_bytes(self, ssize_t n) except NULL cdef inline read_int32(self) cdef inline read_int16(self) cdef inline read_cstr(self) cdef int32_t has_message(self) except -1 cdef inline int32_t has_message_type(self, char mtype) except -1 cdef inline const char* try_consume_message(self, ssize_t* len) cdef Memory consume_message(self) cdef bytearray consume_messages(self, char mtype) cdef discard_message(self) cdef inline _discard_message(self) cdef inline char get_message_type(self) cdef inline int32_t get_message_length(self) @staticmethod cdef ReadBuffer new_message_parser(object data) cdef class FastReadBuffer: cdef: const char* buf ssize_t len cdef inline const char* read(self, ssize_t n) except NULL cdef inline const char* read_all(self) cdef inline FastReadBuffer slice_from(self, FastReadBuffer source, ssize_t len) cdef _raise_ins_err(self, ssize_t n, ssize_t len) @staticmethod cdef FastReadBuffer new() asyncpg-0.13.0/asyncpg/protocol/buffer.pyx0000664000372000037200000004615413172407302021432 0ustar travistravis00000000000000# 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 from libc.string cimport memcpy class BufferError(Exception): pass @cython.no_gc_clear @cython.final @cython.freelist(_MEMORY_FREELIST_SIZE) cdef class Memory: cdef as_bytes(self): return cpython.PyBytes_FromStringAndSize(self.buf, self.length) @staticmethod cdef inline Memory new(const char* buf, object owner, ssize_t length): cdef Memory mem mem = Memory.__new__(Memory) mem.buf = buf mem.owner = owner mem.length = length return mem @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: PyMem_Free(self._buf) self._buf = NULL self._size = 0 if self._view_count: raise RuntimeError( 'Deallocating buffer with attached memoryviews') def __getbuffer__(self, Py_buffer *buffer, int flags): self._view_count += 1 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 len(self): return self._length 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 = 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 = PyMem_Realloc(self._buf, new_size) if new_buf is NULL: 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 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_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): raise BufferError('feed_data: bytes object expected') 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 self._len0 == 0: raise BufferError('empty first 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 ASYNCPG_DEBUG: if self._len0 < 1: raise RuntimeError( '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 ASYNCPG_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(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 read(self, ssize_t nbytes): cdef: bytearray result ssize_t nread const char *cbuf char *buf self._ensure_first_buf() cbuf = self._try_read_bytes(nbytes) if cbuf != NULL: return Memory.new(cbuf, self._buf0, 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 = PyByteArray_FromStringAndSize(NULL, nbytes) buf = PyByteArray_AsString(result) self._read(buf, nbytes) return Memory.new(buf, result, nbytes) cdef inline read_byte(self): cdef const char *first_byte if ASYNCPG_DEBUG: if not self._buf0: raise RuntimeError( '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 const char* read_bytes(self, ssize_t n) except NULL: cdef: Memory mem const char *cbuf self._ensure_first_buf() cbuf = self._try_read_bytes(n) if cbuf != NULL: return cbuf else: mem = (self.read(n)) return mem.buf cdef inline read_int32(self): cdef: Memory 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(4)) return hton.unpack_int32(mem.buf) cdef inline read_int16(self): cdef: Memory 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(2)) return hton.unpack_int16(mem.buf) cdef inline read_cstr(self): if not self._current_message_ready: raise BufferError( 'read_cstr 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_cstr: 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_cstr: buffer overread') self._ensure_first_buf() cdef int32_t has_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 has_message_type(self, char mtype) except -1: return self.has_message() and self.get_message_type() == mtype 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._discard_message() return buf cdef Memory 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(self._current_message_len_unread) else: mem = None self._discard_message() return mem 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.has_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 = PyByteArray_FromStringAndSize(NULL, self._length) buf = PyByteArray_AsString(result) while self.has_message_type(mtype): nbytes = self._current_message_len_unread self._read(buf, nbytes) buf += nbytes total_bytes += nbytes self._discard_message() # Clamp the result to an actual size read. PyByteArray_Resize(result, total_bytes) return result cdef discard_message(self): if self._current_message_type == 0: # Already discarded return if not self._current_message_ready: raise BufferError('no message to discard') if self._current_message_len_unread: if ASYNCPG_DEBUG: mtype = chr(self._current_message_type) discarded = self.consume_message() if ASYNCPG_DEBUG: print('!!! discarding message {!r} unread data: {!r}'.format( mtype, (discarded).as_bytes())) self._discard_message() cdef inline _discard_message(self): self._current_message_type = 0 self._current_message_len = 0 self._current_message_ready = 0 self._current_message_len_unread = 0 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 @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 @cython.no_gc_clear @cython.final @cython.freelist(_BUFFER_FREELIST_SIZE) cdef class FastReadBuffer: cdef inline const char* read(self, ssize_t n) except NULL: cdef const char *result if n > self.len: self._raise_ins_err(n, self.len) result = self.buf self.buf += n self.len -= n return result cdef inline const char* read_all(self): cdef const char *result result = self.buf self.buf += self.len self.len = 0 return result cdef inline FastReadBuffer slice_from(self, FastReadBuffer source, ssize_t len): self.buf = source.read(len) self.len = len return self cdef _raise_ins_err(self, ssize_t n, ssize_t len): raise BufferError( 'insufficient data in buffer: requested {}, remaining {}'. format(n, self.len)) @staticmethod cdef FastReadBuffer new(): return FastReadBuffer.__new__(FastReadBuffer) asyncpg-0.13.0/asyncpg/protocol/pgtypes.pxi0000664000372000037200000001100213172407302021614 0ustar travistravis00000000000000# 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 = 4096 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 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 REGNAMESPACEOID = 4089 DEF REGROLEOID = 4096 cdef ARRAY_TYPES = (_TEXTOID, _OIDOID,) TYPEMAP = { ABSTIMEOID: 'abstime', ACLITEMOID: 'aclitem', ANYARRAYOID: 'anyarray', ANYELEMENTOID: 'anyelement', ANYENUMOID: 'anyenum', 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', 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_DDL_COMMANDOID: 'pg_ddl_command', PG_DEPENDENCIESOID: 'pg_dependencies', PG_LSNOID: 'pg_lsn', PG_NDISTINCTOID: 'pg_ndistinct', PG_NODE_TREEOID: 'pg_node_tree', POINTOID: 'point', POLYGONOID: 'polygon', RECORDOID: 'record', REFCURSOROID: 'refcursor', REGCLASSOID: 'regclass', REGCONFIGOID: 'regconfig', REGDICTIONARYOID: 'regdictionary', REGNAMESPACEOID: 'regnamespace', REGOPERATOROID: 'regoperator', REGOPEROID: 'regoper', REGPROCEDUREOID: 'regprocedure', REGPROCOID: 'regproc', REGROLEOID: 'regrole', REGTYPEOID: 'regtype', RELTIMEOID: 'reltime', SMGROID: 'smgr', 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', XIDOID: 'xid', XMLOID: 'xml', _OIDOID: 'oid[]', _TEXTOID: 'text[]'} asyncpg-0.13.0/asyncpg/protocol/coreproto.pyx0000664000372000037200000007142513172407302022174 0ustar travistravis00000000000000# 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 hashlib import md5 as hashlib_md5 # for MD5 authentication cdef class CoreProtocol: def __init__(self, con_params): # 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.transport = None self.con_status = CONNECTION_BAD self.state = PROTOCOL_IDLE self.xact_status = PQTRANS_IDLE self.encoding = 'utf-8' self._skip_discard = False # executemany support data self._execute_iter = None self._execute_portal_name = None self._execute_stmt_name = None self._reset_result() cdef _write(self, buf): self.transport.write(memoryview(buf)) cdef inline _write_sync_message(self): self.transport.write(SYNC_MESSAGE) cdef _read_server_messages(self): cdef: char mtype ProtocolState state while self.buffer.has_message() == 1: mtype = self.buffer.get_message_type() state = self.state try: if mtype == b'S': # ParameterStatus self._parse_msg_parameter_status() continue elif mtype == b'A': # NotificationResponse self._parse_msg_notification() continue elif mtype == b'N': # 'N' - NoticeResponse self._on_notice(self._parse_msg_error_response(False)) continue if 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.consume_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 = RuntimeError( 'unknown error in protocol implementation') self._push_result() else: self.buffer.consume_message() else: raise apg_exc.InternalClientError( 'protocol is in an unknown state {}'.format(state)) 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: if self._skip_discard: self._skip_discard = False else: self.buffer.discard_message() cdef _process__auth(self, char mtype): if mtype == b'R': # Authentication... self._parse_msg_authentication() if self.result_type != RESULT_OK: self.con_status = CONNECTION_BAD self._push_result() self.transport.close() 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().as_bytes() elif mtype == b'1': # ParseComplete self.buffer.consume_message() elif mtype == b'T': # Row description self.result_row_desc = self.buffer.consume_message().as_bytes() 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'n': # NoData self.buffer.consume_message() cdef _process__bind_execute(self, char mtype): if mtype == b'D': # DataRow self._parse_data_msgs() elif mtype == b's': # PortalSuspended self.buffer.consume_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'2': # BindComplete self.buffer.consume_message() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self._push_result() elif mtype == b'I': # EmptyQueryResponse self.buffer.consume_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.consume_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'2': # BindComplete self.buffer.consume_message() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() if self.result_type == RESULT_FAILED: self._push_result() else: try: buf = next(self._execute_iter) except StopIteration: self._push_result() except Exception as e: self.result_type = RESULT_FAILED self.result = e self._push_result() else: # Next iteration over the executemany() arg sequence self._send_bind_message( self._execute_portal_name, self._execute_stmt_name, buf, 0) elif mtype == b'I': # EmptyQueryResponse self.buffer.consume_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.consume_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.consume_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.consume_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.consume_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.consume_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.consume_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.consume_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_cstr() self.result_status_msg = msg cdef _parse_copy_data_msgs(self): cdef: ReadBuffer buf = self.buffer self.result = buf.consume_messages(b'd') self._skip_discard = True # 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.has_message(): self._on_result() self.result = None cdef _write_copy_data_msg(self, object data): cdef: WriteBuffer buf object mview Py_buffer *pybuf mview = PyMemoryView_GetContiguous(data, cpython.PyBUF_SIMPLE, b'C') try: pybuf = 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 const char* cbuf ssize_t cbuf_len object row Memory mem if ASYNCPG_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 True: buf.consume_message() if not buf.has_message() or buf.get_message_type() != b'D': self._skip_discard = True return if ASYNCPG_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 True: cbuf = buf.try_consume_message(&cbuf_len) if cbuf != NULL: row = decoder(self, cbuf, cbuf_len) else: mem = buf.consume_message() row = decoder(self, mem.buf, mem.length) cpython.PyList_Append(rows, row) if not buf.has_message() or buf.get_message_type() != b'D': self._skip_discard = True return 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_cstr() name = name.decode(self.encoding) val = self.buffer.read_cstr() 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_cstr().decode(self.encoding) payload = self.buffer.read_cstr().decode(self.encoding) self._on_notification(pid, channel, payload) cdef _parse_msg_authentication(self): cdef: int32_t status bytes md5_salt 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 = cpython.PyBytes_FromStringAndSize( self.buffer.read_bytes(4), 4) self.auth_msg = self._auth_password_message_md5(md5_salt) elif status in (AUTH_REQUIRED_KERBEROS, AUTH_REQUIRED_SCMCRED, AUTH_REQUIRED_GSS, AUTH_REQUIRED_GSS_CONTINUE, AUTH_REQUIRED_SSPI): self.result_type = RESULT_FAILED self.result = apg_exc.InterfaceError( 'unsupported authentication method requested by the ' 'server: {!r}'.format(AUTH_METHOD_NAME[status])) else: self.result_type = RESULT_FAILED self.result = apg_exc.InterfaceError( 'unsupported authentication method requested by the ' 'server: {}'.format(status)) self.buffer.consume_message() cdef _auth_password_message_cleartext(self): cdef: WriteBuffer msg msg = WriteBuffer.new_message(b'p') msg.write_bytestring(self.password.encode('ascii')) 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 '')).encode('ascii') hash = hashlib_md5(hashlib_md5(userpass).hexdigest().\ encode('ascii') + salt).hexdigest().encode('ascii') msg.write_bytestring(b'md5' + hash) 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_cstr() 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 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: raise apg_exc.InternalClientError( 'protocol is already in the "idle" state') else: self.state = new_state elif new_state == PROTOCOL_FAILED: self.state = PROTOCOL_FAILED elif new_state == PROTOCOL_CANCELLED: self.state = PROTOCOL_CANCELLED 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_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 # 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 _prepare(self, str stmt_name, str query): cdef: WriteBuffer packet WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_PREPARE) packet = WriteBuffer.new() 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() packet.write_buffer(buf) 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(SYNC_MESSAGE) self.transport.write(memoryview(packet)) cdef _send_bind_message(self, str portal_name, str stmt_name, WriteBuffer bind_data, int32_t limit): cdef WriteBuffer buf buf = self._build_bind_message(portal_name, stmt_name, bind_data) self._write(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() self._write(buf) self._write_sync_message() 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 _bind_execute_many(self, str portal_name, str stmt_name, object bind_data): cdef WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_BIND_EXECUTE_MANY) self.result = None self._discard_data = True self._execute_iter = bind_data self._execute_portal_name = portal_name self._execute_stmt_name = stmt_name try: buf = next(bind_data) except StopIteration: self._push_result() except Exception as e: self.result_type = RESULT_FAILED self.result = e self._push_result() else: self._send_bind_message(portal_name, stmt_name, buf, 0) cdef _execute(self, str portal_name, int32_t limit): cdef WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_EXECUTE) self.result = [] 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() self._write(buf) self._write_sync_message() 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) self._write(buf) self._write_sync_message() 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() self._write(buf) self._write_sync_message() 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() buf = WriteBuffer.new_message(b'X') buf.end_message() self._write(buf) 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 # 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) cdef bytes SYNC_MESSAGE = bytes(WriteBuffer.new_message(b'S').end_message()) asyncpg-0.13.0/asyncpg/protocol/__init__.py0000664000372000037200000000042213172407302021514 0ustar travistravis00000000000000# 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 .protocol import Protocol, Record, NO_TIMEOUT # NOQA asyncpg-0.13.0/asyncpg/protocol/encodings.pyx0000664000372000037200000000315413172407302022123 0ustar travistravis00000000000000# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 '''Map PostgreSQL encoding names to Python encoding names https://www.postgresql.org/docs/current/static/multibyte.html#CHARSET-TABLE ''' cdef dict ENCODINGS_MAP = { 'abc': 'cp1258', 'alt': 'cp866', 'euc_cn': 'euccn', 'euc_jp': 'eucjp', 'euc_kr': 'euckr', 'koi8r': 'koi8_r', 'koi8u': 'koi8_u', 'shift_jis_2004': 'euc_jis_2004', 'sjis': 'shift_jis', 'sql_ascii': 'ascii', 'vscii': 'cp1258', 'tcvn': 'cp1258', 'tcvn5712': 'cp1258', 'unicode': 'utf_8', 'win': 'cp1521', 'win1250': 'cp1250', 'win1251': 'cp1251', 'win1252': 'cp1252', 'win1253': 'cp1253', 'win1254': 'cp1254', 'win1255': 'cp1255', 'win1256': 'cp1256', 'win1257': 'cp1257', 'win1258': 'cp1258', 'win866': 'cp866', 'win874': 'cp874', 'win932': 'cp932', 'win936': 'cp936', 'win949': 'cp949', 'win950': 'cp950', 'windows1250': 'cp1250', 'windows1251': 'cp1251', 'windows1252': 'cp1252', 'windows1253': 'cp1253', 'windows1254': 'cp1254', 'windows1255': 'cp1255', 'windows1256': 'cp1256', 'windows1257': 'cp1257', 'windows1258': 'cp1258', 'windows866': 'cp866', 'windows874': 'cp874', 'windows932': 'cp932', 'windows936': 'cp936', 'windows949': 'cp949', 'windows950': 'cp950', } cdef get_python_encoding(pg_encoding): return ENCODINGS_MAP.get(pg_encoding.lower(), pg_encoding.lower()) asyncpg-0.13.0/asyncpg/protocol/debug.h0000664000372000037200000000006513172407302020645 0ustar travistravis00000000000000#ifndef ASYNCPG_DEBUG #define ASYNCPG_DEBUG 0 #endif asyncpg-0.13.0/asyncpg/protocol/python.pxd0000664000372000037200000000224413172407302021445 0ustar travistravis00000000000000# 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": void* PyMem_Malloc(size_t n) void* PyMem_Realloc(void *p, size_t n) void* PyMem_Calloc(size_t nelem, size_t elsize) # Python >= 3.5! void PyMem_Free(void *p) int PyByteArray_Check(object) ssize_t PyByteArray_Size(object) int PyByteArray_Resize(object, ssize_t) object PyByteArray_FromStringAndSize(const char *, ssize_t) int PyMemoryView_Check(object) Py_buffer *PyMemoryView_GET_BUFFER(object) object PyMemoryView_FromMemory(char *mem, ssize_t size, int flags) object PyMemoryView_GetContiguous(object, int buffertype, char order) object PyUnicode_FromString(const char *u) char* PyUnicode_AsUTF8AndSize(object unicode, ssize_t *size) except NULL char* PyByteArray_AsString(object) Py_UCS4* PyUnicode_AsUCS4Copy(object) object PyUnicode_FromKindAndData( int kind, const void *buffer, Py_ssize_t size) int PyUnicode_4BYTE_KIND asyncpg-0.13.0/asyncpg/protocol/protocol.pyx0000664000372000037200000006606213172407302022022 0ustar travistravis00000000000000# 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 import socket import time from libc.stdint cimport int8_t, uint8_t, int16_t, uint16_t, \ int32_t, uint32_t, int64_t, uint64_t from asyncpg.protocol cimport record from asyncpg.protocol.python cimport ( PyMem_Malloc, PyMem_Realloc, PyMem_Calloc, PyMem_Free, PyMemoryView_GET_BUFFER, PyMemoryView_Check, PyMemoryView_FromMemory, PyMemoryView_GetContiguous, PyUnicode_AsUTF8AndSize, PyByteArray_AsString, PyByteArray_Check, PyUnicode_AsUCS4Copy, PyByteArray_Size, PyByteArray_Resize, PyByteArray_FromStringAndSize, PyUnicode_FromKindAndData, PyUnicode_4BYTE_KIND) from cpython cimport PyBuffer_FillInfo, PyBytes_AsString 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.protocol cimport hton include "consts.pxi" include "pgtypes.pxi" include "encodings.pyx" include "settings.pyx" include "buffer.pyx" include "codecs/base.pyx" include "codecs/textutils.pyx" # String types. Need to go first, as other codecs may rely on # text decoding/encoding. include "codecs/bytea.pyx" include "codecs/text.pyx" # Builtin types, in lexicographical order. include "codecs/bits.pyx" include "codecs/datetime.pyx" include "codecs/float.pyx" include "codecs/geometry.pyx" include "codecs/int.pyx" include "codecs/json.pyx" include "codecs/money.pyx" include "codecs/network.pyx" include "codecs/numeric.pyx" include "codecs/tsearch.pyx" include "codecs/txid.pyx" include "codecs/uuid.pyx" # Various pseudotypes and system types include "codecs/misc.pyx" # nonscalar include "codecs/array.pyx" include "codecs/range.pyx" include "codecs/record.pyx" # contrib include "codecs/hstore.pyx" include "coreproto.pyx" include "prepared_stmt.pyx" NO_TIMEOUT = object() cdef class BaseProtocol(CoreProtocol): def __init__(self, addr, connected_fut, con_params, loop): # type of `con_params` is `_ConnectionParameters` CoreProtocol.__init__(self, con_params) self.loop = loop self.waiter = connected_fut self.cancel_waiter = None self.cancel_sent_waiter = None self.address = addr self.settings = ConnectionSettings((self.address, con_params.database)) self.statement = None self.return_extra = False self.last_query = None self.closing = False self.is_reading = True self.writing_allowed = asyncio.Event(loop=self.loop) self.writing_allowed.set() self.timeout_handle = None self.timeout_callback = self._on_timeout self.completed_callback = self._on_waiter_completed self.queries_count = 0 try: self.create_future = loop.create_future except AttributeError: self.create_future = self._create_future_fallback def set_connection(self, connection): self.connection = connection def get_server_pid(self): return self.backend_pid def get_settings(self): return self.settings def 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 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): 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(stmt_name, query) # network op self.last_query = query self.statement = PreparedStatementState(stmt_name, query, self) except Exception as ex: waiter.set_exception(ex) self._coreproto_error() finally: return await waiter async def bind_execute(self, PreparedStatementState state, args, 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) args_buf = state._encode_bind_msg(args) waiter = self._new_waiter(timeout) try: 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, 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) # 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) for b in args) arg_bufs = iter(data_gen) waiter = self._new_waiter(timeout) try: self._bind_execute_many( portal_name, state.name, arg_bufs) # network op self.last_query = state.query self.statement = state self.return_extra = False self.queries_count += 1 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 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 asyncio.wait_for( sink(buffer), timeout=timer.get_remaining_budget(), loop=self.loop) except Exception as ex: # Abort the COPY operation on any error in # output sink. self._request_cancel() 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)) 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 asyncio.wait_for( iterator.__anext__(), timeout=timer.get_remaining_budget(), loop=self.loop) 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 as e: self._write_copy_fail_msg(str(e)) self._request_cancel() 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() async def close(self): 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._handle_waiter_on_connection_lost(None) assert self.waiter is None if self.closing: return self._terminate() self.waiter = self.create_future() self.closing = True self.transport.abort() return await self.waiter def _request_cancel(self): self.cancel_waiter = self.create_future() self.cancel_sent_waiter = self.create_future() self.connection._cancel_current_command(self.cancel_sent_waiter) 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 fut is not self.waiter or self.cancel_waiter is not None: return if fut.cancelled(): if self.timeout_handle: self.timeout_handle.cancel() self.timeout_handle = None 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.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') 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.connection._loop.call_later( timeout, self.timeout_callback, self.waiter) self.waiter.add_done_callback(self.completed_callback) return self.waiter cdef _on_result__connect(self, object waiter): waiter.set_result(True) cdef _on_result__prepare(self, object waiter): if ASYNCPG_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 ASYNCPG_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 ASYNCPG_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) 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 operation. # Simply ignore the result. self.cancel_waiter.set_result(None) self.cancel_waiter = None self.waiter = None return try: self._dispatch_result() finally: self.statement = None self.last_query = None self.return_extra = False cdef _on_notice(self, parsed): self.connection._process_log_message(parsed, self.last_query) cdef _on_notification(self, pid, channel, payload): self.connection._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 self._handle_waiter_on_connection_lost(exc) def pause_writing(self): self.writing_allowed.clear() def resume_writing(self): self.writing_allowed.set() 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 class Protocol(BaseProtocol, asyncio.Protocol): pass def _create_record(object mapping, tuple elems): # Exposed only for testing purposes. cdef: object rec int32_t i if mapping is None: desc = record.ApgRecordDesc_New({}, ()) else: desc = record.ApgRecordDesc_New( mapping, tuple(mapping) if mapping else ()) rec = record.ApgRecord_New(desc, len(elems)) for i in range(len(elems)): elem = elems[i] cpython.Py_INCREF(elem) record.ApgRecord_SET_ITEM(rec, i, elem) return rec Record = record.ApgRecord_InitTypes() asyncpg-0.13.0/asyncpg/cursor.py0000664000372000037200000001755613172407302017451 0ustar travistravis00000000000000# 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 compat 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') def __init__(self, connection, query, state, args, prefetch, timeout): super().__init__(connection) self._args = args self._prefetch = prefetch self._query = query self._timeout = timeout self._state = state if state is not None: state.attach() @compat.aiter_compat @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, 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) 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') def __init__(self, connection, query, state, args): 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 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 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, prefetch, timeout): super().__init__(connection, query, state, args) if prefetch <= 0: raise exceptions.InterfaceError( 'prefetch argument must be greater than zero') self._buffer = collections.deque() self._prefetch = prefetch self._timeout = timeout @compat.aiter_compat @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) self._state.attach() if not self._portal_name: 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._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) 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 asyncpg-0.13.0/setup.py0000664000372000037200000001624313172407302015620 0ustar travistravis00000000000000# 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 os.path import platform import re import sys import setuptools from setuptools.command import build_ext as _build_ext if sys.version_info < (3, 5): raise RuntimeError('asyncpg requires Python 3.5 or greater') CFLAGS = ['-O2'] LDFLAGS = [] if platform.uname().system == 'Windows': LDFLAGS.append('ws2_32.lib') else: CFLAGS.extend(['-Wall', '-Wsign-compare', '-Wconversion']) class build_ext(_build_ext.build_ext): user_options = _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, 'Cythion 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() self.cython_always = False self.cython_annotate = None self.cython_directives = None def finalize_options(self): # finalize_options() may be called multiple times on the # same command object, so make sure not to override previously # set options. if getattr(self, '_initialized', False): return 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: try: import Cython except ImportError: raise RuntimeError( 'please install Cython to compile asyncpg from source') if Cython.__version__ < '0.24': raise RuntimeError( 'asyncpg requires Cython version 0.24 or greater') from Cython.Build import cythonize directives = {} 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) for cfile, timestamp in cfiles.items(): if os.path.getmtime(cfile) != timestamp: # The file was recompiled, patch self._patch_cfile(cfile) super(build_ext, self).finalize_options() def _patch_cfile(self, cfile): # Script to patch Cython 'async def' coroutines to have a 'tp_iter' # slot, which makes them compatible with 'yield from' without the # `asyncio.coroutine` decorator. with open(cfile, 'rt') as f: src = f.read() src = re.sub( r''' \s* offsetof\(__pyx_CoroutineObject,\s*gi_weakreflist\), \s* 0, \s* 0, \s* __pyx_Coroutine_methods, \s* __pyx_Coroutine_memberlist, \s* __pyx_Coroutine_getsets, ''', r''' offsetof(__pyx_CoroutineObject, gi_weakreflist), __Pyx_Coroutine_await, /* tp_iter */ (iternextfunc) __Pyx_Generator_Next, /* tp_iternext */ __pyx_Coroutine_methods, __pyx_Coroutine_memberlist, __pyx_Coroutine_getsets, ''', src, flags=re.X) # Fix a segfault in Cython. src = re.sub( r''' \s* __Pyx_Coroutine_get_qualname\(__pyx_CoroutineObject\s+\*self\) \s* { \s* Py_INCREF\(self->gi_qualname\); ''', r''' __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self) { if (self->gi_qualname == NULL) { return __pyx_empty_unicode; } Py_INCREF(self->gi_qualname); ''', src, flags=re.X) src = re.sub( r''' \s* __Pyx_Coroutine_get_name\(__pyx_CoroutineObject\s+\*self\) \s* { \s* Py_INCREF\(self->gi_name\); ''', r''' __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self) { if (self->gi_name == NULL) { return __pyx_empty_unicode; } Py_INCREF(self->gi_name); ''', src, flags=re.X) with open(cfile, 'wt') as f: f.write(src) with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f: readme = f.read() with open(os.path.join( os.path.dirname(__file__), 'asyncpg', '__init__.py')) as f: for line in f: if line.startswith('__version__ ='): _, _, version = line.partition('=') VERSION = version.strip(" \n'\"") break else: raise RuntimeError( 'unable to read the version from asyncpg/__init__.py') setuptools.setup( name='asyncpg', version=VERSION, description='An asyncio PosgtreSQL driver', long_description=readme, classifiers=[ 'License :: OSI Approved :: Apache Software License', 'Intended Audience :: Developers', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Operating System :: POSIX', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Development Status :: 5 - Production/Stable', ], platforms=['POSIX'], author='MagicStack Inc', author_email='hello@magic.io', url='https://github.com/MagicStack/asyncpg', license='Apache License, Version 2.0', packages=['asyncpg'], provides=['asyncpg'], include_package_data=True, ext_modules=[ setuptools.Extension( "asyncpg.protocol.protocol", ["asyncpg/protocol/record/recordobj.c", "asyncpg/protocol/protocol.pyx"], extra_compile_args=CFLAGS, extra_link_args=LDFLAGS) ], cmdclass={'build_ext': build_ext}, test_suite='tests.suite', ) asyncpg-0.13.0/Makefile0000664000372000037200000000152113172407302015537 0ustar travistravis00000000000000.PHONY: compile debug test quicktest clean all PYTHON ?= python all: compile clean: rm -fr dist/ doc/_build/ 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: $(PYTHON) setup.py build_ext --inplace --cython-always debug: $(PYTHON) setup.py build_ext --inplace --debug \ --cython-always \ --cython-annotate \ --cython-directives="linetrace=True" \ --define ASYNCPG_DEBUG,CYTHON_TRACE,CYTHON_TRACE_NOGIL test: PYTHONASYNCIODEBUG=1 $(PYTHON) setup.py test $(PYTHON) setup.py test USE_UVLOOP=1 $(PYTHON) setup.py test testinstalled: $(PYTHON) tests/__init__.py USE_UVLOOP=1 $(PYTHON) tests/__init__.py quicktest: $(PYTHON) setup.py test htmldocs: compile $(MAKE) -C docs html asyncpg-0.13.0/PKG-INFO0000664000372000037200000000777513172407445015225 0ustar travistravis00000000000000Metadata-Version: 1.1 Name: asyncpg Version: 0.13.0 Summary: An asyncio PosgtreSQL driver Home-page: https://github.com/MagicStack/asyncpg Author: MagicStack Inc Author-email: hello@magic.io License: Apache License, Version 2.0 Description-Content-Type: UNKNOWN Description: asyncpg -- A fast PostgreSQL Database Client Library for Python/asyncio ======================================================================= .. image:: https://travis-ci.org/MagicStack/asyncpg.svg?branch=master :target: https://travis-ci.org/MagicStack/asyncpg .. image:: https://ci.appveyor.com/api/projects/status/9rwppnxphgc8bqoj/branch/master?svg=true :target: https://ci.appveyor.com/project/magicstack/asyncpg .. 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.5 or later and is supported for PostgreSQL versions 9.2 to 10. Documentation ------------- The project documentation can be found `here `_. Performance ----------- In our testing asyncpg is, on average, **3x** faster than psycopg2 (and its asyncio variant -- aiopg). .. image:: performance.png :target: http://magic.io/blog/asyncpg-1m-rows-from-postgres-to-python/ The above results are a geometric mean of benchmarks obtained with PostgreSQL `client driver benchmarking toolbench `_. 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 and has no dependencies. Use pip to install:: $ pip install asyncpg 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''') await conn.close() loop = asyncio.get_event_loop() loop.run_until_complete(run()) License ------- asyncpg is developed and distributed under the Apache 2.0 license. Platform: POSIX Classifier: License :: OSI Approved :: Apache Software License Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Operating System :: POSIX Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Microsoft :: Windows Classifier: Development Status :: 5 - Production/Stable Provides: asyncpg asyncpg-0.13.0/asyncpg.egg-info/0000775000372000037200000000000013172407445017246 5ustar travistravis00000000000000asyncpg-0.13.0/asyncpg.egg-info/SOURCES.txt0000664000372000037200000000514413172407445021136 0ustar travistravis00000000000000LICENSE MANIFEST.in Makefile README.rst performance.png setup.py asyncpg/__init__.py asyncpg/_testbase.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/top_level.txt asyncpg/exceptions/__init__.py asyncpg/exceptions/_base.py asyncpg/protocol/__init__.py asyncpg/protocol/buffer.pxd asyncpg/protocol/buffer.pyx asyncpg/protocol/consts.pxi asyncpg/protocol/coreproto.pxd asyncpg/protocol/coreproto.pyx asyncpg/protocol/debug.h asyncpg/protocol/debug.pxd asyncpg/protocol/encodings.pyx asyncpg/protocol/hton.pxd 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.pyx asyncpg/protocol/python.pxd 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/bits.pyx asyncpg/protocol/codecs/bytea.pyx asyncpg/protocol/codecs/datetime.pyx asyncpg/protocol/codecs/float.pyx asyncpg/protocol/codecs/geometry.pyx asyncpg/protocol/codecs/hstore.pyx asyncpg/protocol/codecs/int.pyx asyncpg/protocol/codecs/json.pyx asyncpg/protocol/codecs/misc.pyx asyncpg/protocol/codecs/money.pyx asyncpg/protocol/codecs/network.pyx asyncpg/protocol/codecs/numeric.pyx asyncpg/protocol/codecs/range.pyx asyncpg/protocol/codecs/record.pyx asyncpg/protocol/codecs/text.pyx asyncpg/protocol/codecs/textutils.pyx asyncpg/protocol/codecs/tsearch.pyx asyncpg/protocol/codecs/txid.pyx asyncpg/protocol/codecs/uuid.pyx asyncpg/protocol/record/__init__.pxd asyncpg/protocol/record/recordobj.c asyncpg/protocol/record/recordobj.h docs/conf.py docs/faq.rst docs/index.rst docs/installation.rst docs/usage.rst docs/api/index.rst tests/__init__.py tests/test__environment.py tests/test__sourcecode.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_pool.py tests/test_prepare.py tests/test_record.py tests/test_test.py tests/test_timeout.py tests/test_transaction.py tests/test_utils.py tests/certs/ca.cert.pem tests/certs/server.cert.pem tests/certs/server.key.pemasyncpg-0.13.0/asyncpg.egg-info/dependency_links.txt0000664000372000037200000000000113172407440023307 0ustar travistravis00000000000000 asyncpg-0.13.0/asyncpg.egg-info/PKG-INFO0000664000372000037200000000777513172407440020356 0ustar travistravis00000000000000Metadata-Version: 1.1 Name: asyncpg Version: 0.13.0 Summary: An asyncio PosgtreSQL driver Home-page: https://github.com/MagicStack/asyncpg Author: MagicStack Inc Author-email: hello@magic.io License: Apache License, Version 2.0 Description-Content-Type: UNKNOWN Description: asyncpg -- A fast PostgreSQL Database Client Library for Python/asyncio ======================================================================= .. image:: https://travis-ci.org/MagicStack/asyncpg.svg?branch=master :target: https://travis-ci.org/MagicStack/asyncpg .. image:: https://ci.appveyor.com/api/projects/status/9rwppnxphgc8bqoj/branch/master?svg=true :target: https://ci.appveyor.com/project/magicstack/asyncpg .. 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.5 or later and is supported for PostgreSQL versions 9.2 to 10. Documentation ------------- The project documentation can be found `here `_. Performance ----------- In our testing asyncpg is, on average, **3x** faster than psycopg2 (and its asyncio variant -- aiopg). .. image:: performance.png :target: http://magic.io/blog/asyncpg-1m-rows-from-postgres-to-python/ The above results are a geometric mean of benchmarks obtained with PostgreSQL `client driver benchmarking toolbench `_. 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 and has no dependencies. Use pip to install:: $ pip install asyncpg 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''') await conn.close() loop = asyncio.get_event_loop() loop.run_until_complete(run()) License ------- asyncpg is developed and distributed under the Apache 2.0 license. Platform: POSIX Classifier: License :: OSI Approved :: Apache Software License Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Operating System :: POSIX Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Microsoft :: Windows Classifier: Development Status :: 5 - Production/Stable Provides: asyncpg asyncpg-0.13.0/asyncpg.egg-info/top_level.txt0000664000372000037200000000001013172407440021762 0ustar travistravis00000000000000asyncpg