File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Original file line number Diff line number Diff line change @@ -314,6 +314,26 @@ def test_unknown_destination_command(self):
314
314
msg = "unknown destination command 'nosuchcommand'"
315
315
self .assertIn (msg , out )
316
316
317
+ def test_no_access_to_members_in_converter_init (self ):
318
+ out = self .expect_failure ("""
319
+ /*[python input]
320
+ class Custom_converter(CConverter):
321
+ converter = "some_c_function"
322
+ def converter_init(self):
323
+ self.function.noaccess
324
+ [python start generated code]*/
325
+ /*[clinic input]
326
+ module test
327
+ test.fn
328
+ a: Custom
329
+ [clinic start generated code]*/
330
+ """ )
331
+ msg = (
332
+ "Stepped on a land mine, trying to access attribute 'noaccess':\n "
333
+ "Don't access members of self.function inside converter_init!"
334
+ )
335
+ self .assertIn (msg , out )
336
+
317
337
318
338
class ClinicGroupPermuterTest (TestCase ):
319
339
def _test (self , l , m , r , output ):
You can’t perform that action at this time.
0 commit comments