Commit 2b2c7c76 authored by Jason R. Coombs's avatar Jason R. Coombs

Move import to top

parent d7b8b096
...@@ -6,6 +6,7 @@ import sys ...@@ -6,6 +6,7 @@ import sys
import fnmatch import fnmatch
import textwrap import textwrap
import io import io
import distutils.errors
try: try:
...@@ -162,9 +163,7 @@ class build_py(orig.build_py, Mixin2to3): ...@@ -162,9 +163,7 @@ class build_py(orig.build_py, Mixin2to3):
with io.open(init_py, 'rb') as f: with io.open(init_py, 'rb') as f:
contents = f.read() contents = f.read()
if b'declare_namespace' not in f.read(): if b'declare_namespace' not in f.read():
from distutils.errors import DistutilsError raise distutils.errors.DistutilsError(
raise DistutilsError(
"Namespace package problem: %s is a namespace package, but " "Namespace package problem: %s is a namespace package, but "
"its\n__init__.py does not call declare_namespace()! Please " "its\n__init__.py does not call declare_namespace()! Please "
'fix it.\n(See the setuptools manual under ' 'fix it.\n(See the setuptools manual under '
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment