Skip to content

Commit

Permalink
Update imports for modernrpc classes
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Jan 5, 2025
1 parent dad8c77 commit 29cb367
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tcms/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from datetime import timedelta

from modernrpc.handlers import JSONRPCHandler, XMLRPCHandler
from modernrpc.handlers.base import BaseResult, SuccessResult
from modernrpc.handlers.base import BaseResult
from modernrpc.handlers.xmlhandler import XmlSuccessResult
from modernrpc.handlers.jsonhandler import JsonResult, JsonSuccessResult


Expand Down Expand Up @@ -56,7 +57,7 @@ def escape_list(result_list):
__class__.escape_dict(item)

def dumps_result(self, result: BaseResult) -> str:
if isinstance(result, SuccessResult):
if isinstance(result, XmlSuccessResult):
if isinstance(result.data, timedelta):
result.data = result.data.total_seconds()
elif isinstance(result.data, dict):
Expand Down

0 comments on commit 29cb367

Please sign in to comment.