Skip to content

Commit

Permalink
remove Py2vs3 maxsine hybridation
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste committed May 5, 2024
1 parent 2ebe5ff commit 051cfde
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
8 changes: 3 additions & 5 deletions nixio/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.

try:
from sys import maxint
except ImportError:
from sys import maxsize as maxint
from sys import maxsize

import numpy as np
from inspect import isclass
try:
Expand Down Expand Up @@ -396,7 +394,7 @@ def find_sources(self, filtr=lambda _: True, limit=None):
:rtype: list of nixio.Source
"""
if limit is None:
limit = maxint
limit = maxsize
return finders._find_sources(self, filtr, limit)

def pprint(self, indent=2, max_length=120, extra=True, start_depth=0):
Expand Down
7 changes: 2 additions & 5 deletions nixio/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
import os
import gc
import numpy as np
from sys import maxsize
from warnings import warn

try:
from sys import maxint
except ImportError:
from sys import maxsize as maxint
import h5py

from .hdf5.h5group import H5Group
Expand Down Expand Up @@ -478,7 +475,7 @@ def find_sections(self, filtr=lambda _: True, limit=None):
:rtype: list of nixio.Section
"""
if limit is None:
limit = maxint
limit = maxsize
return finders._find_sections(self, filtr, limit)

@property
Expand Down
9 changes: 4 additions & 5 deletions nixio/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
try:
from sys import maxint
except ImportError:
from sys import maxsize as maxint
from sys import maxsize
try:
from collections.abc import Sequence, Iterable
except ImportError:
from collections import Sequence, Iterable

import numpy as np

from .container import Container, SectionContainer
from .datatype import DataType
from .entity import Entity
Expand Down Expand Up @@ -386,7 +385,7 @@ def find_sections(self, filtr=lambda _: True, limit=None):
:rtype: list of nixio.Section
"""
if limit is None:
limit = maxint
limit = maxsize
return finders._find_sections(self, filtr, limit)

def find_related(self, filtr=lambda _: True):
Expand Down
4 changes: 2 additions & 2 deletions nixio/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
from sys import maxsize as maxint
from sys import maxsize

from .import exceptions
from .entity import Entity
Expand Down Expand Up @@ -173,7 +173,7 @@ def find_sources(self, filtr=lambda _: True, limit=None):
:rtype: list of nixio.Source
"""
if limit is None:
limit = maxint
limit = maxsize
return finders._find_sources(self, filtr, limit)

@property
Expand Down

0 comments on commit 051cfde

Please sign in to comment.