mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 02:14:49 -04:00
Python 3: Convert some unicode/bytes uses (#3569)
This commit is contained in:
parent
c4842e16cb
commit
da7785147d
17 changed files with 122 additions and 67 deletions
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from six import string_types
|
||||
from six import binary_type, text_type
|
||||
|
||||
from canonicaljson import json
|
||||
from frozendict import frozendict
|
||||
|
@ -26,7 +26,7 @@ def freeze(o):
|
|||
if isinstance(o, frozendict):
|
||||
return o
|
||||
|
||||
if isinstance(o, string_types):
|
||||
if isinstance(o, (binary_type, text_type)):
|
||||
return o
|
||||
|
||||
try:
|
||||
|
@ -41,7 +41,7 @@ def unfreeze(o):
|
|||
if isinstance(o, (dict, frozendict)):
|
||||
return dict({k: unfreeze(v) for k, v in o.items()})
|
||||
|
||||
if isinstance(o, string_types):
|
||||
if isinstance(o, (binary_type, text_type)):
|
||||
return o
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue