diff --git a/mercurial/thirdparty/zope/interface/interface.py b/mercurial/thirdparty/zope/interface/interface.py
index 0b17a0578a486739075d8245fbef8473e1c23e80_bWVyY3VyaWFsL3RoaXJkcGFydHkvem9wZS9pbnRlcmZhY2UvaW50ZXJmYWNlLnB5..7862a5ac35cf1528a4efbc72c07076741fd16197_bWVyY3VyaWFsL3RoaXJkcGFydHkvem9wZS9pbnRlcmZhY2UvaW50ZXJmYWNlLnB5 100644
--- a/mercurial/thirdparty/zope/interface/interface.py
+++ b/mercurial/thirdparty/zope/interface/interface.py
@@ -352,7 +352,14 @@
         # Make sure that all recorded attributes (and methods) are of type
         # `Attribute` and `Method`
         for name, attr in list(attrs.items()):
-            if name in ('__locals__', '__qualname__', '__annotations__'):
+            compiler_attributes = (
+                '__locals__',
+                '__qualname__',
+                '__annotations__',
+                '__firstlineno__',
+                '__static_attributes__',
+            )
+            if name in compiler_attributes:
                 # __locals__: Python 3 sometimes adds this.
                 # __qualname__: PEP 3155 (Python 3.3+)
                 # __annotations__: PEP 3107 (Python 3.0+)