Quantcast
Channel: WebSphere Blog by Steve Robinson » WebSphere Jython Examples
Viewing all articles
Browse latest Browse all 10

SyntaxError: inconsistent dedent

$
0
0

When running a WAS jython script you get the following error:

WASX7017E: Exception received while running file "f:\script\jython\getCell.py"; exception information: com.ibm.bsf.BSFException: exception from
Traceback (innermost last):
  (no code object) at line 0
  File "", line 36
            elif value.find( 'WASX7017E' ) > -1 :
            ^
SyntaxError: inconsistent dedent

 

In this example screen shot below you can see that the elif statement has been indented by one space too much. It is wise to use a text editor which provides and option to show tabs and space characters, so you can sort out our jython indentation.

 

 

Solution:

 

Delete the extra space, and remember that if you want to use tabs it is best to set your editor if it is possible to use spaces for tab characters, this will save you many late nights debugging tab based indentation vs space based indentation in your jython scripts


Viewing all articles
Browse latest Browse all 10

Trending Articles