Skip to content

Commit e8b3edf

Browse files
committed
covert staticmethod to instance method
1 parent a6c186b commit e8b3edf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

readthedocs/config/config.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,17 @@ def __init__(self, key, code, error_message, source_file=None):
114114
self.code = code
115115
self.source_file = source_file
116116
message = self.message_template.format(
117-
key=self._get_display_key(key),
117+
key=self._get_display_key(),
118118
code=code,
119119
error=error_message,
120120
)
121121
super().__init__(message, code=code)
122122

123-
@staticmethod
124-
def _get_display_key(key):
123+
def _get_display_key(self):
125124
# Checks for patterns similar to `python.install.0.requirements`
126125
# if matched change to `python.install[0].requirements` using backreference.
127126
return re.sub(
128-
r'^(python\.install)(\.)(\d+)(\.\w+)$', r'\1[\3]\4', key
127+
r'^(python\.install)(\.)(\d+)(\.\w+)$', r'\1[\3]\4', self.key
129128
)
130129

131130

0 commit comments

Comments
 (0)