Fix spying on methods on old-style classes.

Review Request #10199 — Created Oct. 6, 2018 and submitted — Latest diff uploaded

Information

kgb
master
d65f131...

Reviewers

kgb

On Python 2.6 and early versions of 2.7, object.__setattr__ can't be
used on old-style classes (those not inheriting from object), which
meant that some spies would succeed on some versions of Python and fail
on others.

We now fall back to simply modifying the dictionary in these cases.

Unit tests pass on all supported versions of Python.