I know I've seen this in an update log somewhere, but I can't for the life of me find it now. Moving up from RenPy 8.1.3 to the latest version, I get this error in the inventory code. I think it's something to do with the way the -> format has changed and simply requires a syntax change to some lines of code, but I can't remember where I saw the fix and can't find it now. Can anyone help?
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/inventory.rpy", line 676, in script
init python:
File "game/inventory.rpy", line 676, in script
init python:
File "game/inventory.rpy", line 684, in <module>
def findLast(l: list, val) -> Optional[int]:
NameError: name 'Optional' is not defined
Type hints give that error in the latest builds. I think it's just a temporary development thing. Just use some stable release instead of "nightly" or whatever you are using.
Otherwise, just delete those type hints - here parts between ) and :.
RewindTheGame wrote: ↑Mon Mar 25, 2024 10:20 am
I know I've seen this in an update log somewhere, but I can't for the life of me find it now. Moving up from RenPy 8.1.3 to the latest version, I get this error in the inventory code.