[Python-checkins] CVS: python/dist/src/Lib pyclbr.py,1.19,1.19.4.1

Anthony Baxter anthonybaxter@users.sourceforge.net
Tue, 04 Dec 2001 21:56:04 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv22525

Modified Files:
      Tag: release21-maint
	pyclbr.py 
Log Message:
backport 1.23:

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.



Index: pyclbr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pyclbr.py,v
retrieving revision 1.19
retrieving revision 1.19.4.1
diff -C2 -d -r1.19 -r1.19.4.1
*** pyclbr.py	2001/02/12 02:00:42	1.19
--- pyclbr.py	2001/12/05 05:56:02	1.19.4.1
***************
*** 30,38 ****
  
  BUGS
! - Continuation lines are not dealt with at all.
! - While triple-quoted strings won't confuse it, lines that look like
!   def, class, import or "from ... import" stmts inside backslash-continued
!   single-quoted strings are treated like code.  The expense of stopping
!   that isn't worth it.
  - Code that doesn't pass tabnanny or python -t will confuse it, unless
    you set the module TABWIDTH vrbl (default 8) to the correct tab width
--- 30,35 ----
  
  BUGS
! - Continuation lines are not dealt with at all, except inside strings.
! - Nested classes and functions can confuse it.
  - Code that doesn't pass tabnanny or python -t will confuse it, unless
    you set the module TABWIDTH vrbl (default 8) to the correct tab width
***************
*** 77,80 ****
--- 74,81 ----
                      )*
          '''
+ 
+     |   " [^"\\\n]* (?: \\. [^"\\\n]*)* "
+ 
+     |   ' [^'\\\n]* (?: \\. [^'\\\n]*)* '
      )