From: Brett Cannon Date: Sat, 10 May 2008 02:58:26 +0000 (+0000) Subject: Deprecate the compiler package for removal in 3.0. X-Git-Tag: v2.6b1~538 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6192df10b6c5d157735feefc591e90a61c4000c0;p=python Deprecate the compiler package for removal in 3.0. --- diff --git a/Doc/library/compiler.rst b/Doc/library/compiler.rst index fd5fd6c34e..7aac3b8042 100644 --- a/Doc/library/compiler.rst +++ b/Doc/library/compiler.rst @@ -5,6 +5,9 @@ Python compiler package *********************** +.. deprecated:: 2.6 + The compiler package has been removed in Python 3.0. + .. sectionauthor:: Jeremy Hylton @@ -34,6 +37,7 @@ The basic interface .. module:: compiler :synopsis: Python code compiler written in Python. + :deprecated: The top-level of the package defines four functions. If you import diff --git a/Lib/compiler/__init__.py b/Lib/compiler/__init__.py index ce89144b73..d75140aa72 100644 --- a/Lib/compiler/__init__.py +++ b/Lib/compiler/__init__.py @@ -20,6 +20,9 @@ compile(source, filename, mode, flags=None, dont_inherit=None) 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 diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py index d491b78096..390c4697ee 100644 --- a/Lib/test/test_compiler.py +++ b/Lib/test/test_compiler.py @@ -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 diff --git a/Misc/NEWS b/Misc/NEWS index 6b93568807..2aa7576aa6 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -23,6 +23,8 @@ Extension Modules 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.