Nested waitSignal statement of work process

Hi,

How can I write a nested waitSignal statement and use the “and operator” like the example below.

if condition1 and condition2:
if condition3:
#do caseA
else
#do caseB
else:
#do caseC


I tried this but there is an error “Traceback (most recent call last):
File “Works Process::OnRun”, line 363, in OnRun
File “Works Process::OnRun”, line 461, in call_WT
File “Works Process::OnRun”, line 402, in call_WT
File “Works Process::OnRun”, line 1877, in WT__WaitSignal
RuntimeError: maximum recursion depth exceeded”

Thanks in advance!