poketrainer icon indicating copy to clipboard operation
poketrainer copied to clipboard

Runtime error in CLSniper.py

Open piprees opened this issue 8 years ago • 3 comments

Getting the following error on windows when using the latest develop branch's "CLSniper.py"

RuntimeError:
Attempt to start a new process before the current process
has finished its bootstrapping phase.
This probably means that you are on Windows and you have
forgotten to use the proper idiom in the main module:
 if __name__ == '__main__':
freeze_support()
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce a Windows executable.

Seems like the code isn't windows compatible?

piprees avatar Aug 12 '16 14:08 piprees

I have no idea. tested on linux. I'll mark as help wanted because I wouldn't know how to solve this.

stolencatkarma avatar Aug 12 '16 19:08 stolencatkarma

You can test for os and then decide whether to run freeze_support().

Sorta related, but @infinitewarp, do we test builds on windows?

rirze avatar Aug 12 '16 19:08 rirze

Unfortunately, I don't have access to a Windows machine for testing.

FWIW: https://docs.python.org/2/library/multiprocessing.html#multiprocessing.freeze_support

Calling freeze_support() has no effect when invoked on any operating system other than Windows. In addition, if the module is being run normally by the Python interpreter on Windows (the program has not been frozen), then freeze_support() has no effect.

@teh3vil How exactly are you executing the program? Are you invoking it with the python command from the terminal or double-clicking it or something else?

infinitewarp avatar Aug 14 '16 01:08 infinitewarp