summaryrefslogtreecommitdiff
path: root/representer.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2021-05-31 08:36:28 +0200
committerAnthon van der Neut <anthon@mnt.org>2021-05-31 08:36:28 +0200
commitea3d878ef8635120354cd59a1f31b97b05a3e09b (patch)
tree75883248966af6cd241cbcd75bc40ba1bc856b6d /representer.py
parent35b81abf32f2567feba5957bc7c9d31782af3b1c (diff)
downloadruamel.yaml-ea3d878ef8635120354cd59a1f31b97b05a3e09b.tar.gz
fix 385 (missing attribute) and mypy issues0.17.6
Diffstat (limited to 'representer.py')
-rw-r--r--representer.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/representer.py b/representer.py
index 4b78c65..d419f50 100644
--- a/representer.py
+++ b/representer.py
@@ -253,7 +253,8 @@ class SafeRepresenter(BaseRepresenter):
if hasattr(base64, 'encodebytes'):
data = base64.encodebytes(data).decode('ascii')
else:
- data = base64.encodestring(data).decode('ascii')
+ # check py2 only?
+ data = base64.encodestring(data).decode('ascii') # type: ignore
return self.represent_scalar('tag:yaml.org,2002:binary', data, style='|')
def represent_bool(self, data, anchor=None):
@@ -439,8 +440,8 @@ class Representer(SafeRepresenter):
# !!python/object/apply node.
cls = type(data)
- if cls in copyreg.dispatch_table:
- reduce = copyreg.dispatch_table[cls](data)
+ if cls in copyreg.dispatch_table: # type: ignore
+ reduce = copyreg.dispatch_table[cls](data) # type: ignore
elif hasattr(data, '__reduce_ex__'):
reduce = data.__reduce_ex__(2)
elif hasattr(data, '__reduce__'):