summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBatuhan Taşkaya <batuhanosmantaskaya@gmail.com>2020-04-13 23:51:32 (GMT)
committerGitHub <noreply@github.com>2020-04-13 23:51:32 (GMT)
commit990ea4200f05fcd8bce3de363f4d7745ae142385 (patch)
treebfc217385ff3cf46a0a8e925a8b1d7dbbe2a8d20
parenta1a0eb4a394a5ac7a8422616ce1ee4125a3ef74f (diff)
downloadcpython-990ea4200f05fcd8bce3de363f4d7745ae142385.zip
cpython-990ea4200f05fcd8bce3de363f4d7745ae142385.tar.gz
cpython-990ea4200f05fcd8bce3de363f4d7745ae142385.tar.bz2
bpo-40208: Remove deprecated has_exec method of SymbolTable (GH-19396)
-rw-r--r--Doc/library/symtable.rst4
-rw-r--r--Doc/whatsnew/3.9.rst4
-rw-r--r--Lib/symtable.py4
-rw-r--r--Lib/test/test_symtable.py1
-rw-r--r--Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst1
5 files changed, 5 insertions, 9 deletions
diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst
index 7c6ac4d..3efdecb 100644
--- a/Doc/library/symtable.rst
+++ b/Doc/library/symtable.rst
@@ -67,10 +67,6 @@ Examining Symbol Tables
Return ``True`` if the block has nested namespaces within it. These can
be obtained with :meth:`get_children`.
- .. method:: has_exec()
-
- Return ``True`` if the block uses ``exec``.
-
.. method:: get_identifiers()
Return a list of names of symbols in this table.
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index 1bbcae3..afb099a 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -753,6 +753,10 @@ Removed
the ``__annotations__`` attribute instead.
(Contributed by Serhiy Storchaka in :issue:`40182`.)
+* The :meth:`symtable.SymbolTable.has_exec` method has been removed. It was
+ deprecated since 2006, and only returning ``False`` when it's called.
+ (Contributed by Batuhan Taskaya in :issue:`40208`)
+
Porting to Python 3.9
=====================
diff --git a/Lib/symtable.py b/Lib/symtable.py
index ac0a64f..a711676 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -82,10 +82,6 @@ class SymbolTable(object):
def has_children(self):
return bool(self._table.children)
- def has_exec(self):
- """Return true if the scope uses exec. Deprecated method."""
- return False
-
def get_identifiers(self):
return self._table.symbols.keys()
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
index 98d718c..d193558 100644
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -65,7 +65,6 @@ class SymtableTest(unittest.TestCase):
def test_optimized(self):
self.assertFalse(self.top.is_optimized())
- self.assertFalse(self.top.has_exec())
self.assertTrue(self.spam.is_optimized())
diff --git a/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst b/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst
new file mode 100644
index 0000000..a06d5ea
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst
@@ -0,0 +1 @@
+Remove deprecated :meth:`symtable.SymbolTable.has_exec`.