On Feb 26, 2011, at 10:53 AM, LightOfMooN wrote:
> 
> if type('asd') == str:
>    pass

Could you post the whole function? It sounds like you might be rebinding type.

> 
> Traceback (most recent call last):
>  File "/home/www-data/web2py/gluon/restricted.py", line 188, in
> restricted
>    exec ccode in environment
>  File "/home/www-data/web2py/applications/rushops/controllers/
> shop.py", line 376, in <module>
>  File "/home/www-data/web2py/gluon/globals.py", line 95, in <lambda>
>    self._caller = lambda f: f()
>  File "/home/www-data/web2py/gluon/tools.py", line 2314, in f
>    return action(*a, **b)
>  File "/home/www-data/web2py/applications/rushops/controllers/
> shop.py", line 203, in structure
>    if type('asd') == str:
> UnboundLocalError: local variable 'type' referenced before assignment
> 
> 
> but in the other function:
> 
> ids = request.vars.filetodelete
>                if type(ids) != list and ids:
>                    ids = [ids]
> 
> works fine


Reply via email to