Skip to content

Commit

Permalink
found a few bits of PY2 compat left over
Browse files Browse the repository at this point in the history
  • Loading branch information
iskandr committed Feb 12, 2024
1 parent f8b363c commit 29e2b94
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mhctools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from .random_predictor import RandomBindingPredictor
from .unsupported_allele import UnsupportedAllele

__version__ = "1.8.2"
__version__ = "1.9.0"

__all__ = [
"BindingPrediction",
Expand Down
2 changes: 1 addition & 1 deletion mhctools/base_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def _check_hla_alleles(
HLA alleles, return a set of alleles that we will pass into
the MHC binding predictor.
"""
require_iterable_of(alleles, string_types, "HLA alleles")
require_iterable_of(alleles, str, "HLA alleles")

# Don't run the MHC predictor twice for homozygous alleles,
# only run it for unique alleles
Expand Down
2 changes: 1 addition & 1 deletion mhctools/iedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __init__(
# for not raising, since sometimes we want to be more permissive with IEDB predictors
self.raise_on_error = raise_on_error

if not isinstance(url, string_types):
if not isinstance(url, str):
raise TypeError("Expected URL to be string, not %s : %s" % (
url, type(url)))
self.url = url
Expand Down
6 changes: 1 addition & 5 deletions tests/test_netmhc_pan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

from mhctools import NetMHCpan

# Defining FileNotFoundError for Python 2.x
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError



DEFAULT_ALLELE = 'HLA-A*02:01'
Expand Down

0 comments on commit 29e2b94

Please sign in to comment.