pythonpython-3.xpycharm

Error: Statement expected, found py: Dedent


We are willing/ forced to develop a small Web App for the university. Now we started and everything seems to be fine, until the above strange error raises.

Statement expected, found py: Dedent

The error is raised by the following lines of code:

def get_reset_token(self, mysql, userid):
    try:
        conn = mysql.connect()
        cursor = conn.cursor()
        cursor.execute("""SELECT token FROM tralala_reset_password 
                       WHERE uid=(%s)""", userid)
        data = cursor.fetchall()
        cursor.close()
        conn.close()
        return data[0]
    except Exception as e:
        app.logger(str(e))
        return ""

PyCharm started to mark the return "" statement.


Solution

  • Problem solved by ignoring the error. Copied to an other editor and nothing here. So seems to be a PyCharm mistake.