Skip to content

Commit

Permalink
Upgrade to python 3.11.1 (#56)
Browse files Browse the repository at this point in the history
* Update configurator to conform to new python 3.11 coroutine rules

* await asyncio.sleep

* Use python 3.11.1 heroku runtime
  • Loading branch information
VishalRamesh50 authored Jan 26, 2023
1 parent 4f6279e commit 0094295
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.7.6
python-3.11.1
9 changes: 6 additions & 3 deletions src/cogs/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def setup(self, ctx: commands.Context) -> None:
"4️⃣": (ChannelType.SCHEDULES.value, self._setup_schedules),
"5️⃣": (ChannelType.SUGGESTIONS.value, self._setup_suggestions),
"6️⃣": (ChannelType.TWITCH.value, self._setup_twitch),
"✅": ("All Modules", asyncio.coroutine(lambda *args, **kwargs: None)),
"✅": ("All Modules", self.do_nothing),
}

def check(reaction: discord.Reaction, user: discord.Member) -> bool:
Expand Down Expand Up @@ -173,8 +173,8 @@ def msg_check(msg: discord.Message) -> bool:

done, pending = await asyncio.wait(
[
self.client.wait_for("message", timeout=60, check=msg_check),
self.client.wait_for("reaction_add", timeout=60, check=skip_check),
asyncio.Task(self.client.wait_for("message", timeout=60, check=msg_check)),
asyncio.Task(self.client.wait_for("reaction_add", timeout=60, check=skip_check)),
],
return_when=asyncio.FIRST_COMPLETED,
)
Expand Down Expand Up @@ -215,6 +215,9 @@ def msg_check(msg: discord.Message) -> bool:
await sent_msg.edit(embed=embed)
await res_msg.delete()

async def do_nothing(self, *args, **kwargs):
pass

async def _setup_log(self, ctx: commands.Context, all_modules: bool = False):
await self._setup_template(
ctx,
Expand Down
2 changes: 1 addition & 1 deletion src/cogs/course_registration/course_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ async def clone_cr(self, ctx: commands.Context) -> None:
content: str = "\n".join(lines)
await ctx.send(content)
# quick and dirty way to ensure to some degree that embeds are created in order
asyncio.sleep(5)
await asyncio.sleep(5)

await ctx.send("Cloning complete!")

Expand Down

0 comments on commit 0094295

Please sign in to comment.