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

"invalid syntax" when installing in Python 2

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.5
    • Affects Version/s: None
    • Component/s: asyncio
    • None

      Upgrading an old Python 2.7 virtualenv from Motor 0.2.1 to the version on master (01f2b01):

      pip install git+https://github.com/mongodb/motor.git
      Downloading/unpacking git+https://github.com/mongodb/motor.git
        Cloning https://github.com/mongodb/motor.git to /var/folders/qf/1_htbmz16kg_6qsqzchskq8r0000gq/T/pip-_AnBuG-build
      git hooks not installed in this repository.  Run 'git hooks --install' to install it or 'git hooks -h' for more information.
        Running setup.py (path:/var/folders/qf/1_htbmz16kg_6qsqzchskq8r0000gq/T/pip-_AnBuG-build/setup.py) egg_info for package from git+https://github.com/mongodb/motor.git
      
      Requirement already satisfied (use --upgrade to upgrade): greenlet>=0.4.0 in /Users/emptysquare/.virtualenvs/motor-blog/lib/python2.7/site-packages (from motor==0.5.dev0)
      Requirement already satisfied (use --upgrade to upgrade): pymongo==2.8.0 in /Users/emptysquare/.virtualenvs/motor-blog/lib/python2.7/site-packages (from motor==0.5.dev0)
      Installing collected packages: motor
        Found existing installation: motor 0.2.1
          Uninstalling motor:
            Successfully uninstalled motor
        Running setup.py install for motor
            File "/Users/emptysquare/.virtualenvs/motor-blog/lib/python2.7/site-packages/motor/frameworks/asyncio.py", line 135
              result = yield from f(self, *args, **kwargs)
                                ^
          SyntaxError: invalid syntax
      
      
      Successfully installed motor
      Cleaning up...
      

      Motor is installed, but it prints an error while trying to precompile the install files. Presumably, we need to omit frameworks/asyncio.py when installing in Python < 3.3, since it can't be compiled or used.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: