Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.73k stars 3.74k forks source link

Python 3.7 Incompatibility #1648

Closed Coolguy3289 closed 5 years ago

Coolguy3289 commented 5 years ago

New in Python 3.7:

Backwards incompatible syntax changes:
    async and await are now reserved keywords.

Due to this, the code in compat.py

except AttributeError:
    create_task = asyncio.async

Discord will not run because of a syntax error:

Traceback (most recent call last):
  File "C:/Users/Ralph/PycharmProjects/asukabot/app/main.py", line 1, in <module>
    import discord
  File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\discord\__init__.py", line 20, in <module>
    from .client import Client, AppInfo, ChannelPermissions
  File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 38, in <module>
    from .state import ConnectionState
  File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\discord\state.py", line 36, in <module>
    from . import utils, compat
  File "C:\Users\Ralph\AppData\Roaming\Python\Python37\site-packages\discord\compat.py", line 32
    create_task = asyncio.async
                              ^
SyntaxError: invalid syntax
Harmon758 commented 5 years ago

Duplicate of #1249 and #1401

Coolguy3289 commented 5 years ago

Right, so just gonna switch to the rewrite. Is there something in the docs to reference this?

Harmon758 commented 5 years ago

See https://discordpy.readthedocs.io/en/rewrite/migrating.html. You should also join the official discord.py server for news and updates, including breaking changes, about the rewrite branch.

Coolguy3289 commented 5 years ago

So is Rewrite what all should be moving too?

Harmon758 commented 5 years ago

The rewrite branch is the next major version of the library. Further questions about it should be directed to the official discord.py server.