pykd/test/scripts/testutils.py
SND\EreTIk_cp aee8b2b1b8 [0.2.x] ~recovered WaitEventException
git-svn-id: https://pykd.svn.codeplex.com/svn@83541 9b283d60-5439-405e-af05-b73fd8c4d996
2017-11-08 17:42:50 +04:00

31 lines
655 B
Python

"""PyKd test heplers/wrappers"""
import pykd
class ContextCallIt:
"""Context manager/with statement"""
def __init__(self, callIt):
self.callIt = callIt
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, exc_tb):
try: self.callIt()
except: pass
class KillProcess:
"""Kill process"""
def __init__(self, processId):
self.processId = processId
def __call__(self):
pykd.killProcess( self.processId )
pykd.detachProcess( self.processId )
def infGo():
"""Infinite pykd.go call"""
while True:
pykd.go()