Get a repr-like string for the data, but truncate it at "maxlen" bytes (ending the object graph traversal as soon as you do)
(self, maxlen)
| 1302 | interp_frame = interp_frame.previous() |
| 1303 | |
| 1304 | def get_truncated_repr(self, maxlen): |
| 1305 | ''' |
| 1306 | Get a repr-like string for the data, but truncate it at "maxlen" bytes |
| 1307 | (ending the object graph traversal as soon as you do) |
| 1308 | ''' |
| 1309 | out = TruncatedStringIO(maxlen) |
| 1310 | try: |
| 1311 | self.write_repr(out, set()) |
| 1312 | except StringTruncated: |
| 1313 | # Truncation occurred: |
| 1314 | return out.getvalue() + '...(truncated)' |
| 1315 | |
| 1316 | # No truncation occurred: |
| 1317 | return out.getvalue() |
| 1318 | |
| 1319 | class PySetObjectPtr(PyObjectPtr): |
| 1320 | _typename = 'PySetObject' |
no test coverage detected