diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index 5e2b763f52..470ea779c3 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -267,7 +267,7 @@ WHEN (new.%(col_name)s IS NULL) # http://cx-oracle.sourceforge.net/html/cursor.html#Cursor.statement # The DB API definition does not define this attribute. statement = cursor.statement - if not six.PY3 and not isinstance(statement, unicode): + if statement and not six.PY3 and not isinstance(statement, unicode): statement = statement.decode('utf-8') # Unlike Psycopg's `query` and MySQLdb`'s `_last_executed`, CxOracle's # `statement` doesn't contain the query parameters. refs #20010.