> except win32serviceutil.error:
> print "Service already running!"
use win32service.error here. You will need to import win32service first.
Mark.
___
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/lis
Hammond [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 3:57 PM
To: Robin Siebler; [EMAIL PROTECTED]
Subject: RE: Exception handling
> def execute(testpath):
>
> try:
> win32file.CopyFile(os.path.join(testpath, 'test.log'),
> os.path.join('d:\\',
> def execute(testpath):
>
> try:
> win32file.CopyFile(os.path.join(testpath, 'test.log'),
> os.path.join('d:\\', 'iTest', 'iDir Simple Test', 'OutputData',
> 'test.log'),
> 1)
> except:
> return 0 #File already exists!
This works for me.
>>> try:
... win32file.CopyF
: Monday, June 25, 2001 5:54 PM
To: Robin Siebler; [EMAIL PROTECTED]
Subject: RE: Exception handling
> def start_service(service, machine):
> """Start a service"""
> win32serviceutil.StartService(service, machine)
> result = 1 #Service start
> error:
> api_error: (1056, 'StartService', 'An instance of the service is already
> running.')
>
> How would I use exception handling to catch this?
def start_service(service, machine):
"""Start a service"""
try:
the following
error:
api_error: (1056, 'StartService', 'An instance of the service is already
running.')
How would I use exception handling to catch this?
Thanks!
Robin L. Siebler
Software Test Engineer
iBeam
--