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

View File

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

View File

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