Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def pycodestyle(self, *args):
del sys.stdout[:], sys.stderr[:]
sys.argv[1:] = args
try:
pycodestyle._main()
errorcode = None
except SystemExit:
errorcode = sys.exc_info()[1].code
return sys.stdout.getvalue(), sys.stderr.getvalue(), errorcode
def pep8(self, *args):
del sys.stdout[:], sys.stderr[:]
sys.argv[1:] = args
try:
pycodestyle._main()
errorcode = None
except SystemExit:
errorcode = sys.exc_info()[1].code
return sys.stdout.getvalue(), sys.stderr.getvalue(), errorcode
"class or function definition, found %d" % (
top_level_lines, blank_before)
# Replace the upstream blank_lines implementation, with our fork.
_previousValue = pycodestyle._checks['logical_line'][pycodestyle.blank_lines]
del pycodestyle._checks['logical_line'][pycodestyle.blank_lines]
pycodestyle._checks['logical_line'][blank_lines] = _previousValue
if __name__ == '__main__':
# Calling main in a similar was as the upstream script.
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(pycodestyle._main())