Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cdl_utils/capdl_linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import os
import tempfile
import yaml
import six


CSPACE_TEMPLATE_FILE = os.path.join(os.path.dirname(__file__), "templates/cspace.template.c")
Expand Down
3 changes: 1 addition & 2 deletions python-capdl-tool/capdl/Allocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import collections
import logging

import six
from sortedcontainers import SortedList, SortedSet, SortedDict

from .Cap import Cap
Expand Down Expand Up @@ -426,7 +425,7 @@ def allocate(self, spec):
(asid_pool.name, asid_pool.asid_high, asid_pool.asid_high - 1))


class UntypedAllocator(six.with_metaclass(abc.ABCMeta, object)):
class UntypedAllocator(abc.ABC):
"""
An allocation interface for assigning objects to specific untypeds.
Each untyped allocator implements its own policy.
Expand Down
3 changes: 1 addition & 2 deletions python-capdl-tool/capdl/ELF.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from .PageCollection import PageCollection
import os
import re
import six


def _decode(data):
Expand All @@ -41,7 +40,7 @@ def __init__(self, elf, name='', arch=None):
parameter 'elf', or a stream to ELF data. 'name' is only used when
generating CapDL from the ELF file.
"""
if isinstance(elf, six.string_types):
if isinstance(elf, str):
f = open(elf, 'rb')
else:
f = elf
Expand Down
9 changes: 4 additions & 5 deletions python-capdl-tool/capdl/Object.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import abc
import math
import six
from functools import total_ordering

from aenum import Enum, Flag, unique, auto, IntEnum
Expand Down Expand Up @@ -121,7 +120,7 @@ class ARMIRQMode(IntEnum):
seL4_ARM_IRQ_EDGE = 1


class Object(six.with_metaclass(abc.ABCMeta, object)):
class Object(abc.ABC):
"""
Parent of all kernel objects.
"""
Expand All @@ -140,7 +139,7 @@ def is_container(self):
return False


class ContainerObject(six.with_metaclass(abc.ABCMeta, Object)):
class ContainerObject(Object):
"""
Common functionality for all objects that are cap containers, in the sense
that they may have child caps.
Expand All @@ -155,9 +154,9 @@ def is_container(self):

def print_contents(self):
keys = self.slots.keys()
if all(isinstance(k, six.integer_types) for k in keys):
if all(isinstance(k, int) for k in keys):
def print_slot_index(index): return '0x%x' % index
elif all(isinstance(k, six.string_types) for k in keys):
elif all(isinstance(k, str) for k in keys):
def print_slot_index(index): return index
else:
raise RuntimeError(
Expand Down
8 changes: 3 additions & 5 deletions python-capdl-tool/capdl/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import abc

from aenum import Enum
import six
from six.moves import range

from .Object import ObjectType, PageTable, PageDirectory, PML4, PDPT, PGD, PUD, get_object_size

Expand Down Expand Up @@ -86,7 +84,7 @@ def make_levels(levels):
return levels[0]


class Arch(six.with_metaclass(abc.ABCMeta, object)):
class Arch(abc.ABC):
def get_pages(self):
level = self.vspace()
pages = []
Expand Down Expand Up @@ -289,7 +287,7 @@ def last_level(level):


def page_sizes(arch):
if isinstance(arch, six.string_types):
if isinstance(arch, str):
arch = lookup_architecture(arch)
list = [get_object_size(page) for page in arch.get_pages()]
list.sort()
Expand Down Expand Up @@ -341,7 +339,7 @@ def ctz(size_bytes):
The value must be greater than 0.
"""
assert (size_bytes > 0)
assert (isinstance(size_bytes, six.integer_types))
assert (isinstance(size_bytes, int))
low = size_bytes & -size_bytes
low_bit = -1
while low:
Expand Down
1 change: 0 additions & 1 deletion python-capdl-tool/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
aenum
ordered-set
pyelftools
six
sortedcontainers
concurrencytest
hypothesis