[3.12] typing tests: remove some unnecessary uses of exec() (GH-119005)
#119039
+9
−19
exec() (GH-119005)
#119039