Skip to content

fix the python 3.7 compatibility#357

Merged
terricain merged 1 commit intoaio-libs:masterfrom
albertwh1te:master
Nov 20, 2018
Merged

fix the python 3.7 compatibility#357
terricain merged 1 commit intoaio-libs:masterfrom
albertwh1te:master

Conversation

@albertwh1te
Copy link
Copy Markdown
Contributor

Fixes issue #317

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 20, 2018

Codecov Report

Merging #357 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #357   +/-   ##
=======================================
  Coverage   93.17%   93.17%           
=======================================
  Files           9        9           
  Lines        1129     1129           
  Branches      161      161           
=======================================
  Hits         1052     1052           
  Misses         54       54           
  Partials       23       23
Impacted Files Coverage Δ
aiomysql/cursors.py 94.06% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 298d2f1...f260d5b. Read the comment docs.

@webknjaz webknjaz requested a review from terricain November 20, 2018 14:40
@terricain
Copy link
Copy Markdown
Collaborator

Looks good. 👍

@terricain terricain merged commit 6cc678c into aio-libs:master Nov 20, 2018
@anyUesr
Copy link
Copy Markdown

anyUesr commented Jan 2, 2019

0.0.20 do not fix this, please recheck it:

In [15]: import aiomysql                                                                                                                                                            

In [16]: aiomysql.__version__                                                                                                                                                       
Out[16]: '0.0.20'

In [17]: async def test(): 
    ...:     async with mysql_pool.acquire() as conn: 
    ...:         async for one_feature_info_res in conn.execute(FeatureInfoT.select()): 
    ...:             print(one_feature_info_res) 
    ...:                                                                                                                                                                            

In [18]: loop.run_until_complete(test())                                                                                                                                            
/home/redis/.pyenv/versions/3.7.2/bin/ipython:3: RuntimeWarning: coroutine '_SAConnectionContextManager.__aiter__' was never awaited
  # -*- coding: utf-8 -*-
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/home/redis/.pyenv/versions/3.7.2/bin/ipython:3: RuntimeWarning: coroutine 'SAConnection._execute' was never awaited
  # -*- coding: utf-8 -*-
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-18-66585a8d0722> in <module>
----> 1 loop.run_until_complete(test())

~/.pyenv/versions/3.7.2/lib/python3.7/asyncio/base_events.py in run_until_complete(self, future)
    582             raise RuntimeError('Event loop stopped before Future completed.')
    583 
--> 584         return future.result()
    585 
    586     def stop(self):

<ipython-input-17-fa7af2a10cfe> in test()
      1 async def test():
      2     async with mysql_pool.acquire() as conn:
----> 3         async for one_feature_info_res in conn.execute(FeatureInfoT.select()):
      4             print(one_feature_info_res)
      5 

TypeError: 'async for' received an object from __aiter__ that does not implement __anext__: coroutine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants