The current implementation of LoadPythonServiceClass appends the target module's directory to sys.path.
This means that if the target module's name is shadowed by that of another module already on sys.path, that shadowing module will be imported instead, leading to a cryptic "Python could not find the service class in the module" error logged to the Application event log.
As an example, attempting to load the module "C:\Python27\lib\site-packages\pywinservice_example\test.py" loads the module "C:\Python27\lib\test\__init__.pyc" instead.
This patch changes the logic to insert the module's directory at the beginning of sys.path, then remove it after attempting to import the module.
The upside is that formerly shadowed module names (like "test.py") are now usable as service module names. The downside is that if the service module attempts to import another module with the same name, the service module itself will be imported instead.