1+ # -*- encoding: utf-8 -*-
12from flask .json import dumps
23from werkzeug import Response
34
@@ -41,7 +42,7 @@ def __init__(self, response=None, status=None, headers=None,
4142 direct_passthrough = False ):
4243 assert sorted (response .keys ()) == ['code' , 'detail' , 'message' ], \
4344 '错误的返回格式'
44- return super ().__init__ (
45+ return super (Result , self ).__init__ (
4546 response = dumps (response , indent = 0 , separators = (',' , ':' )) + '\n ' ,
4647 status = status or self .status , headers = headers , mimetype = mimetype ,
4748 content_type = content_type , direct_passthrough = direct_passthrough )
@@ -53,7 +54,7 @@ class SuccessResult(Result):
5354 status = 200
5455
5556 def __init__ (self , code = None , message = '' , detail = None , status = None ):
56- return super ().__init__ (
57+ return super (SuccessResult , self ).__init__ (
5758 gen_response (code or self .status , message , detail ),
5859 self .status or status )
5960
@@ -64,7 +65,7 @@ class FailedResult(Result):
6465 status = 400
6566
6667 def __init__ (self , code = None , message = '' , detail = None ):
67- return super ().__init__ (
68+ return super (FailedResult , self ).__init__ (
6869 gen_response (code or self .status , message , detail ), self .status )
6970
7071
0 commit comments