[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Python bots in Galcon (or your game!) safe_eval

Phil Hassey wrote:
What in particular did you have to change to make it work with python 2.3?

I'm not sure why, but when I run it, in _builtins_destroy, __builtins__ turns out to be a dict, not a module, so instead of

   for k in __builtins__.__dict__.keys():

I need to just do

   for k in __builtins__.keys():


Further experimenting suggests that in the main
module __builtins__ is a module, but in any imported
module it's a dict. Strange.