Victor Subervi wrote:
Hi;
I have this code:

        sql = 'describe %s %s;' % (optionsStore, option)
        print sql
        cursor.execute(sql)
        descr = cursor.fetchone()
        if len(descr) is not None:

Python complains:

*TypeError*: len() of unsized object

Please advise how to rewrite the last line so as to avoid the infamous try/except.

What is the value of descr when it raises that exception? Try printing
descr (or repr(descr)) to find out.

BTW, len() always returns an int, so "len(descr) is not None" is always
true.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to