Commits

gstarnberger  committed 7cfb893

check if code.co_consts exists before trying to dump docstring

  • Participants
  • Parent commits 1ce7e59

Comments (0)

Files changed (1)

File uncompyle/Walker.py

             while string.find(quote) >= 0:
                     string = string.replace(quote, unquote)
             return string
-        
+       
+        print docstring
+        print type(docstring)
+
         if docstring.find('\\\n') or docstring.find('\n'): # multiline string
             if docstring.find('"""') >=0:
                 quote = "'''"
         assert ast == 'stmts'
 
         # if docstring exists, dump it
-        if code.co_consts[0] != None \
+        if code.co_consts and code.co_consts[0] != None \
            and ast[0] == ASSIGN_DOC_STRING(code.co_consts[0]):
             #print '\n\n>>-->>doc string set\n\n'
             self.print_docstring(indent, code.co_consts[0])