Skip to content

Commit

Permalink
MAINT: Include from __future__ boilerplate in some files missing it.
Browse files Browse the repository at this point in the history
Some newer *.py files are missing the `from __future__` boilerplate
that helps assure Python2 and Python3 compatibility.
  • Loading branch information
charris committed Dec 6, 2015
1 parent 0ba39a9 commit 4743f3b
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions numpy/_build_utils/apple_accelerate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import division, absolute_import, print_function

import os
import sys
import re
Expand Down
2 changes: 2 additions & 0 deletions numpy/compat/tests/test_compat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import division, absolute_import, print_function

from os.path import join

from numpy.compat import isfileobj
Expand Down
1 change: 1 addition & 0 deletions numpy/core/tests/test_scalarinherit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
""" Test printing of scalar types.
"""
from __future__ import division, absolute_import, print_function

import numpy as np
from numpy.testing import TestCase, run_module_suite
Expand Down
2 changes: 2 additions & 0 deletions numpy/distutils/msvc9compiler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import division, absolute_import, print_function

import os
import distutils.msvc9compiler
from distutils.msvc9compiler import *
Expand Down
2 changes: 2 additions & 0 deletions numpy/distutils/msvccompiler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import division, absolute_import, print_function

import os
import distutils.msvccompiler
from distutils.msvccompiler import *
Expand Down
2 changes: 2 additions & 0 deletions numpy/f2py/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# See http://cens.ioc.ee/projects/f2py2e/
from __future__ import division, print_function

import os
import sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
Expand Down
3 changes: 2 additions & 1 deletion numpy/lib/tests/test_packbits.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
from __future__ import division, absolute_import, print_function

import numpy as np
from numpy.testing import assert_array_equal, assert_equal, assert_raises


Expand Down
2 changes: 2 additions & 0 deletions numpy/linalg/tests/test_deprecations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Test deprecation and future warnings.
"""
from __future__ import division, absolute_import, print_function

import numpy as np
from numpy.testing import assert_warns, run_module_suite

Expand Down
2 changes: 1 addition & 1 deletion pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
- fix bdist_mpkg: we build the same source twice -> how to make sure we use
the same underlying python for egg install in venv and for bdist_mpkg
"""
from __future__ import division, absolute_import, print_function
from __future__ import division, print_function

# What need to be installed to build everything on mac os x:
# - wine: python 2.6 and 2.5 + makensis + cpuid plugin + mingw, all in the PATH
Expand Down
1 change: 1 addition & 0 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
$ python runtests.py --lcov-html
"""
from __future__ import division, print_function

#
# This is a generic test runner script for projects using Numpy's test
Expand Down
2 changes: 2 additions & 0 deletions tools/win32build/build-cpucaps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import division, print_function

import os
import subprocess
# build cpucaps.dll
Expand Down

0 comments on commit 4743f3b

Please sign in to comment.