Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

BSSReader reads literally everything #85

Open
Pigu-A opened this issue Dec 12, 2014 · 1 comment
Open

BSSReader reads literally everything #85

Pigu-A opened this issue Dec 12, 2014 · 1 comment

Comments

@Pigu-A
Copy link

Pigu-A commented Dec 12, 2014

Not sure if this is a problem in my OS but a preprocessor somehow don't let me make it with this error:

Traceback (most recent call last):
    File "prequeue.py", line 11, in <module>
        import preprocessor
    File "/home/pigu/pokecrystal/preprocessor.py", line 30, in <module>
    from extras.pokemontools.battle_animations import (
    File "/home/pigu/pokecrystal/extras/pokemontools/battle_animations.py", line 43, in <module>
        objs  = { k: v for k, v in anims.items() if 'ANIM_OBJ' in v }
    File "/home/pigu/pokecrystal/extras/pokemontools/battle_animations.py", line 43, in <dictcomp>
        objs  = { k: v for k, v in anims.items() if 'ANIM_OBJ' in v }
TypeError: argument of type 'int' is not iterable

So I decided to print anims variable, it appears that it contains constant entries and every Python builtins entries as well...

http://pastebin.com/3nWbPHjK

So, is there a way to work around this problem?

@yenatch
Copy link
Contributor

yenatch commented Dec 12, 2014

Instead of writing an expression parser, constants are intepreted with eval. eval optionally takes a dict of supplementary variables (globals). If __builtins__ isn't already a key, it's added to the dict.

This was addressed some time ago in 0dd6b20 but never merged into the main fork. This is fixed in #86.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants