Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c6ac8a7

Browse files
committed
SF bug #473525 pyclbr broken
As the comments in the module implied, pyclbr was easily confused by "strange stuff" inside single- (but not triple-) quoted strings. It isn't anymore. Its behavior remains flaky in the presence of nested functions and classes, though. Bugfix candidate.
1 parent e877f8b commit c6ac8a7

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Lib/pyclbr.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@
2929
shouldn't happen often.
3030
3131
BUGS
32-
- Continuation lines are not dealt with at all.
33-
- While triple-quoted strings won't confuse it, lines that look like
34-
def, class, import or "from ... import" stmts inside backslash-continued
35-
single-quoted strings are treated like code. The expense of stopping
36-
that isn't worth it.
32+
- Continuation lines are not dealt with at all, except inside strings.
33+
- Nested classes and functions can confuse it.
3734
- Code that doesn't pass tabnanny or python -t will confuse it, unless
3835
you set the module TABWIDTH vrbl (default 8) to the correct tab width
3936
for the file.
@@ -75,6 +72,10 @@ class MyClass(subpackage.SuperClass):
7572
[^'\\]*
7673
)*
7774
'''
75+
76+
| " [^"\\\n]* (?: \\. [^"\\\n]*)* "
77+
78+
| ' [^'\\\n]* (?: \\. [^'\\\n]*)* '
7879
)
7980
8081
| (?P<Method>

0 commit comments

Comments
 (0)