Commits

Victor Stinner  committed 878d2cb

Remove the ptrace.compatibility module

  • Participants
  • Parent commits 5205c9a

Comments (0)

Files changed (4)

 
  * Experimental support of Python 3 in the same code base
  * Drop support of Python 2.5
+ * Remove the ptrace.compatibility module
 
 python-ptrace 0.6.6 (2013-12-16)
 --------------------------------

File ptrace/compatibility.py

-"""
-Compatibility functions for Python 2.4.
-
-any() function
-==============
-
-any() returns True if at least one items is True, or False otherwise.
-
->>> any([False, True])
-True
->>> any([True, True])
-True
->>> any([False, False])
-False
-
-
-all() function
-==============
-
-all() returns True if all items are True, or False otherwise.
-This function is just apply binary and operator (&) on all values.
-
->>> all([True, True])
-True
->>> all([False, True])
-False
->>> all([False, False])
-False
-"""
-
-import operator
-
-# --- any() from Python 2.5 ---
-try:
-    from __builtin__ import any
-except ImportError:
-    def any(items):
-        for item in items:
-            if item:
-                return True
-        return False
-
-# ---all() from Python 2.5 ---
-try:
-    from __builtin__ import all
-except ImportError:
-    def all(items):
-        return reduce(operator.__and__, items)
-
-__all__ = ("any", "all")
-
 from optparse import OptionParser
 from logging import getLogger, error
 from ptrace.syscall.socketcall_constants import SOCKETCALL
-from ptrace.compatibility import any
 from ptrace.error import PTRACE_ERRORS, writeError
 from ptrace.ctypes_tools import formatAddress
 import re
     #testDoc('doc/c_tools.rst')
 
     # Test documentation of some functions/classes
-    testModule("ptrace.compatibility")
     testModule("ptrace.tools")
     testModule("ptrace.signames")
     testModule("ptrace.logging_tools")