Skip to content

Commit

Permalink
Remove Py3 redundant object inheritance (#1307)
Browse files Browse the repository at this point in the history
  • Loading branch information
disconnect3d committed Dec 17, 2018
1 parent 580b358 commit b399080
Show file tree
Hide file tree
Showing 29 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion manticore/core/executor.py
Expand Up @@ -40,7 +40,7 @@ def newFunction(self, *args, **kw):
return newFunction


class Policy(object):
class Policy:
''' Base class for prioritization of state search '''

def __init__(self, executor, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion manticore/core/smtlib/constraints.py
Expand Up @@ -9,7 +9,7 @@
logger = logging.getLogger(__name__)


class ConstraintSet(object):
class ConstraintSet:
''' Constraint Sets
An object containing a set of constraints. Serves also as a factory for
Expand Down
2 changes: 1 addition & 1 deletion manticore/core/smtlib/expression.py
Expand Up @@ -2,7 +2,7 @@
import uuid


class Expression(object):
class Expression:
''' Abstract taintable Expression. '''

def __init__(self, taint=()):
Expand Down
2 changes: 1 addition & 1 deletion manticore/core/smtlib/visitors.py
Expand Up @@ -6,7 +6,7 @@
logger = logging.getLogger(__name__)


class Visitor(object):
class Visitor:
''' Class/Type Visitor
Inherit your class visitor from this one and get called on a different
Expand Down
2 changes: 1 addition & 1 deletion manticore/ethereum/abi.py
Expand Up @@ -12,7 +12,7 @@
logger = logging.getLogger(__name__)


class ABI(object):
class ABI:
"""
This class contains methods to handle the ABI.
The Application Binary Interface is the standard way to interact with
Expand Down
2 changes: 1 addition & 1 deletion manticore/ethereum/account.py
Expand Up @@ -8,7 +8,7 @@
HashesEntry = namedtuple('HashesEntry', 'signature func_id')


class EVMAccount(object):
class EVMAccount:
def __init__(self, address=None, manticore=None, name=None):
""" Encapsulates an account.
Expand Down
2 changes: 1 addition & 1 deletion manticore/ethereum/solidity.py
Expand Up @@ -6,7 +6,7 @@
from ..utils.deprecated import deprecated


class SolidityMetadata(object):
class SolidityMetadata:

@staticmethod
def function_signature_for_name_and_inputs(name: str, inputs: Sequence[Mapping[str, Any]]) -> str:
Expand Down
8 changes: 4 additions & 4 deletions manticore/native/cpu/abstractcpu.py
Expand Up @@ -96,11 +96,11 @@ def __init__(self, cpu, argnum, policy='MINMAX'):
SANE_SIZES = {8, 16, 32, 64, 80, 128, 256}


class Operand(object):
class Operand:
"""This class encapsulates how to access operands (regs/mem/immediates) for
different CPUs
"""
class MemSpec(object):
class MemSpec:
'''
Auxiliary class wraps capstone operand 'mem' attribute. This will
return register names instead of Ids
Expand Down Expand Up @@ -182,7 +182,7 @@ def write(self, value):
# only from the cpu implementation


class RegisterFile(object):
class RegisterFile:
def __init__(self, aliases=None):
# dict mapping from alias register name ('PC') to actual register
# name ('RIP')
Expand Down Expand Up @@ -235,7 +235,7 @@ def __contains__(self, register):
return self._alias(register) in self.all_registers


class Abi(object):
class Abi:
'''
Represents the ability to extract arguments from the environment and write
back a result.
Expand Down
2 changes: 1 addition & 1 deletion manticore/native/cpu/cpufactory.py
Expand Up @@ -2,7 +2,7 @@
from .arm import Armv7Cpu, Armv7CdeclAbi, Armv7LinuxSyscallAbi


class CpuFactory(object):
class CpuFactory:
_cpus = {
'i386': I386Cpu,
'amd64': AMD64Cpu,
Expand Down
4 changes: 2 additions & 2 deletions manticore/native/cpu/disasm.py
Expand Up @@ -3,7 +3,7 @@
import capstone as cs


class Instruction(object):
class Instruction:
"""Capstone-like instruction to be used internally
"""
@property
Expand Down Expand Up @@ -43,7 +43,7 @@ def name(self):
pass


class Disasm(object):
class Disasm:
"""Abstract class for different disassembler interfaces"""

def __init__(self, disasm):
Expand Down
2 changes: 1 addition & 1 deletion manticore/native/cpu/register.py
@@ -1,7 +1,7 @@
from ...core.smtlib import Operators, BitVec, Bool


class Register(object):
class Register:
'''
Generic variable width register. For 1 bit registers, allows writes of types
bool and int, but always reads back bools.
Expand Down
4 changes: 2 additions & 2 deletions manticore/platforms/decree.py
Expand Up @@ -29,7 +29,7 @@ def __init__(self, cpu, number, message='Concretizing syscall argument', policy=
super().__init__(cpu, reg_name, message, policy)


class Socket(object):
class Socket:
@staticmethod
def pair():
a = Socket()
Expand Down Expand Up @@ -1056,7 +1056,7 @@ def sys_random(self, cpu, buf, count, rnd_bytes):
return 0


class DecreeEmu(object):
class DecreeEmu:

RANDOM = 0

Expand Down
4 changes: 2 additions & 2 deletions manticore/platforms/evm.py
Expand Up @@ -50,7 +50,7 @@ def to_signed(i):
return Operators.ITEBV(256, i < TT255, i, i - TT256)


class Transaction(object):
class Transaction:
__slots__ = '_sort', 'address', 'price', 'data', 'caller', 'value', 'depth', '_return_data', '_result', 'gas'

def __init__(self, sort, address, price, data, caller, value, gas=0, depth=None, result=None, return_data=None):
Expand Down Expand Up @@ -408,7 +408,7 @@ class EVM(Eventful):
'evm_read_code',
'decode_instruction', 'execute_instruction', 'concrete_sha3', 'symbolic_sha3'}

class transact(object):
class transact:
"Emulate PyProperty_Type() in Objects/descrobject.c"

def __init__(self, pre=None, pos=None, doc=None):
Expand Down
6 changes: 3 additions & 3 deletions manticore/platforms/linux.py
Expand Up @@ -62,7 +62,7 @@ def mode_from_flags(file_flags):
return {os.O_RDWR: 'rb+', os.O_RDONLY: 'rb', os.O_WRONLY: 'wb'}[file_flags & 7]


class File(object):
class File:
def __init__(self, path, flags):
# TODO: assert file is seekable; otherwise we should save what was
# read from/written to the state
Expand Down Expand Up @@ -305,7 +305,7 @@ def write(self, data):
self.array[i] = data[i - self.pos]


class SocketDesc(object):
class SocketDesc:
'''
Represents a socket descriptor (i.e. value returned by socket(2)
'''
Expand All @@ -316,7 +316,7 @@ def __init__(self, domain=None, socket_type=None, protocol=None):
self.protocol = protocol


class Socket(object):
class Socket:
def stat(self):
from collections import namedtuple
stat_result = namedtuple('stat_result', ['st_mode', 'st_ino', 'st_dev', 'st_nlink', 'st_uid', 'st_gid',
Expand Down
2 changes: 1 addition & 1 deletion manticore/utils/emulate.py
Expand Up @@ -15,7 +15,7 @@
logger = logging.getLogger(__name__)


class UnicornEmulator(object):
class UnicornEmulator:
'''
Helper class to emulate a single instruction via Unicorn.
'''
Expand Down
2 changes: 1 addition & 1 deletion manticore/utils/helpers.py
Expand Up @@ -130,7 +130,7 @@ def flush(self):
self._hits -= purge_count


class StateSerializer(object):
class StateSerializer:
"""
StateSerializer can serialize and deserialize :class:`~manticore.core.state.State` objects from and to
stream-like objects.
Expand Down
2 changes: 1 addition & 1 deletion manticore/utils/nointerrupt.py
Expand Up @@ -2,7 +2,7 @@
import logging


class WithKeyboardInterruptAs(object):
class WithKeyboardInterruptAs:
def __init__(self, callback):
if callback is None:
callback = lambda *args, **kwargs: None
Expand Down
2 changes: 1 addition & 1 deletion scripts/binaryninja/manticore_viz/__init__.py
Expand Up @@ -25,7 +25,7 @@ def __call__(cls, *args, **kwargs):
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]

class TraceVisualizer(object):
class TraceVisualizer:
__metaclass__ = Singleton
def __init__(self, view, workspace, base=0x0, live=False):
self.view = view
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/make_tests.py
Expand Up @@ -66,7 +66,7 @@ def decorate(cls):
class CPUTest(unittest.TestCase):
_multiprocess_can_split_ = True
class ROOperand(object):
class ROOperand:
''' Mocking class for operand ronly '''
def __init__(self, size, value):
self.size = size
Expand Down
4 changes: 2 additions & 2 deletions tests/mockmem.py
Expand Up @@ -9,7 +9,7 @@ def putchar(self, addr, value):
raise NotImplementedError("putchar")


class Mem(object):
class Mem:
''' Mocking class for memory '''

def __init__(self, mem):
Expand Down Expand Up @@ -44,7 +44,7 @@ def isReadable(self, addr):
return True


class SMem(object):
class SMem:
''' Mocking class for memory '''

def __init__(self, array, init):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_abi.py
Expand Up @@ -411,7 +411,7 @@ def test_funcall_method(self):
cpu.push(1, cpu.address_bit_size)
cpu.push(0x1234, cpu.address_bit_size)

class Kls(object):
class Kls:
def method(self, a, b):
return a+b

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cpu_automatic.py
Expand Up @@ -7,7 +7,7 @@

class CPUTest(unittest.TestCase):
_multiprocess_can_split_ = True
class ROOperand(object):
class ROOperand:
''' Mocking class for operand ronly '''
def __init__(self, size, value):
self.size = size
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cpu_manual.py
Expand Up @@ -11,7 +11,7 @@
from tests import mockmem
from functools import reduce

class ROOperand(object):
class ROOperand:
''' Mocking class for operand ronly '''
def __init__(self, size, value):
self.size = size
Expand Down Expand Up @@ -53,7 +53,7 @@ class SymCPUTest(unittest.TestCase):
'OF': 0x00800,
'IF': 0x00200,}

class ROOperand(object):
class ROOperand:
''' Mocking class for operand ronly '''
def __init__(self, size, value):
self.size = size
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dyn.py
Expand Up @@ -8,7 +8,7 @@

class CPUTest(unittest.TestCase):
_multiprocess_can_split_ = True
class ROOperand(object):
class ROOperand:
''' Mocking class for operand ronly '''
def __init__(self, size, value):
self.size = size
Expand Down
2 changes: 1 addition & 1 deletion tests/test_linux.py
Expand Up @@ -142,7 +142,7 @@ def test_linux_workspace_files(self):
def test_syscall_events(self):
nr_fstat64 = 197

class Receiver(object):
class Receiver:
def __init__(self):
self.nevents = 0
def will_exec(self, pc, i):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_slam_regre.py
Expand Up @@ -7,7 +7,7 @@

class CPUTest(unittest.TestCase):
_multiprocess_can_split_ = True
class ROOperand(object):
class ROOperand:
''' Mocking class for operand ronly '''
def __init__(self, size, value):
self.size = size
Expand Down
4 changes: 2 additions & 2 deletions tests/test_workspace.py
Expand Up @@ -7,7 +7,7 @@
from manticore.utils.event import Eventful


class FakeMemory(object):
class FakeMemory:
def __init__(self):
self._constraints = None

Expand All @@ -29,7 +29,7 @@ def __init__(self):
def memory(self):
return self._memory

class FakePlatform(object):
class FakePlatform:
def __init__(self):
self._constraints = None
self.procs = [FakeCpu()]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_x86.py
Expand Up @@ -38,7 +38,7 @@ def assertEqual(self, a, b):
b = bytes([ord(c) for c in b])
return super().assertEqual(a, b)

class ROOperand(object):
class ROOperand:
''' Mocking class for operand ronly '''
def __init__(self, size, value):
self.size = size
Expand Down
2 changes: 1 addition & 1 deletion tests/test_x86_pcmpxstrx.py
Expand Up @@ -34,7 +34,7 @@ def decorate(cls):
class CPUTest(unittest.TestCase):
_multiprocess_can_split_ = True

class ROOperand(object):
class ROOperand:
''' Mocking class for operand ronly '''
def __init__(self, size, value):
self.size = size
Expand Down

0 comments on commit b399080

Please sign in to comment.