Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-335

Python2 compatibilty for AsyncIOMotorClient

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0
    • Component/s: asyncio
    • None
    • Environment:
      Ubuntu 18.04 - python 2.7 pipenv

      Hi,

       

      when I import motor_asyncio from python2 I am getting the following traceback:

      >>> import motor.motor_asyncio
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/home/dfki.uni-bremen.de/abresser/.local/share/virtualenvs/test_motor_python2-N0GtcFQc/lib/python2.7/site-packages/motor/motor_asyncio.py", line 18, in <module>
          from .frameworks import asyncio as asyncio_framework
        File "/home/dfki.uni-bremen.de/abresser/.local/share/virtualenvs/test_motor_python2-N0GtcFQc/lib/python2.7/site-packages/motor/frameworks/asyncio/__init__.py", line 155
          result = yield from f(self, *args, **kwargs)
                            ^
      SyntaxError: invalid syntax
      

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            brean Andreas Bresser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: