##// END OF EJS Templates
py3: synced _vendor with vcsserver py3 changes
super-admin -
r4909:b5f74a71 default
parent child Browse files
Show More
@@ -125,7 +125,7 b' class JsonFormatter(ExceptionAwareFormat'
125 self.json_ensure_ascii = kwargs.pop("json_ensure_ascii", True)
125 self.json_ensure_ascii = kwargs.pop("json_ensure_ascii", True)
126 self.prefix = kwargs.pop("prefix", "")
126 self.prefix = kwargs.pop("prefix", "")
127 reserved_attrs = kwargs.pop("reserved_attrs", RESERVED_ATTRS)
127 reserved_attrs = kwargs.pop("reserved_attrs", RESERVED_ATTRS)
128 self.reserved_attrs = dict(zip(reserved_attrs, reserved_attrs))
128 self.reserved_attrs = dict(list(zip(reserved_attrs, reserved_attrs)))
129 self.timestamp = kwargs.pop("timestamp", True)
129 self.timestamp = kwargs.pop("timestamp", True)
130
130
131 # super(JsonFormatter, self).__init__(*args, **kwargs)
131 # super(JsonFormatter, self).__init__(*args, **kwargs)
@@ -134,8 +134,8 b' class JsonFormatter(ExceptionAwareFormat'
134 self.json_encoder = JsonEncoder
134 self.json_encoder = JsonEncoder
135
135
136 self._required_fields = self.parse()
136 self._required_fields = self.parse()
137 self._skip_fields = dict(zip(self._required_fields,
137 self._skip_fields = dict(list(zip(self._required_fields,
138 self._required_fields))
138 self._required_fields)))
139 self._skip_fields.update(self.reserved_attrs)
139 self._skip_fields.update(self.reserved_attrs)
140
140
141 def _str_to_fn(self, fn_as_str):
141 def _str_to_fn(self, fn_as_str):
@@ -23,14 +23,8 b' loggers = {'
23 ]
23 ]
24 }
24 }
25
25
26 PY3 = sys.version_info[0] == 3
26 text_type = str
27
27 binary_type = bytes
28 if PY3:
29 text_type = str
30 binary_type = bytes
31 else:
32 text_type = unicode # noqa
33 binary_type = str
34
28
35
29
36 # Check if the id match. If not, return an error code.
30 # Check if the id match. If not, return an error code.
@@ -1,4 +1,4 b''
1 from __future__ import absolute_import, division, unicode_literals
1
2
2
3 import logging
3 import logging
4
4
@@ -1,4 +1,4 b''
1 from __future__ import absolute_import, division, unicode_literals
1
2
2
3 import re
3 import re
4 import random
4 import random
@@ -1,4 +1,4 b''
1 from __future__ import absolute_import, division, unicode_literals
1
2
2
3 import socket
3 import socket
4
4
@@ -1,14 +1,7 b''
1 from __future__ import absolute_import, division, unicode_literals
1 from __future__ import absolute_import, division, unicode_literals
2
2
3 import functools
3 import functools
4
4 from time import perf_counter as time_now
5 # Use timer that's not susceptible to time of day adjustments.
6 try:
7 # perf_counter is only present on Py3.3+
8 from time import perf_counter as time_now
9 except ImportError:
10 # fall back to using time
11 from time import time as time_now
12
5
13
6
14 def safe_wraps(wrapper, *args, **kwargs):
7 def safe_wraps(wrapper, *args, **kwargs):
@@ -1,4 +1,4 b''
1 from __future__ import absolute_import, division, unicode_literals
1
2
2
3 import socket
3 import socket
4
4
General Comments 0
You need to be logged in to leave comments. Login now