summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/fpformat.rst5
-rw-r--r--Lib/fpformat.py3
-rw-r--r--Lib/test/test_fpformat.py5
-rw-r--r--Lib/test/test_py3kwarn.py2
-rw-r--r--Misc/NEWS2
5 files changed, 14 insertions, 3 deletions
diff --git a/Doc/library/fpformat.rst b/Doc/library/fpformat.rst
index 6627c81..e82e164 100644
--- a/Doc/library/fpformat.rst
+++ b/Doc/library/fpformat.rst
@@ -4,6 +4,11 @@
.. module:: fpformat
:synopsis: General floating point formatting functions.
+ :deprecated:
+
+.. deprecated:: 2.6
+ The fpformat module has been removed in Python 3.0.
+
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
diff --git a/Lib/fpformat.py b/Lib/fpformat.py
index 0ae86a9..71cbb25 100644
--- a/Lib/fpformat.py
+++ b/Lib/fpformat.py
@@ -10,6 +10,9 @@ Parameters:
x: number to be formatted; or a string resembling a number
digits_behind: number of digits behind the decimal point
"""
+from warnings import warnpy3k
+warnpy3k("the fpformat module has been removed in Python 3.0", stacklevel=2)
+del warnpy3k
import re
diff --git a/Lib/test/test_fpformat.py b/Lib/test/test_fpformat.py
index a1b8722..a951cd0 100644
--- a/Lib/test/test_fpformat.py
+++ b/Lib/test/test_fpformat.py
@@ -2,9 +2,10 @@
Tests for fpformat module
Nick Mathewson
'''
-from test.test_support import run_unittest
+from test.test_support import run_unittest, import_module
import unittest
-from fpformat import fix, sci, NotANumber
+fpformat = import_module('fpformat', deprecated=True)
+fix, sci, NotANumber = fpformat.fix, fpformat.sci, fpformat.NotANumber
StringType = type('')
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index 30f1668..8c3c857 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -129,7 +129,7 @@ class TestStdlibRemovals(unittest.TestCase):
# test.testall not tested as it executes all unit tests as an
# import side-effect.
all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec',
- 'Bastion', 'compiler', 'dircache')
+ 'Bastion', 'compiler', 'dircache', 'fpformat')
inclusive_platforms = {'irix':('pure',)}
# XXX Don't know if lib-tk is only installed if _tkinter is built.
optional_modules = ('bsddb185', 'Canvas', 'dl')
diff --git a/Misc/NEWS b/Misc/NEWS
index c783d27..c1a3038 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -23,6 +23,8 @@ Extension Modules
Library
-------
+- The fpformat module has been deprecated for removal in Python 3.0.
+
- The dl module has been deprecated for removal in Python 3.0.
- The Canvas module has been deprecated for removal in Python 3.0.