-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix name conflict between abc.ABC.register and fields named register.
Summary: # What? If a thrift type has a field named `register`, the call to register it with the abstract base class fails because the python class has a property named register. `TestRegisterAsField` in `special_cases.thrift` is a test for this case. ``` buck2 test fbcode//thrift/lib/python/test:special_cases_test ``` will fail due to the error ``` TypeError: 'property' object is not callable ``` # What to do? Per python's official documentation, `abc.ABCMeta` provides [register](https://docs.python.org/3/library/abc.html#abc.ABCMeta.register). Rather than the `register` method available on the abstract base class, use this method directly to register the virtual subclass. # Generate fixtures ``` buck2 run fbcode//thrift/compiler/test:build_fixtures ``` Reviewed By: Filip-F Differential Revision: D66739239 fbshipit-source-id: 72fb5948b7b633559458a8589fc28b1f6512a10e
- Loading branch information
1 parent
3472a20
commit b906a1f
Showing
35 changed files
with
450 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.