Closed chrigl closed 10 years ago
Thanks.
PyYAML should actually allow extending it properly, so this monkey-patching is a horrible hack anyway, and ideally should go away. Only exists because I wrote it in a hurry as an ad-hoc helper and didn't want to spend time looking into how proper extension should be done.
If pyaml.dump was called multiple times it ran into an maximum recursion error. This was because on each call, the original Serializer.serialize_node was wrapped with a new one over and over again.
Also added some tests.
To reproduce the problem, take tests/test_pyaml.py only, and use py.test to run the code. The test will result in an RuntimeError: maximum recursion depth exceeded