Skip to content

[3.7] bpo-35082: Don't report deleted attributes in __dir__ (GH-10148)#13859

Merged
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-0df635c-3.7
Jun 6, 2019
Merged

[3.7] bpo-35082: Don't report deleted attributes in __dir__ (GH-10148)#13859
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-0df635c-3.7

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Jun 6, 2019

When an attribute is deleted from a Mock, a sentinel is added rather
than just deleting the attribute. This commit checks for such sentinels
when returning the child mocks in the dir method as users won't
expect deleted attributes to appear when performing dir(mock).
(cherry picked from commit 0df635c)

Co-authored-by: Mario Corchero mariocj89@gmail.com

https://bugs.python.org/issue35082

When an attribute is deleted from a Mock, a sentinel is added rather
than just deleting the attribute. This commit checks for such sentinels
when returning the child mocks in the __dir__ method as users won't
expect deleted attributes to appear when performing dir(mock).
(cherry picked from commit 0df635c)

Co-authored-by: Mario Corchero <mariocj89@gmail.com>
@miss-islington
Copy link
Copy Markdown
Contributor Author

@mariocj89 and @cjw296: Status check is done, and it's a failure ❌ .

@asvetlov asvetlov changed the title [3.7] Don't report deleted attributes in __dir__ (GHGH-10148) [3.7] bpo-35082: Don't report deleted attributes in __dir__ (GH-10148) Jun 6, 2019
@miss-islington
Copy link
Copy Markdown
Contributor Author

@mariocj89 and @cjw296: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington
Copy link
Copy Markdown
Contributor Author

@mariocj89 and @cjw296: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 28be388 into python:3.7 Jun 6, 2019
@miss-islington miss-islington deleted the backport-0df635c-3.7 branch June 6, 2019 10:39
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