.pyo's without .pyc's?

Randall Hopper aa8vb at yahoo.com
Wed May 26 14:01:37 EDT 1999


I'm trying to cook a minimalist Python install, and I find that python -O
won't run without .pyc's in-place, even when there are pyo's.

I thought pyc's were the straight-compiled version, pyo's were the
optimized version, and they were independent.  Is this correct?

To be specific:

     Python-1.5.2 > ff 'os.*'
          ./lib/python1.5/os.pyo
          ./lib/python1.5/os.pyc

     Python-1.5.2 > python
          Python 1.5.2 (#2, May 26 1999, 12:25:54) [C] on irix646-n32
          Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
          >>> ^D

     Python-1.5.2 > find . -name '*.pyc' | xargs rm

     Python-1.5.2 > python -O
          'import exceptions' failed; use -v for traceback
          Warning!  Falling back to string-based exceptions

Trying to run a python script with -O fails on other modules (os for example).

-- 
Randall Hopper
aa8vb at yahoo.com




More information about the Python-list mailing list