Commits

Kirill Simonov committed 35a90fb

Fix a bug in Representer.represent_object: copy_reg.dispatch_table was not correctly handled.

Comments (0)

Files changed (1)

lib/yaml/representer.py

 
         cls = type(data)
         if cls in copy_reg.dispatch_table:
-            reduce = copy_reg.dispatch_table[cls]
+            reduce = copy_reg.dispatch_table[cls](data)
         elif hasattr(data, '__reduce_ex__'):
             reduce = data.__reduce_ex__(2)
         elif hasattr(data, '__reduce__'):