(text, offset)
| 274 | |
| 275 | |
| 276 | def _offset_to_line_number(text, offset): |
| 277 | curLine = 1 |
| 278 | curOffset = 0 |
| 279 | while curOffset < offset: |
| 280 | if curOffset == len(text): |
| 281 | return -1 |
| 282 | c = text[curOffset] |
| 283 | if c == "\n": |
| 284 | curLine += 1 |
| 285 | elif c == "\r": |
| 286 | curLine += 1 |
| 287 | if curOffset < len(text) and text[curOffset + 1] == "\n": |
| 288 | curOffset += 1 |
| 289 | |
| 290 | curOffset += 1 |
| 291 | |
| 292 | return curLine |
| 293 | |
| 294 | |
| 295 | def _get_source_django_18_or_lower(frame): |
no outgoing calls
no test coverage detected