Merge pull request #765 from zackmdavis/appease_flake8
move imports and operators to satisfy new version of pep8 checker
This commit is contained in:
commit
49e7376b0e
@ -692,8 +692,9 @@ class HyASTCompiler(object):
|
|||||||
expr.pop(0)
|
expr.pop(0)
|
||||||
|
|
||||||
ret = self.compile(HyExpression(
|
ret = self.compile(HyExpression(
|
||||||
[HySymbol("hy_eval")] + expr + [HyExpression([HySymbol("locals")])]
|
[HySymbol("hy_eval")] + expr +
|
||||||
+ [HyString(self.module_name)]).replace(expr)
|
[HyExpression([HySymbol("locals")])] +
|
||||||
|
[HyString(self.module_name)]).replace(expr)
|
||||||
)
|
)
|
||||||
|
|
||||||
ret.add_imports("hy.importer", ["hy_eval"])
|
ret.add_imports("hy.importer", ["hy_eval"])
|
||||||
|
@ -25,11 +25,15 @@
|
|||||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
# DEALINGS IN THE SOFTWARE.
|
# DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
import contextlib
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from contextlib import contextmanager
|
|
||||||
from hy._compat import string_types
|
import hy.macros
|
||||||
|
import hy.compiler
|
||||||
|
from hy._compat import builtins, string_types
|
||||||
|
|
||||||
|
|
||||||
docomplete = True
|
docomplete = True
|
||||||
|
|
||||||
@ -49,12 +53,6 @@ else:
|
|||||||
readline_bind = "tab: complete"
|
readline_bind = "tab: complete"
|
||||||
|
|
||||||
|
|
||||||
import hy.macros
|
|
||||||
import hy.compiler
|
|
||||||
|
|
||||||
from hy._compat import builtins
|
|
||||||
|
|
||||||
|
|
||||||
class Completer(object):
|
class Completer(object):
|
||||||
|
|
||||||
def __init__(self, namespace={}):
|
def __init__(self, namespace={}):
|
||||||
@ -129,7 +127,7 @@ class Completer(object):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextlib.contextmanager
|
||||||
def completion(completer=None):
|
def completion(completer=None):
|
||||||
delims = "()[]{} "
|
delims = "()[]{} "
|
||||||
if not completer:
|
if not completer:
|
||||||
|
@ -22,16 +22,16 @@
|
|||||||
import ast
|
import ast
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.version_info[0] <= 2 and sys.version_info[1] <= 6:
|
|
||||||
import unittest2 as unittest
|
|
||||||
else:
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
from hy import compiler
|
from hy import compiler
|
||||||
from hy.models.expression import HyExpression
|
from hy.models.expression import HyExpression
|
||||||
from hy.models.list import HyList
|
from hy.models.list import HyList
|
||||||
from hy.models.symbol import HySymbol
|
from hy.models.symbol import HySymbol
|
||||||
|
|
||||||
|
if sys.version_info[0] <= 2 and sys.version_info[1] <= 6:
|
||||||
|
import unittest2 as unittest
|
||||||
|
else:
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class CompilerTest(unittest.TestCase):
|
class CompilerTest(unittest.TestCase):
|
||||||
|
|
||||||
|
@ -136,8 +136,7 @@ def test_hy2py():
|
|||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
i += 1
|
i += 1
|
||||||
ret = run_cmd("hy2py -s -a "
|
ret = run_cmd("hy2py -s -a " + os.path.join(dirpath, f))
|
||||||
+ os.path.join(dirpath, f))
|
|
||||||
assert ret[0] == 0, f
|
assert ret[0] == 0, f
|
||||||
assert len(ret[1]) > 1, f
|
assert len(ret[1]) > 1, f
|
||||||
assert len(ret[2]) == 0, f
|
assert len(ret[2]) == 0, f
|
||||||
|
Loading…
Reference in New Issue
Block a user