Remove obj.next() deprecation warning.

e.g. python run_tests.py -g test_GenBank.py
This commit is contained in:
peterjc
2013-12-10 10:27:08 +00:00
parent 93017b76b4
commit aa538563eb
7 changed files with 7 additions and 42 deletions

View File

@ -60,12 +60,7 @@ class AlignmentIterator(object):
if sys.version_info[0] < 3:
def next(self):
"""Deprecated Python 2 style alias for Python 3 style __next__ method."""
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn("Please use next(my_iterator) instead of my_iterator.next(), "
"the .next() method is deprecated and will be removed in a "
"future release of Biopython.", BiopythonDeprecationWarning)
"""Python 2 style alias for Python 3 style __next__ method."""
return self.__next__()
def __iter__(self):

View File

@ -1686,12 +1686,7 @@ class Iterator(object):
if sys.version_info[0] < 3:
def next(self):
"""Deprecated Python 2 style alias for Python 3 style __next__ method."""
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn("Please use next(my_iterator) instead of my_iterator.next(), "
"the .next() method is deprecated and will be removed in a "
"future release of Biopython.", BiopythonDeprecationWarning)
"""Python 2 style alias for Python 3 style __next__ method."""
return self.__next__()
def __iter__(self):

View File

@ -79,12 +79,7 @@ class BlastTableReader(object):
if sys.version_info[0] < 3:
def next(self):
"""Deprecated Python 2 style alias for Python 3 style __next__ method."""
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn("Please use next(my_iterator) instead of my_iterator.next(), "
"the .next() method is deprecated and will be removed in a "
"future release of Biopython.", BiopythonDeprecationWarning)
"""Python 2 style alias for Python 3 style __next__ method."""
return self.__next__()
def _consume_entry(self, inline):

View File

@ -144,12 +144,7 @@ class IterationCursor(object):
if sys.version_info[0] < 3:
def next(self):
"""Deprecated Python 2 style alias for Python 3 style __next__ method."""
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn("Please use next(my_iterator) instead of my_iterator.next(), "
"the .next() method is deprecated and will be removed in a "
"future release of Biopython.", BiopythonDeprecationWarning)
"""Python 2 style alias for Python 3 style __next__ method."""
return self.__next__()

View File

@ -399,12 +399,7 @@ class Iterator(object):
if sys.version_info[0] < 3:
def next(self):
"""Deprecated Python 2 style alias for Python 3 style __next__ method."""
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn("Please use next(my_iterator) instead of my_iterator.next(), "
"the .next() method is deprecated and will be removed in a "
"future release of Biopython.", BiopythonDeprecationWarning)
"""Python 2 style alias for Python 3 style __next__ method."""
return self.__next__()
def __iter__(self):

View File

@ -168,12 +168,7 @@ class _FileIterator:
if sys.version_info[0] < 3:
def next(self):
"""Deprecated Python 2 style alias for Python 3 style __next__ method."""
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn("Please use next(my_iterator) instead of my_iterator.next(), "
"the .next() method is deprecated and will be removed in a "
"future release of Biopython.", BiopythonDeprecationWarning)
"""Python 2 style alias for Python 3 style __next__ method."""
return self.__next__()
def __del__(self):

View File

@ -55,12 +55,7 @@ class SequenceIterator(object):
if sys.version_info[0] < 3:
def next(self):
"""Deprecated Python 2 style alias for Python 3 style __next__ method."""
import warnings
from Bio import BiopythonDeprecationWarning
warnings.warn("Please use next(my_iterator) instead of my_iterator.next(), "
"the .next() method is deprecated and will be removed in a "
"future release of Biopython.", BiopythonDeprecationWarning)
"""Python 2 style alias for Python 3 style __next__ method."""
return self.__next__()
def __iter__(self):