Skip to content

Commit 986a2cf

Browse files
committed
fix Python 3.14 deprecations
1 parent bacd688 commit 986a2cf

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

supvisors/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ def evaluate(self, node: ast.Expr) -> Union[bool, List[bool]]:
835835
return self._get_process_status(matches[0])
836836
elif len(matches) >= 1:
837837
return [self._get_process_status(x) for x in matches]
838-
raise ApplicationStatusParseError(f'no match for expression={node.s}')
838+
raise ApplicationStatusParseError(f'no match for expression={node.value}')
839839
# handle any/all functions
840840
if type(node) is ast.Call:
841841
if node.func.id not in ['all', 'any']:

supvisors/tests/test_eventinterface.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
# ======================================================================
16-
1716
import time
1817
from unittest.mock import call, Mock
1918

@@ -147,9 +146,13 @@ def subscriber(supvisors_instance, interface):
147146

148147
def test_event_subscriber_mainloop(subscriber):
149148
""" Test the EventSubscriber mainloop abstract method. """
149+
try:
150+
loop = asyncio.get_event_loop_policy().get_event_loop()
151+
except DeprecationWarning:
152+
loop = asyncio.get_event_loop_policy().new_event_loop()
150153
coro = subscriber.mainloop(asyncio.Event(), 'localhost', 7777)
151154
with pytest.raises(NotImplementedError):
152-
asyncio.get_event_loop().run_until_complete(coro)
155+
loop.run_until_complete(coro)
153156

154157

155158
async def mocked_loop(*args):

0 commit comments

Comments
 (0)