Permalink
Browse files

Remove all the unused imports.

Added that check to the 'fatal' part of the flake8 check.
  • Loading branch information...
Andy Chu
Andy Chu committed Feb 2, 2018
1 parent 45bdc29 commit 1dee824578b0c485c02a5b12dd4f07c046307a13
View
@@ -6,7 +6,6 @@
import cStringIO
import unittest
from asdl import format as fmt
from asdl import py_meta
from asdl import asdl_
from asdl import const
View
@@ -7,7 +7,7 @@
import sys
from asdl import tdop
from asdl.tdop import Node, CompositeNode
from asdl.tdop import CompositeNode
from asdl import arith_ast
op_id = arith_ast.op_id_e # TODO: Rename this back.
View
@@ -12,7 +12,9 @@
from asdl import format as fmt
from core.id_kind import Id
from core.util import log
from core import util
log = util.log
def main(argv):
@@ -41,7 +43,7 @@ def main(argv):
# demo.
py_meta.MakeTypes(module, root, type_lookup)
print('Dynamically created a Python module with these types:')
log('Dynamically created a Python module with these types:')
for name in dir(root):
print('\t' + name)
View
@@ -2,8 +2,6 @@
encode.py
"""
import sys
from asdl import asdl_ as asdl
from asdl import py_meta
from asdl import const
View
@@ -16,7 +16,6 @@
"""
import re
import sys
from asdl import asdl_ as asdl
from core import util
View
@@ -4,12 +4,9 @@
"""
import cStringIO
import sys
import unittest
from asdl import format as fmt
from asdl import asdl_
from asdl import arith_ast # module under test
View
@@ -28,7 +28,6 @@
import sys
from asdl import asdl_ as asdl
from asdl import py_meta
from asdl import encode
TABSIZE = 2
View
@@ -26,13 +26,13 @@
put: an op is Add() and not Add, an instance of a class, not an integer value.
"""
import sys
from asdl import asdl_ as asdl
from asdl import const
from asdl import format as fmt
from core import util
log = util.log
def _CheckType(value, expected_desc):
"""Is value of type expected_desc?
@@ -86,12 +86,8 @@ def _CheckType(value, expected_desc):
if asdl.is_simple(expected_desc):
return actual_desc is expected_desc
else:
for cons in expected_desc.types:
#print("CHECKING desc %s against %s" % (desc, cons))
# It has to be one of the alternatives
from core.util import log
#log('Checking %s against %s', actual_desc, cons)
for cons in expected_desc.types: # It has to be one of the alternatives
#log("CHECKING desc %s against %s" % (desc, cons))
if actual_desc is cons:
return True
return False
View
@@ -3,13 +3,14 @@
py_meta_test.py: Tests for py_meta.py
"""
import re
import unittest
from asdl import py_meta # module under test
class AsdlTest(unittest.TestCase):
pass
def testPyMeta(self):
print py_meta
if __name__ == '__main__':
View
@@ -51,7 +51,6 @@ def _tlog(msg):
import errno
import platform
import re
#import traceback # for debugging
# Set in Modules/main.c.
View
@@ -30,13 +30,11 @@
import sys
from core import args
from core import legacy
from core import lexer
from core import runtime
from core import util
from core import state
from core import word_compile
from core.id_kind import Id
from osh import lex
View
@@ -6,7 +6,6 @@
import unittest
from core import legacy
from core import lexer
from core import builtin # module under test
View
@@ -17,7 +17,6 @@
import os
import resource
import stat
import sys
import time
@@ -1007,7 +1006,6 @@ def _Dispatch(self, node, fork_external):
if not b:
break
do_continue = False
try:
status = self._Execute(node.body)
except _ControlFlow as e:
View
@@ -9,19 +9,15 @@
cmd_exec_test.py: Tests for cmd_exec.py
"""
import os
import unittest
from core import alloc
from core import builtin
from core import cmd_exec # module under test
from core.cmd_exec import *
from core.id_kind import Id
from core import completion
from core import legacy
from core import ui
from core import word_eval
from core import runtime
from core import process
from core import test_lib
View
@@ -33,7 +33,6 @@
import fnmatch
import readline
import os
import stat
import sys
import time
import traceback
@@ -45,7 +44,6 @@
from core import state
from core import ui
from core import util
from core.id_kind import Id
command_e = ast.command_e
value_e = runtime.value_e
@@ -786,7 +784,6 @@ def Init(pool, builtins, mem, funcs, comp_lookup, status_out, ev):
if __name__ == '__main__':
from core import builtin
from core import cmd_exec
from core import state
status_lines = ui.MakeStatusLines()
View
@@ -12,11 +12,9 @@
import unittest
from core import alloc
from core import cmd_exec
from core import cmd_exec_test
from core import completion # module under test
from core import legacy
from core import lexer
from core import state
from core import test_lib
from core import word_eval
View
@@ -10,7 +10,8 @@
except ImportError:
from benchmarks import fake_libc as libc
from core.util import log
from core import util
log = util.log
def LooksLikeGlob(s):
View
@@ -16,7 +16,7 @@
from core.id_kind import Id
from osh import ast_ as ast
from core.util import log
log = util.log
def C(pat, tok_type):
View
@@ -1,11 +1,10 @@
#!/usr/bin/python -S
"""
lex_gen_test.py: Tests for lex_gen.py
lexer_gen_test.py: Tests for lexer_gen.py
"""
import unittest
from osh import lex
from core import lexer_gen # module under test
View
@@ -11,6 +11,8 @@
class LibStrTest(unittest.TestCase):
def testUnarySuffixOpDemo(self):
print libstr
s = 'abcd'
n = len(s)
View
@@ -18,7 +18,7 @@
from core import runtime
from core import util
from core.id_kind import Id, REDIR_DEFAULT_FD
from core.id_kind import Id
redirect_e = runtime.redirect_e
e_die = util.e_die
View
@@ -4,7 +4,6 @@
"""
import os
import sys
import unittest
from core.id_kind import Id
@@ -49,12 +48,10 @@ def testStdinRedirect(self):
r = runtime.PathRedirect(Id.Redir_Less, 0, PATH)
fd_state.Push([r], waiter)
#line1 = sys.stdin.readline()
line1 = builtin.ReadLineFromStdin()
fd_state.Pop()
fd_state.Push([r], waiter)
#line2 = sys.stdin.readline()
line2 = builtin.ReadLineFromStdin()
fd_state.Pop()
View
@@ -12,6 +12,7 @@
import cStringIO
from core import util
log = util.log
class _Reader(object):
View
@@ -8,7 +8,6 @@
from core import id_kind
from core import expr_eval
from core import word
from core import runtime
from core import util
View
@@ -2,7 +2,6 @@
word.py -- Functions for using words as "tokens".
"""
import sys
from osh import ast_ as ast
from core.id_kind import Id, Kind, LookupKind
from core import util
View
@@ -7,7 +7,6 @@
from core import braces
from core import expr_eval
from core import legacy
from core import libstr
from core import glob_
from core.id_kind import Id, Kind, LookupKind
View
@@ -15,7 +15,9 @@
class WordEvalTest(unittest.TestCase):
pass
def testWordEval(self):
print word_eval
if __name__ == '__main__':
View
@@ -11,7 +11,7 @@
class WordTest(unittest.TestCase):
def testFoo(self):
print('Hello from word_test.py')
print word
if __name__ == '__main__':
View
@@ -3,8 +3,6 @@
arith_parse.py - Parse shell arithmetic, which is based on C.
"""
import sys
from core import tdop
from core import util
from core.id_kind import Id
View
@@ -13,9 +13,7 @@
from core import expr_eval
from core import legacy
from core import tdop
from core import word_eval
from core import cmd_exec
from core import state
from core import test_lib
@@ -30,9 +28,6 @@ class ExprSyntaxError(Exception):
def ParseAndEval(code_str):
arena = test_lib.MakeArena('<arith_parse_test.py>')
w_parser, _ = parse_lib.MakeParserForCompletion(code_str, arena)
#spec = arith_parse.MakeShellSpec()
#a_parser = tdop.TdopParser(spec, w_parser) # Calls ReadWord(lex_mode_e.ARITH)
#anode = a_parser.Parse()
anode = w_parser._ReadArithExpr() # need the right lex state?
if not anode:
View
@@ -5,7 +5,6 @@
import sys
from core import util
from osh import ast_ as ast
from asdl import gen_cpp
View
@@ -32,8 +32,6 @@
BINARY_OP: -gt, -ot, ==, etc.
"""
import sys
from osh import ast_ as ast
from core import word
Oops, something went wrong.

0 comments on commit 1dee824

Please sign in to comment.