diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-20 19:35:06 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-20 19:35:06 (GMT) |
commit | ab0ac27d24076a2a09e3d8de97055a2fc978709f (patch) | |
tree | b0d5a4be76eb6122b30ebbdd801c7f82bddec8b3 /Lib | |
parent | 679688e70d29fad62bb7a07e682ef6966c489445 (diff) | |
parent | 7e52705ee362001a8761461e9c4d49e3873568e0 (diff) | |
download | cpython-ab0ac27d24076a2a09e3d8de97055a2fc978709f.zip cpython-ab0ac27d24076a2a09e3d8de97055a2fc978709f.tar.gz cpython-ab0ac27d24076a2a09e3d8de97055a2fc978709f.tar.bz2 |
Issue #20315: Removed support for backward compatibility with early 2.x versions.
Removed backward compatibility alias curses.window.nooutrefresh which should
be removed in 2.3.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/configparser.py | 17 | ||||
-rw-r--r-- | Lib/modulefinder.py | 29 | ||||
-rw-r--r-- | Lib/optparse.py | 10 | ||||
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 3 |
4 files changed, 3 insertions, 56 deletions
diff --git a/Lib/configparser.py b/Lib/configparser.py index 794f857..c0752ce 100644 --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -144,23 +144,6 @@ MAX_INTERPOLATION_DEPTH = 10 class Error(Exception): """Base class for ConfigParser exceptions.""" - def _get_message(self): - """Getter for 'message'; needed only to override deprecation in - BaseException. - """ - return self.__message - - def _set_message(self, value): - """Setter for 'message'; needed only to override deprecation in - BaseException. - """ - self.__message = value - - # BaseException.message has been deprecated since Python 2.6. To prevent - # DeprecationWarning from popping up over this pre-existing attribute, use - # a new property that takes lookup precedence. - message = property(_get_message, _set_message) - def __init__(self, msg=''): self.message = msg Exception.__init__(self, msg) diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index ebd068a..b19941e 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -335,30 +335,6 @@ class ModuleFinder: fullname = name + "." + sub self._add_badmodule(fullname, caller) - def scan_opcodes(self, co, - unpack = struct.unpack): - # Scan the code, and yield 'interesting' opcode combinations - # Version for Python 2.4 and older - code = co.co_code - names = co.co_names - consts = co.co_consts - while code: - c = code[0] - if c in STORE_OPS: - oparg, = unpack('<H', code[1:3]) - yield "store", (names[oparg],) - code = code[3:] - continue - if c == LOAD_CONST and code[3] == IMPORT_NAME: - oparg_1, oparg_2 = unpack('<xHxH', code[:6]) - yield "import", (consts[oparg_1], names[oparg_2]) - code = code[6:] - continue - if c >= HAVE_ARGUMENT: - code = code[3:] - else: - code = code[1:] - def scan_opcodes_25(self, co, unpack = struct.unpack): # Scan the code, and yield 'interesting' opcode combinations @@ -390,10 +366,7 @@ class ModuleFinder: def scan_code(self, co, m): code = co.co_code - if sys.version_info >= (2, 5): - scanner = self.scan_opcodes_25 - else: - scanner = self.scan_opcodes + scanner = self.scan_opcodes_25 for what, args in scanner(co): if what == "store": name, = args diff --git a/Lib/optparse.py b/Lib/optparse.py index be0145f..432a2eb 100644 --- a/Lib/optparse.py +++ b/Lib/optparse.py @@ -645,14 +645,8 @@ class Option: self.type = "string" else: # Allow type objects or builtin type conversion functions - # (int, str, etc.) as an alternative to their names. (The - # complicated check of builtins is only necessary for - # Python 2.1 and earlier, and is short-circuited by the - # first check on modern Pythons.) - import builtins - if ( isinstance(self.type, type) or - (hasattr(self.type, "__name__") and - getattr(builtins, self.type.__name__, None) is self.type) ): + # (int, str, etc.) as an alternative to their names. + if isinstance(self.type, type): self.type = self.type.__name__ if self.type == "str": diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 5cc767b..06d3ca9 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -695,9 +695,6 @@ class _TestQueue(BaseTestCase): def test_task_done(self): queue = self.JoinableQueue() - if sys.version_info < (2, 5) and not hasattr(queue, 'task_done'): - self.skipTest("requires 'queue.task_done()' method") - workers = [self.Process(target=self._test_task_done, args=(queue,)) for i in range(4)] |