aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/PyYAML/py2/yaml/representer.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/python/PyYAML/py2/yaml/representer.py
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/PyYAML/py2/yaml/representer.py')
-rw-r--r--contrib/python/PyYAML/py2/yaml/representer.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/python/PyYAML/py2/yaml/representer.py b/contrib/python/PyYAML/py2/yaml/representer.py
index 93e09b67b3..fec15eb201 100644
--- a/contrib/python/PyYAML/py2/yaml/representer.py
+++ b/contrib/python/PyYAML/py2/yaml/representer.py
@@ -3,12 +3,12 @@ __all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
-
+
from nodes import *
import datetime
-import copy_reg, types
+import copy_reg, types
class RepresenterError(YAMLError):
pass
@@ -18,10 +18,10 @@ class BaseRepresenter(object):
yaml_representers = {}
yaml_multi_representers = {}
- def __init__(self, default_style=None, default_flow_style=False, sort_keys=True):
+ def __init__(self, default_style=None, default_flow_style=False, sort_keys=True):
self.default_style = default_style
self.default_flow_style = default_flow_style
- self.sort_keys = sort_keys
+ self.sort_keys = sort_keys
self.represented_objects = {}
self.object_keeper = []
self.alias_key = None
@@ -119,8 +119,8 @@ class BaseRepresenter(object):
best_style = True
if hasattr(mapping, 'items'):
mapping = mapping.items()
- if self.sort_keys:
- mapping.sort()
+ if self.sort_keys:
+ mapping.sort()
for item_key, item_value in mapping:
node_key = self.represent_data(item_key)
node_value = self.represent_data(item_value)
@@ -249,7 +249,7 @@ class SafeRepresenter(BaseRepresenter):
return self.represent_mapping(tag, state, flow_style=flow_style)
def represent_undefined(self, data):
- raise RepresenterError("cannot represent an object", data)
+ raise RepresenterError("cannot represent an object", data)
SafeRepresenter.add_representer(type(None),
SafeRepresenter.represent_none)
@@ -414,7 +414,7 @@ class Representer(SafeRepresenter):
elif hasattr(data, '__reduce__'):
reduce = data.__reduce__()
else:
- raise RepresenterError("cannot represent an object", data)
+ raise RepresenterError("cannot represent an object", data)
reduce = (list(reduce)+[None]*5)[:5]
function, args, state, listitems, dictitems = reduce
args = list(args)