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 @@ -318,6 +318,26 @@ def test_unknown_destination_command(self):
318
318
msg = "unknown destination command 'nosuchcommand'"
319
319
self .assertIn (msg , out )
320
320
321
+ def test_no_access_to_members_in_converter_init (self ):
322
+ out = self .expect_failure ("""
323
+ /*[python input]
324
+ class Custom_converter(CConverter):
325
+ converter = "some_c_function"
326
+ def converter_init(self):
327
+ self.function.noaccess
328
+ [python start generated code]*/
329
+ /*[clinic input]
330
+ module test
331
+ test.fn
332
+ a: Custom
333
+ [clinic start generated code]*/
334
+ """ )
335
+ msg = (
336
+ "Stepped on a land mine, trying to access attribute 'noaccess':\n "
337
+ "Don't access members of self.function inside converter_init!"
338
+ )
339
+ self .assertIn (msg , out )
340
+
321
341
322
342
class ClinicGroupPermuterTest (TestCase ):
323
343
def _test (self , l , m , r , output ):
You can’t perform that action at this time.
0 commit comments