Finding "hidden" syntax errors

Miki Tebeka miki.tebeka at zoran.com
Sun Jun 13 10:50:08 CEST 2004


Hello Larry,

> I tried pychecker but got nowhere because it said it couldn't import
> (which I'm sure is because of the syntax error). Does anyone out there
> have a "better" way of tracking down these difficult to locate errors?
I'm using pychecker. It says where the error is:
--- syn.py ---
def f(x):
    if x = 2: # Syntax error
        print "YO"
    else:
        print "Halt! Who goes there?"
--- syn.py ---

[10:45] $pychecker syn.py 
Processing syn...
  SyntaxError: invalid syntax (syn.py, line 2)
        if x = 2: # Syntax error
             ^

Warnings...

syn:1: NOT PROCESSED UNABLE TO IMPORT
[10:45] $

pychecker found out that the problem is in line 2.

Maybe some concrete example?

Bye.
--
-------------------------------------------------------------------------
Miki Tebeka <miki.tebeka at zoran.com>
The only difference between children and adults is the price of the toys.




More information about the Python-list mailing list