From 4ff089832a271bfac851af7edbd4f31dac1df654 Mon Sep 17 00:00:00 2001 From: Martin Li Date: Wed, 11 Feb 2026 18:21:17 -0800 Subject: [PATCH] Update assertRaisesRegex pattern for Python 3.12 compatibility (#17396) Summary: Python 3.12 changed the error message for read-only property assignment from "can't set attribute 'spec'" to "property 'spec' of ... object has no setter". Update the regex pattern to match both versions. Differential Revision: D92997414 --- exir/backend/test/test_partitioner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exir/backend/test/test_partitioner.py b/exir/backend/test/test_partitioner.py index dedcfe52966..af1bd4d8aea 100644 --- a/exir/backend/test/test_partitioner.py +++ b/exir/backend/test/test_partitioner.py @@ -106,7 +106,7 @@ def partition( with self.assertRaisesRegex( AttributeError, - "can't set attribute 'spec'", + "(can't set attribute 'spec'|has no setter)", ): my_partitioner.spec = {"new_key": "new_value"}