Error: Statement expected, found py: Dedent

Keine-Ahnung picture Keine-Ahnung · Dec 12, 2017 · Viewed 24.6k times · Source

we are willing/ forced to develop a small webapp 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.

Best regards,

Marian

Answer

Keine-Ahnung picture Keine-Ahnung · Dec 12, 2017

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

Best regards,

Marian