From 4bb9b8178f2c25341ce797b6ff90b6f8078f26e6 Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Thu, 6 Dec 2018 18:37:27 +0100 Subject: fix issue #244 dumping methods of metaclass derived classes *When this change indeed resolves your problem, please **Close** this issue*. *(You can do so using the WorkFlow pull-down (close to the top right of this page))* --- CHANGES | 4 ++++ README.rst | 8 ++++++-- __init__.py | 4 ++-- _doc/_static/pypi.svg | 2 +- _test/test_z_data.py | 3 ++- representer.py | 1 + 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 9d17020..b10d621 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +[0, 15, 81]: 2018-12-06 + - fix issue saving methods of metaclass derived classes (reported and fix provided + by `Douglas Raillard `__) + [0, 15, 80]: 2018-11-26 - fix issue emitting BEL character when round-tripping invalid folded input (reported by Isaac on `StackOverflow `__) diff --git a/README.rst b/README.rst index 61f7b52..d59281f 100644 --- a/README.rst +++ b/README.rst @@ -4,8 +4,8 @@ ruamel.yaml ``ruamel.yaml`` is a YAML 1.2 loader/dumper package for Python. -:version: 0.15.80 -:updated: 2018-11-26 +:version: 0.15.81 +:updated: 2018-12-06 :documentation: http://yaml.readthedocs.io :repository: https://bitbucket.org/ruamel/ :pypi: https://pypi.org/project/ruamel.yaml/ @@ -54,6 +54,10 @@ ChangeLog .. should insert NEXT: at the beginning of line for next key (with empty line) +0.15.81 (2018-12-06): + - fix issue dumping methods of metaclass derived classes (reported and fix provided + by `Douglas Raillard `__) + 0.15.80 (2018-11-26): - fix issue emitting BEL character when round-tripping invalid folded input (reported by Isaac on `StackOverflow `__) diff --git a/__init__.py b/__init__.py index 8033a8b..4300f70 100644 --- a/__init__.py +++ b/__init__.py @@ -7,8 +7,8 @@ if False: # MYPY _package_data = dict( full_package_name='ruamel.yaml', - version_info=(0, 15, 80), - __version__='0.15.80', + version_info=(0, 15, 81), + __version__='0.15.81', author='Anthon van der Neut', author_email='a.van.der.neut@ruamel.eu', description='ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order', # NOQA diff --git a/_doc/_static/pypi.svg b/_doc/_static/pypi.svg index 7c76e41..62a44e9 100644 --- a/_doc/_static/pypi.svg +++ b/_doc/_static/pypi.svg @@ -1 +1 @@ - pypipypi0.15.800.15.80 + pypipypi0.15.810.15.81 diff --git a/_test/test_z_data.py b/_test/test_z_data.py index b0464ba..ca75ca6 100644 --- a/_test/test_z_data.py +++ b/_test/test_z_data.py @@ -192,7 +192,8 @@ class TestYAMLData(object): assert data is not None typ = 'rt' print('type:', typ) - print('data:', data.value, end='') + if data is not None: + print('data:', data.value, end='') print('output:', output.value if output is not None else output) if typ == 'rt': self.round_trip(data, output, yaml_version=yaml_version) diff --git a/representer.py b/representer.py index 7ce810e..d1fd739 100644 --- a/representer.py +++ b/representer.py @@ -639,6 +639,7 @@ if PY2: Representer.add_multi_representer(object, Representer.represent_object) +Representer.add_multi_representer(type, Representer.represent_name) from ruamel.yaml.comments import ( CommentedMap, -- cgit v1.2.1