Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.11] gh-98624 Add mutex to unittest.mock.NonCallableMock (GH-98688) #98797

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 28, 2022

  • Added lock to NonCallableMock in unittest.mock

  • Add blurb

  • Nitpick blurb

  • Edit comment based on @Jason-Y-Z's review

  • Add link to GH issue
    (cherry picked from commit 0346edd)

Co-authored-by: noah-weingarden 33741795+noah-weingarden@users.noreply.github.com

…8688)

* Added lock to NonCallableMock in unittest.mock

* Add blurb

* Nitpick blurb

* Edit comment based on @Jason-Y-Z's review

* Add link to GH issue
(cherry picked from commit 0346edd)

Co-authored-by: noah-weingarden <33741795+noah-weingarden@users.noreply.github.com>
#
# See https://github.com/python/cpython/issues/98624 for why this is
# necessary.
_lock = RLock()
Copy link

@dtantsur dtantsur Jan 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ambv could that be renamed? this change broke us since we no longer get an implicit our_object._lock mock... Can be worked around, but potentially affect a lot of people, and the workaround will undo your fix.

openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Jan 27, 2023
* Update ironic-inspector from branch 'master'
  to d65d6020c25e25e00b5b9f85fe97731fb8a56e3f
  - Merge "Rename NodeInfo._lock to avoid conflict with Mock._lock in tests"
  - Rename NodeInfo._lock to avoid conflict with Mock._lock in tests
    
    Starting with python/cpython#98797, Python's
    Mock has its own _lock. I hope they rename it to something really
    private (e.g. __lock), but for now rename our attribute (and hope that
    no downstream plugins relied on it, sigh).
    
    Change-Id: I7ba858fb3f259b8e7a3becde94b7ba6b90615287
openstack-mirroring pushed a commit to openstack/ironic-inspector that referenced this pull request Jan 27, 2023
Starting with python/cpython#98797, Python's
Mock has its own _lock. I hope they rename it to something really
private (e.g. __lock), but for now rename our attribute (and hope that
no downstream plugins relied on it, sigh).

Change-Id: I7ba858fb3f259b8e7a3becde94b7ba6b90615287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants