New submission from Eric O. LEBIGOT <eric.lebi...@normalesup.org>:

When creating a .pyo file (either with -O or -OO) and removing any .pyc or .py 
original file, import <module_name> complains with "No module called 
<module_name>".  The import does work with .pyc files.

I'm not sure that this is the correct behavior, as the documentation does not 
seem to make any difference between .pyc and .pyo files on this point:

"It is possible to have a file called spam.pyc (or spam.pyo when -O is used) 
without a file spam.py for the same module. This can be used to distribute a 
library of Python code in a form that is moderately hard to reverse engineer."

----------
components: Interpreter Core
messages: 144049
nosy: lebigot
priority: normal
severity: normal
status: open
title: .pyo file cannot be imported
type: compile error
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12982>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to