Merge pull request #765 from zackmdavis/appease_flake8

move imports and operators to satisfy new version of pep8 checker
This commit is contained in:
Berker Peksag 2015-02-17 08:32:50 +02:00
commit 49e7376b0e
4 changed files with 16 additions and 18 deletions

View File

@ -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"])

View File

@ -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:

View File

@ -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):

View File

@ -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