def test_bad_stuff():
 import sys
 Assert((sys.winver != 'HIJACKED'))
 import re
 Assert((re.compile != 'HIJACKED'))
 try:
  import fooCORRUPT
  raise Exception('Corrupted DLL was loaded')
 except ImportError as e:
  pass
 import fooDLLEXE
 AreEqual(fooDLLEXE.Foo().BAR, 1)
 try:
  import fooEXEONLY
  raise Exception("*.exe's should not be autoloaded!")
 except ImportError as e:
  pass
 except SystemError as e:
  print 'Work Item #189503'
 try:
  import fooTXTDLL
  raise Exception("*.txt's should not be autoloaded!")
 except ImportError as e:
  pass

def test_bad_stuff ( ) : import sys Assert ( ( sys . winver != 'HIJACKED' ) ) import re Assert ( ( re . compile != 'HIJACKED' ) ) try : import fooCORRUPT raise Exception ( 'Corrupted DLL was loaded' ) except ImportError as e : pass import fooDLLEXE AreEqual ( fooDLLEXE . Foo ( ) . BAR , 1 ) try : import fooEXEONLY raise Exception ( "*.exe's should not be autoloaded!" ) except ImportError as e : pass except SystemError as e : print 'Work Item #189503' try : import fooTXTDLL raise Exception ( "*.txt's should not be autoloaded!" ) except ImportError as e : pass
cases where ip should not load an assembly for one reason or another .