| 150 |
| 151 |
| 152 |
| 153 |
| 154 |
| 155 |
| 156 |
| 157 |
| 158 |
| 159 |
| 160 |
| 161 |
| 162 |
| 163 |
| 164 | |
def isparseable(self, deindent=True): |
""" return True if source is parseable, heuristically |
deindenting it by default. |
""" |
import parser |
if deindent: |
-> source = str(self.deindent()) |
else: |
source = str(self) |
try: |
parser.suite(source+'\n') |
except (parser.ParserError, SyntaxError): |
return False |
else: |
return True | |