Skip to content

Commit

Permalink
Remove with_statement imports required under Python 2.5
Browse files Browse the repository at this point in the history
Removed all the with statement imports
(and any comment lines associated with them);

from __future__ import with_statement
  • Loading branch information
fomightez authored and peterjc committed Aug 28, 2013
1 parent d134b3a commit eeab501
Show file tree
Hide file tree
Showing 27 changed files with 2 additions and 64 deletions.
2 changes: 0 additions & 2 deletions Bio/AlignIO/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@
same length.
"""

# For using with statement in Python 2.5 or Jython
from __future__ import with_statement

__docformat__ = "epytext en" # not just plaintext

Expand Down
2 changes: 0 additions & 2 deletions Bio/File.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
files are also defined under Bio.File but these are not intended for direct
use.
"""
# For with statement in Python 2.5
from __future__ import with_statement
import codecs
import os
import contextlib
Expand Down
3 changes: 0 additions & 3 deletions Bio/Nexus/Nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
Based upon 'NEXUS: An extensible file format for systematic information'
Maddison, Swofford, Maddison. 1997. Syst. Biol. 46(4):590-621
"""
# For with in Python/Jython 2.5
from __future__ import with_statement

import copy
import math
import random
Expand Down
2 changes: 0 additions & 2 deletions Bio/PDB/DSSP.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
- - None
"""

from __future__ import with_statement

import re
from StringIO import StringIO
import subprocess
Expand Down
3 changes: 0 additions & 3 deletions Bio/PDB/PDBList.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@

""" Access the PDB over the internet (e.g. to download structures). """

# For using with statement in Python 2.5 or Jython
from __future__ import with_statement

import contextlib
import gzip
import os
Expand Down
3 changes: 0 additions & 3 deletions Bio/PDB/PDBParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

"""Parser for PDB files."""

# For using with statement in Python 2.5 or Jython
from __future__ import with_statement

import warnings

try:
Expand Down
2 changes: 0 additions & 2 deletions Bio/PDB/parse_pdb_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

"""Parse the header of a PDB file."""

# For 'with' on Python 2.5/Jython 2.5
from __future__ import with_statement
import re

from Bio import File
Expand Down
3 changes: 0 additions & 3 deletions Bio/Phylo/PAML/baseml.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# license. Please see the LICENSE file that should have been included
# as part of this package.

# For using with statement in Python 2.5 or Jython
from __future__ import with_statement

import os
import os.path
from _paml import Paml, _relpath
Expand Down
3 changes: 0 additions & 3 deletions Bio/Phylo/PAML/codeml.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# license. Please see the LICENSE file that should have been included
# as part of this package.

# For using with statement in Python 2.5 or Jython
from __future__ import with_statement

import os
import os.path
from _paml import Paml, _relpath
Expand Down
2 changes: 0 additions & 2 deletions Bio/Phylo/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
This API follows the same semantics as Biopython's `SeqIO` and `AlignIO`.
"""

# For with on Python/Jython 2.5
from __future__ import with_statement
__docformat__ = "restructuredtext en"

from Bio import File
Expand Down
3 changes: 0 additions & 3 deletions Bio/SearchIO/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@
"""

# For using with statement in Python 2.5 or Jython
from __future__ import with_statement

__docformat__ = 'epytext en'

import sys
Expand Down
2 changes: 0 additions & 2 deletions Bio/SeqIO/PdbIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
from __future__ import with_statement

import collections
import warnings

Expand Down
3 changes: 0 additions & 3 deletions Bio/SeqIO/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,6 @@
making up each alignment as SeqRecords.
"""

# For using with statement in Python 2.5 or Jython
from __future__ import with_statement

__docformat__ = "epytext en" # not just plaintext

#TODO
Expand Down
5 changes: 2 additions & 3 deletions Doc/Tutorial.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2675,11 +2675,10 @@ \section{Parsing sequences from compressed files}

\noindent
Here we use a file handle instead, using the \verb|with| statement
(Python 2.5 or later) to close the handle automatically:
to close the handle automatically:

%This doctest won't work on Python 2.5, even with the __future__ import. Odd.
%doctest examples
\begin{verbatim}
>>> from __future__ import with_statement #Needed on Python 2.5
>>> from Bio import SeqIO
>>> with open("ls_orchid.gbk") as handle:
... print sum(len(r) for r in SeqIO.parse(handle, "gb"))
Expand Down
2 changes: 0 additions & 2 deletions Tests/test_Application.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
stdin/stdout/stderr handling.
"""

from __future__ import with_statement

import os
import unittest

Expand Down
2 changes: 0 additions & 2 deletions Tests/test_BWA_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# license. Please see the LICENSE file that should have been included
# as part of this package.

from __future__ import with_statement

from Bio import MissingExternalDependencyError
import sys
import os
Expand Down
2 changes: 0 additions & 2 deletions Tests/test_File.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# license. Please see the LICENSE file that should have been included
# as part of this package.

from __future__ import with_statement

import os.path
import unittest
import shutil
Expand Down
2 changes: 0 additions & 2 deletions Tests/test_Phylo_NeXML.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

"""Unit tests for the NeXML and NeXMLIO modules.
"""
from __future__ import with_statement

import os
import tempfile
import unittest
Expand Down
3 changes: 0 additions & 3 deletions Tests/test_SearchIO_blast_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

"""Tests for SearchIO BlastIO parsers."""

# For using with statement in Python 2.5 or Jython
from __future__ import with_statement

import os
import unittest

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

"""Tests for SearchIO BlastIO plain text parsers."""

# For using with statement in Python 2.5 or Jython
from __future__ import with_statement

import os
import unittest

Expand Down
2 changes: 0 additions & 2 deletions Tests/test_SeqIO_FastaIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# license. Please see the LICENSE file that should have been included
# as part of this package.

from __future__ import with_statement

import unittest
from StringIO import StringIO

Expand Down
2 changes: 0 additions & 2 deletions Tests/test_SeqIO_QualityIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

"""Additional unit tests for Bio.SeqIO.QualityIO (covering FASTQ and QUAL)."""

from __future__ import with_statement

import os
import unittest
import warnings
Expand Down
2 changes: 0 additions & 2 deletions Tests/test_SeqIO_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
Initially this takes matched tests of GenBank and FASTA files from the NCBI
and confirms they are consistent using our different parsers.
"""
from __future__ import with_statement

import os
import unittest
from Bio.Alphabet import generic_dna, generic_rna, generic_protein
Expand Down
2 changes: 0 additions & 2 deletions Tests/test_SeqUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# license. Please see the LICENSE file that should have been included
# as part of this package.

from __future__ import with_statement

import os
import unittest

Expand Down
2 changes: 0 additions & 2 deletions Tests/test_SubsMat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# license. Please see the LICENSE file that should have been included
# as part of this package.

from __future__ import with_statement

try:
from numpy import corrcoef
del corrcoef
Expand Down
2 changes: 0 additions & 2 deletions Tests/test_TogoWS.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"""Testing Bio.TogoWS online code.
"""

from __future__ import with_statement

import unittest
from StringIO import StringIO

Expand Down
2 changes: 0 additions & 2 deletions Tests/test_Uniprot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
"""Test for the Uniprot parser on Uniprot XML files.
"""
from __future__ import with_statement

import os
import unittest

Expand Down

0 comments on commit eeab501

Please sign in to comment.