-
-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
return
in Python 3.8 in try
... except
#369
Comments
|
Hi! I know you may be confused by the name, but this have absolutely nothing to do with Fortnite, nor Epic Games. It's just a Discord text game which I made from scratch and it's an RNG game, and there are not even guns. I can provide older versions from a week ago as proof if you need them. It's in Spanish and there are no names, texts, images or anything related to Fortnite. |
Ok - I've deleted the label. Attach an old version. As for a bug report, this bytecode and source code is too large for a bug report here. Use the older source to see of you can create a small example that shows the bug. |
Okay, already tested and the same error happens on the old source, the lines with problems seem to be the parts of the code where my async functions return None (lines 82, 107, 151), which raises the parse error. I manually deleted those 3 parts from the old source, recompiled the cache and tried with uncompyle, and now it works perfectly. Since those parts were also part of the lost version I am trying to recover, and the error is the same, I'm pretty sure the problems are those empty |
Ok - cool. The last thing for you to do before it would be looked at in a here is to narrow the part that doesn't decompile into the smallest possible number of lines and resulting in a short program. Can you get it less than 30 lines? Less than 10? Less than 5? (All of this is mentioned in Narrowing the problem. You should read the entire document if you haven't already. |
Here it is: import discord
from discord.ext import commands
import asyncio
class BRCog(commands.Cog):
async def battle(self, ctx):
try:
await self.bot.wait_for('reaction_add')
except asyncio.TimeoutError:
await ctx.send("a")
return
def setup(bot):
bot.add_cog(BRCog(bot)) And here it is the .pyc, and the output (although the error is the same, LOAD_CONST) |
I was able to narrow it even more: import asyncio
def BRCog():
try:
1+1
except asyncio.TimeoutError:
asyncio.read()
return |
I have some preliminary fixes, for some of the simpler code, But more work is needed for the more complex situations. At any rate fixes will appear in the decompyle3 project - eventually. |
Sounds good, I also follow the other repo so I'll be looking into that. |
By now, is there a way to remove those lines from the .pyc or ignore the errors? Since all of the other parts of the code are being parsed correctly except that one. |
Seems like a useful feature for someone to add. Hey, how about you? |
return
in Python 3.8 finally clause of try except
return
in Python 3.8 finally clause of try exceptreturn
in Python 3.8 finally
clause of try
... except
return
in Python 3.8 finally
clause of try
... except
return
in Python 3.8 in try
... except
Description
Hi! I'm trying to decompile a cog from my Discord bot which I overwrote by error. When using uncompyle, all classes except one (the longest one) were recovered. In the last one, I get the following output (I also attached the full output, and the full .pyc):
The script raises an error exactly on the last two lines of the code, so there isn't anything after that.
How to Reproduce
Environment
Uncompyle6.zip
The text was updated successfully, but these errors were encountered: