[Python-checkins] r62977 - in python/trunk: Doc/library/compiler.rst Lib/compiler/__init__.py Lib/test/test_compiler.py Misc/NEWS
brett.cannon
python-checkins at python.org
Sat May 10 04:58:27 CEST 2008
Author: brett.cannon
Date: Sat May 10 04:58:26 2008
New Revision: 62977
Log:
Deprecate the compiler package for removal in 3.0.
Modified:
python/trunk/Doc/library/compiler.rst
python/trunk/Lib/compiler/__init__.py
python/trunk/Lib/test/test_compiler.py
python/trunk/Misc/NEWS
Modified: python/trunk/Doc/library/compiler.rst
==============================================================================
--- python/trunk/Doc/library/compiler.rst (original)
+++ python/trunk/Doc/library/compiler.rst Sat May 10 04:58:26 2008
@@ -5,6 +5,9 @@
Python compiler package
***********************
+.. deprecated:: 2.6
+ The compiler package has been removed in Python 3.0.
+
.. sectionauthor:: Jeremy Hylton <jeremy at zope.com>
@@ -34,6 +37,7 @@
.. module:: compiler
:synopsis: Python code compiler written in Python.
+ :deprecated:
The top-level of the package defines four functions. If you import
Modified: python/trunk/Lib/compiler/__init__.py
==============================================================================
--- python/trunk/Lib/compiler/__init__.py (original)
+++ python/trunk/Lib/compiler/__init__.py Sat May 10 04:58:26 2008
@@ -20,6 +20,9 @@
compileFile(filename)
Generates a .pyc file by compiling filename.
"""
+from warnings import warnpy3k
+warnpy3k("the compiler package has been removed in Python 3.0", stacklevel=2)
+del warnpy3k
from compiler.transformer import parse, parseFile
from compiler.visitor import walk
Modified: python/trunk/Lib/test/test_compiler.py
==============================================================================
--- python/trunk/Lib/test/test_compiler.py (original)
+++ python/trunk/Lib/test/test_compiler.py Sat May 10 04:58:26 2008
@@ -1,7 +1,7 @@
-import compiler
+import test.test_support
+compiler = test.test_support.import_module('compiler', deprecated=True)
from compiler.ast import flatten
import os, sys, time, unittest
-import test.test_support
from random import random
from StringIO import StringIO
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS (original)
+++ python/trunk/Misc/NEWS Sat May 10 04:58:26 2008
@@ -23,6 +23,8 @@
Library
-------
+- The compiler package has been deprecated for removal in Python 3.0.
+
- The Bastion and rexec modules have been deprecated for removal in Python 3.0.
- The bsddb185 module has been deprecated for removal in Python 3.0.
More information about the Python-checkins
mailing list