|
7 | 7 |
|
8 | 8 | from __future__ import print_function
|
9 | 9 |
|
10 |
| -from datetime import timedelta |
11 |
| -from hashlib import md5 |
12 | 10 | import hmac
|
13 | 11 | import json
|
14 | 12 | import logging
|
|
17 | 15 | import sys
|
18 | 16 | import time
|
19 | 17 | import traceback
|
| 18 | +from datetime import timedelta |
| 19 | +from hashlib import md5 |
20 | 20 |
|
21 | 21 | try:
|
22 | 22 | from urllib.parse import urlparse
|
23 | 23 | except ImportError:
|
24 | 24 | from urlparse import urlparse
|
25 | 25 |
|
26 |
| -from roundup import actions |
27 |
| -from roundup import date |
28 |
| -from roundup import hyperdb |
29 |
| -from roundup.anypy.strings import bs2b, b2s, u2s, is_us |
30 |
| -from roundup.cgi.exceptions import NotFound, Unauthorised, PreconditionFailed |
| 26 | +from roundup import actions, date, hyperdb |
| 27 | +from roundup.anypy.strings import b2s, bs2b, is_us, u2s |
| 28 | +from roundup.cgi.exceptions import NotFound, PreconditionFailed, Unauthorised |
31 | 29 | from roundup.exceptions import Reject, UsageError
|
32 | 30 | from roundup.i18n import _
|
33 |
| -from roundup.rate_limit import RateLimit, Gcra |
| 31 | +from roundup.rate_limit import Gcra, RateLimit |
34 | 32 |
|
35 | 33 | logger = logging.getLogger('roundup.rest')
|
36 | 34 |
|
@@ -2641,8 +2639,8 @@ def format_dispatch_output(self, accept_mime_type, output,
|
2641 | 2639 | # capture values in error with types unsupported
|
2642 | 2640 | # by dicttoxml e.g. an exception, into something it
|
2643 | 2641 | # can handle
|
2644 |
| - import numbers |
2645 | 2642 | import collections
|
| 2643 | + import numbers |
2646 | 2644 | for key, val in output['error'].items():
|
2647 | 2645 | if isinstance(val, numbers.Number) or type(val) in \
|
2648 | 2646 | (str, unicode): # noqa: SIM114
|
|
0 commit comments