Fixed PEP8-Python3 errors

This commit is contained in:
Syrus Akbary 2016-05-20 23:48:54 -07:00
parent 577b76e436
commit b9723356fe
3 changed files with 6 additions and 5 deletions

View File

@ -1,8 +1,6 @@
from promise import Promise
from django.db import connections
from ....core.schema import GraphQLSchema
from ....core.types import Field
from .sql.tracking import unwrap_cursor, wrap_cursor
from .types import DjangoDebug
@ -47,8 +45,10 @@ class DjangoDebugMiddleware(object):
raise Exception('DjangoDebug cannot be executed in None contexts')
try:
context.django_debug = DjangoDebugContext()
except Exception, e:
raise Exception('DjangoDebug need the context to be writable, context received: {}.'.format(context.__class__.__name__))
except Exception:
raise Exception('DjangoDebug need the context to be writable, context received: {}.'.format(
context.__class__.__name__
))
if info.schema.graphene_schema.T(DjangoDebug) == info.return_type:
return context.django_debug.get_debug_promise()
promise = next(root, args, context, info)

View File

@ -10,6 +10,7 @@ from django.utils.encoding import force_text
from .types import DjangoDebugSQL, DjangoDebugPostgreSQL
class SQLQueryTriggered(Exception):
"""Thrown when template panel triggers a query"""

View File

@ -1,5 +1,5 @@
from collections import OrderedDict
from functools import wraps, partial
from functools import wraps
import six
from graphql.type import GraphQLField, GraphQLInputObjectField