~ubuntu-branches/ubuntu/precise/python3.2/precise-proposed

« back to all changes in this revision

Viewing changes to Lib/distutils/util.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-09 18:40:39 UTC
  • mfrom: (30.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120309184039-j3yk2emxr1plyo21
Tags: 3.2.3~rc1-1
* Python 3.2.3 release candidate 1.
* Update to 20120309 from the 3.2 branch.
* Fix libpython.a symlink. Closes: #660146.
* Build-depend on xauth.
* Run the gdb tests for the debug build only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
one of the other *util.py modules.
5
5
"""
6
6
 
7
 
import sys, os, string, re
 
7
import os
 
8
import re
 
9
import imp
 
10
import sys
 
11
import string
8
12
from distutils.errors import DistutilsPlatformError
9
13
from distutils.dep_util import newer
10
14
from distutils.spawn import spawn
73
77
        if release[0] >= "5":           # SunOS 5 == Solaris 2
74
78
            osname = "solaris"
75
79
            release = "%d.%s" % (int(release[0]) - 3, release[2:])
 
80
            # We can't use "platform.architecture()[0]" because a
 
81
            # bootstrap problem. We use a dict to get an error
 
82
            # if some suspicious happens.
 
83
            bitness = {2147483647:"32bit", 9223372036854775807:"64bit"}
 
84
            machine += ".%s" % bitness[sys.maxsize]
76
85
        # fall through to standard osname-release-machine representation
77
86
    elif osname[:4] == "irix":              # could be "irix64"!
78
87
        return "%s-%s" % (osname, release)
415
424
                  verbose=1, dry_run=0,
416
425
                  direct=None):
417
426
    """Byte-compile a collection of Python source files to either .pyc
418
 
    or .pyo files in the same directory.  'py_files' is a list of files
419
 
    to compile; any files that don't end in ".py" are silently skipped.
420
 
    'optimize' must be one of the following:
 
427
    or .pyo files in a __pycache__ subdirectory.  'py_files' is a list
 
428
    of files to compile; any files that don't end in ".py" are silently
 
429
    skipped.  'optimize' must be one of the following:
421
430
      0 - don't optimize (generate .pyc)
422
431
      1 - normal optimization (like "python -O")
423
432
      2 - extra optimization (like "python -OO")
529
538
            # Terminology from the py_compile module:
530
539
            #   cfile - byte-compiled file
531
540
            #   dfile - purported source filename (same as 'file' by default)
532
 
            cfile = file + (__debug__ and "c" or "o")
 
541
            if optimize >= 0:
 
542
                cfile = imp.cache_from_source(file, debug_override=not optimize)
 
543
            else:
 
544
                cfile = imp.cache_from_source(file)
533
545
            dfile = file
534
546
            if prefix:
535
547
                if file[:len(prefix)] != prefix: