Fix spying on unbound methods defined in a parent class of an owner.

Review Request #10343 — Created Dec. 3, 2018 and submitted

chipx86
kgb
master
b84ad50...
kgb

When spying on bound methods that were really defined on a parent of an
owning class, we cloned the method so that the underlying bytecode
wouldn't be shared between the spied method and other subclasses of the
parent. The same needs to be done for unbound methods as well.

This updates our cloning logic to properly clone unbound methods,
keeping the state separate. This works on all supported versions of
Python.

Unit tests pass on all supported Python versions.

Tested against broken behavior in tests being written in Review Board.

david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (b18cc30)
Loading...