Add missing default to .set_extension (#2297)

Failing to set a default, method, or getter results in a ValueError:

ValueError: [E083] Error setting extension: only one of `default`, `method`, or `getter` (plus optional `setter`) is allowed. Got: 0
This commit is contained in:
Matt Upson 2018-05-04 17:47:02 +01:00 committed by Ines Montani
parent 929a01139a
commit 9a1d3b63fb
1 changed files with 3 additions and 3 deletions

View File

@ -68,9 +68,9 @@ class RESTCountriesComponent(object):
# the matches, so we're only setting a default value, not a getter.
# If no default value is set, it defaults to None.
Token.set_extension('is_country', default=False)
Token.set_extension('country_capital')
Token.set_extension('country_latlng')
Token.set_extension('country_flag')
Token.set_extension('country_capital', default=False)
Token.set_extension('country_latlng', default=False)
Token.set_extension('country_flag', default=False)
# Register attributes on Doc and Span via a getter that checks if one of
# the contained tokens is set to is_country == True.