Don't access other enum members from self

This is deprecated in Python 3.10.
Instead, acces them from the class.

Fixes https://github.com/mesonbuild/meson/issues/8318
0.57
Miro Hrončok 4 years ago committed by Nirbheek Chauhan
parent 667ebc4c2b
commit b4f4f3ab5b
  1. 7
      mesonbuild/backend/backends.py

@ -69,11 +69,12 @@ class TestProtocol(enum.Enum):
raise MesonException('unknown test format {}'.format(string))
def __str__(self) -> str:
if self is self.EXITCODE:
cls = type(self)
if self is cls.EXITCODE:
return 'exitcode'
elif self is self.GTEST:
elif self is cls.GTEST:
return 'gtest'
elif self is self.RUST:
elif self is cls.RUST:
return 'rust'
return 'tap'

Loading…
Cancel
Save