Merge pull request #402 from karthiknadig/poli1

Fix policheck issues
This commit is contained in:
Karthik Nadig 2020-09-05 15:24:12 -07:00 committed by GitHub
commit 793097ff40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 12 deletions

Binary file not shown.

View file

@ -40,8 +40,8 @@ class UserModuleDeleter:
User Module Deleter (UMD) aims at deleting user modules
to force Python to deeply reload them during import
pathlist [list]: blacklist in terms of module path
namelist [list]: blacklist in terms of module name
pathlist [list]: ignore list in terms of module path
namelist [list]: ignore list in terms of module name
"""
def __init__(self, namelist=None, pathlist=None):
if namelist is None:
@ -51,14 +51,14 @@ class UserModuleDeleter:
pathlist = []
self.pathlist = pathlist
try:
# blacklist all files in org.python.pydev/pysrc
# ignore all files in org.python.pydev/pysrc
import pydev_pysrc, inspect
self.pathlist.append(os.path.dirname(pydev_pysrc.__file__))
except:
pass
self.previous_modules = list(sys.modules.keys())
def is_module_blacklisted(self, modname, modpath):
def is_module_ignored(self, modname, modpath):
for path in [sys.prefix] + self.pathlist:
if modpath.startswith(path):
return True
@ -86,7 +86,7 @@ class UserModuleDeleter:
# interpreter. There is no way to know its path, so we
# choose to ignore it.
continue
if not self.is_module_blacklisted(modname, modpath):
if not self.is_module_ignored(modname, modpath):
log.append(modname)
del sys.modules[modname]
if verbose and log:

View file

@ -514,7 +514,7 @@ else:
try:
self.parser.close()
finally:
self.parser = self.feed = None # nuke circular reference
self.parser = self.feed = None # remove circular reference
def handle_proc(self, tag, attr):
m = re.search("encoding\s*=\s*['\"]([^\"']+)[\"']", attr) #@UndefinedVariable

View file

@ -447,7 +447,7 @@ def update_class_to_generate_init(class_to_generate):
# Note: added kwargs because some messages are expected to be extended by the user (so, we'll actually
# make all extendable so that we don't have to worry about which ones -- we loose a little on typing,
# but may be better than doing a whitelist based on something only pointed out in the documentation).
# but may be better than doing a allow list based on something only pointed out in the documentation).
class_to_generate['init'] = '''def __init__(self%(args)s, update_ids_from_dap=False, **kwargs): # noqa (update_ids_from_dap may be unused)
"""
%(docstring)s

View file

@ -564,7 +564,7 @@ class Process (_ThreadContainer, _ModuleContainer):
return disasm
# FIXME
# This algorithm really sucks, I've got to write a better one :P
# This algorithm really bad, I've got to write a better one :P
def disassemble_around(self, lpAddress, dwSize = 64):
"""
Disassemble around the given address.

View file

@ -221,7 +221,7 @@ class Thread (object):
win32.THREAD_QUERY_LIMITED_INFORMATION)
self.dwProcessId = win32.GetProcessIdOfThread(hThread)
except AttributeError:
# This method really sucks :P
# This method is really bad :P
self.dwProcessId = self.__get_pid_by_scanning()
return self.dwProcessId
@ -375,7 +375,7 @@ class Thread (object):
win32.TerminateThread(hThread, dwExitCode)
# Ugliest hack ever, won't work if many pieces of code are injected.
# Seriously, what was I thinking? Lame! :(
# Seriously, what was I thinking? :(
if self.pInjectedMemory is not None:
try:
self.get_process().free(self.pInjectedMemory)

View file

@ -121,7 +121,7 @@ def find_metas(cls_node):
def fixup_indent(suite):
""" If an INDENT is followed by a thing with a prefix then nuke the prefix
""" If an INDENT is followed by a thing with a prefix then remove the prefix
Otherwise we get in trouble when removing __metaclass__ at suite start
"""
kids = suite.children[::-1]

View file

@ -50,7 +50,7 @@ class FixTupleParams(fixer_base.BaseFix):
new_lines = []
suite = results["suite"]
args = results["args"]
# This crap is so "def foo(...): x = 5; y = 7" is handled correctly.
# This is so "def foo(...): x = 5; y = 7" is handled correctly.
# TODO(cwinter): suite-cleanup
if suite[0].children[1].type == token.INDENT:
start = 2