forked from VimPlug/jedi
Some minor flake8 fixes
This commit is contained in:
committed by
Dave Halter
parent
08b0b668a6
commit
10b61c41f4
@@ -207,6 +207,7 @@ def _iter_modules(paths, prefix=''):
|
||||
yield importer, prefix + modname, ispkg
|
||||
# END COPY
|
||||
|
||||
|
||||
iter_modules = _iter_modules if py_version >= 34 else pkgutil.iter_modules
|
||||
|
||||
|
||||
@@ -252,6 +253,7 @@ Usage::
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class Python3Method(object):
|
||||
def __init__(self, func):
|
||||
self.func = func
|
||||
@@ -312,10 +314,10 @@ def force_unicode(obj):
|
||||
try:
|
||||
import builtins # module name in python 3
|
||||
except ImportError:
|
||||
import __builtin__ as builtins
|
||||
import __builtin__ as builtins # noqa: F401
|
||||
|
||||
|
||||
import ast
|
||||
import ast # noqa: F401
|
||||
|
||||
|
||||
def literal_eval(string):
|
||||
@@ -325,7 +327,7 @@ def literal_eval(string):
|
||||
try:
|
||||
from itertools import zip_longest
|
||||
except ImportError:
|
||||
from itertools import izip_longest as zip_longest # Python 2
|
||||
from itertools import izip_longest as zip_longest # Python 2 # noqa: F401
|
||||
|
||||
try:
|
||||
FileNotFoundError = FileNotFoundError
|
||||
@@ -378,7 +380,7 @@ def utf8_repr(func):
|
||||
if is_py3:
|
||||
import queue
|
||||
else:
|
||||
import Queue as queue
|
||||
import Queue as queue # noqa: F401
|
||||
|
||||
try:
|
||||
# Attempt to load the C implementation of pickle on Python 2 as it is way
|
||||
@@ -544,7 +546,7 @@ def which(cmd, mode=os.F_OK | os.X_OK, path=None):
|
||||
|
||||
if sys.platform == "win32":
|
||||
# The current directory takes precedence on Windows.
|
||||
if not os.curdir in path:
|
||||
if os.curdir not in path:
|
||||
path.insert(0, os.curdir)
|
||||
|
||||
# PATHEXT is necessary to check on Windows.
|
||||
@@ -565,7 +567,7 @@ def which(cmd, mode=os.F_OK | os.X_OK, path=None):
|
||||
seen = set()
|
||||
for dir in path:
|
||||
normdir = os.path.normcase(dir)
|
||||
if not normdir in seen:
|
||||
if normdir not in seen:
|
||||
seen.add(normdir)
|
||||
for thefile in files:
|
||||
name = os.path.join(dir, thefile)
|
||||
|
||||
@@ -2,16 +2,17 @@ from jedi._compatibility import encoding, is_py3, u
|
||||
import os
|
||||
import time
|
||||
|
||||
_inited = False
|
||||
|
||||
|
||||
def _lazy_colorama_init():
|
||||
"""
|
||||
Lazily init colorama if necessary, not to screw up stdout is debug not
|
||||
enabled.
|
||||
Lazily init colorama if necessary, not to screw up stdout if debugging is
|
||||
not enabled.
|
||||
|
||||
This version of the function does nothing.
|
||||
"""
|
||||
pass
|
||||
|
||||
_inited=False
|
||||
|
||||
try:
|
||||
if os.name == 'nt':
|
||||
@@ -21,7 +22,8 @@ try:
|
||||
# Use colorama for nicer console output.
|
||||
from colorama import Fore, init
|
||||
from colorama import initialise
|
||||
def _lazy_colorama_init():
|
||||
|
||||
def _lazy_colorama_init(): # noqa: F811
|
||||
"""
|
||||
Lazily init colorama if necessary, not to screw up stdout is
|
||||
debug not enabled.
|
||||
|
||||
@@ -113,7 +113,7 @@ def setup_readline(namespace_module=__main__):
|
||||
# this code. This didn't use to be an issue until 3.3. Starting with
|
||||
# 3.4 this is different, it always overwrites the completer if it's not
|
||||
# already imported here.
|
||||
import rlcompleter
|
||||
import rlcompleter # noqa: F401
|
||||
import readline
|
||||
except ImportError:
|
||||
print("Jedi: Module readline not available.")
|
||||
|
||||
Reference in New Issue
Block a user