Nathan2055
Nathan2055

Reputation: 2373

Why is the compileall module not working?

I'm testing compiling Python code, but when I run the compileall module on a directory with a test file in it, it skips the directory and goes and compiles the Standard Library for some reason. Why is it doing this?

Upvotes: 2

Views: 4205

Answers (1)

Cairnarvon
Cairnarvon

Reputation: 27752

You're running python -m compileall without specifying a directory, and the module is doing exactly what the documentation says it should: compiling every directory in sys.path.

To compile only the directory you're currently in, pass it on the command line:

$ python -m compileall .

Upvotes: 9

Related Questions