Writing python code causes indentation errors

Bug #1592686 reported by Zisu Andrei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scratch
New
Undecided
Unassigned

Bug Description

If I have the following code

 import smbus
print (smbus.__file__)
 import RPi.GPIO as GPIO

I need to add a tab before the print line to move it to the same indentation level. Unfortunately, Scratch adds 4 spaces instead of a tab, like the other lines have, so running the script yields "IndentationError: unindent does not match any outer indentation level", which seems to come from this mixing of spaces with tabs.

I think the editor should be aware of the tab style of the line before (tab vs space) and try to copy it.

Zisu Andrei (matzipan)
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.