comparison mercurial/thirdparty/zope/interface/interface.py @ 52086:7862a5ac35cf stable

zope-interface: add compatibility with 3.13 compiler attributes We could follow-up with an actual vendoring update from the newest version of zope-interface in the new cycle since we're dropping 3.7 and down. However we are also in the process of replacing zope-interface with Protocol, so hopefully we can simply drop the zope-interface vendoring.
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 24 Oct 2024 18:58:58 +0200
parents 68ee61822182
children
comparison
equal deleted inserted replaced
52085:0b17a0578a48 52086:7862a5ac35cf
350 Specification.__init__(self, bases) 350 Specification.__init__(self, bases)
351 351
352 # Make sure that all recorded attributes (and methods) are of type 352 # Make sure that all recorded attributes (and methods) are of type
353 # `Attribute` and `Method` 353 # `Attribute` and `Method`
354 for name, attr in list(attrs.items()): 354 for name, attr in list(attrs.items()):
355 if name in ('__locals__', '__qualname__', '__annotations__'): 355 compiler_attributes = (
356 '__locals__',
357 '__qualname__',
358 '__annotations__',
359 '__firstlineno__',
360 '__static_attributes__',
361 )
362 if name in compiler_attributes:
356 # __locals__: Python 3 sometimes adds this. 363 # __locals__: Python 3 sometimes adds this.
357 # __qualname__: PEP 3155 (Python 3.3+) 364 # __qualname__: PEP 3155 (Python 3.3+)
358 # __annotations__: PEP 3107 (Python 3.0+) 365 # __annotations__: PEP 3107 (Python 3.0+)
359 del attrs[name] 366 del attrs[name]
360 continue 367 continue