Source

pyyaml / lib3 / yaml / representer.py

Diff from to

lib3/yaml/representer.py

         return self.represent_scalar('tag:yaml.org,2002:str', data)
 
     def represent_binary(self, data):
-        data = base64.encodestring(data).decode('ascii')
+        if hasattr(base64, 'encodebytes'):
+            data = base64.encodebytes(data).decode('ascii')
+        else:
+            data = base64.encodestring(data).decode('ascii')
         return self.represent_scalar('tag:yaml.org,2002:binary', data, style='|')
 
     def represent_bool(self, data):