Skip to content

Commit

Permalink
Merge pull request #260 from dlyssenko/remove_outdated_version_checks
Browse files Browse the repository at this point in the history
removed all outdated python version checks
  • Loading branch information
dlyssenko committed May 22, 2023
2 parents 301c50d + b60ba05 commit 4b1de15
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
6 changes: 1 addition & 5 deletions pyeapi/api/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@
ultimately derive from BaseEntity which provides some common functions to
make building API modules easier.
"""
import sys
if sys.version_info < (3, 3):
from collections import Callable, Mapping
else:
from collections.abc import Callable, Mapping

from collections.abc import Callable, Mapping
from pyeapi.eapilib import CommandError
from pyeapi.utils import make_iterable

Expand Down
3 changes: 0 additions & 3 deletions pyeapi/eapilib.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@


def https_connection_factory(path, host, port, context=None, timeout=60):
# ignore ssl context for python versions before 2.7.9
if sys.hexversion < 34015728:
return HttpsConnection(path, host, port, timeout=timeout)
return HttpsConnection(path, host, port, context=context, timeout=timeout)


Expand Down
16 changes: 6 additions & 10 deletions pyeapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@
import inspect
import logging
import logging.handlers
if sys.version_info < (3, 3):
from collections import Iterable
else:
from collections.abc import Iterable


from collections.abc import Iterable
from itertools import tee

try:
Expand Down Expand Up @@ -263,19 +259,19 @@ def __init__(self, *cli):
def _interpolate_docstr( *tkns ):
"""Docstring decorator.
SYNOPSIS:
MIN_MTU=68
MAX_MTU=65535
@_interpolate_docstr( 'MIN_MTU', 'MAX_MTU', __name__ )
def mtu_check( val ):
"check mtu against its min value (MIN_MTU) and max value (MAX_MTU)"
...
print( mtu_check.__doc__ )
check mtu against its min value (68) and max value (65535)
Note: `__name__` must be provided as the last argument because the decorator
Note: `__name__` must be provided as the last argument, b/c the decorator
could be imported, thus the current (importing) module needs to be resolved
"""
def docstr_decorator( user_fn ):
Expand Down

0 comments on commit 4b1de15

Please sign in to comment.