mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[codemod][lint][fbcode/c*] Enable BLACK by default
Test Plan: manual inspection & sandcastle Reviewed By: zertosh Differential Revision: D30279364 fbshipit-source-id: c1ed77dfe43a3bde358f92737cd5535ae5d13c9a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
aac3c7bd06
commit
b004307252
@ -1,8 +1,10 @@
|
||||
# this file contains a simple parser that parses report
|
||||
# from cuda-memcheck
|
||||
|
||||
|
||||
class ParseError(Exception):
|
||||
"""Whenever the simple parser is unable to parse the report, this exception will be raised"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@ -77,25 +79,25 @@ def parse(message):
|
||||
========= ERROR SUMMARY: 4 errors
|
||||
"""
|
||||
errors = []
|
||||
HEAD = '========='
|
||||
HEAD = "========="
|
||||
headlen = len(HEAD)
|
||||
started = False
|
||||
in_message = False
|
||||
message_lines = []
|
||||
lines = message.splitlines()
|
||||
for l in lines:
|
||||
if l == HEAD + ' CUDA-MEMCHECK':
|
||||
if l == HEAD + " CUDA-MEMCHECK":
|
||||
started = True
|
||||
continue
|
||||
if not started or not l.startswith(HEAD):
|
||||
continue
|
||||
l = l[headlen + 1:]
|
||||
if l.startswith('ERROR SUMMARY:'):
|
||||
l = l[headlen + 1 :]
|
||||
if l.startswith("ERROR SUMMARY:"):
|
||||
return Report(l, errors)
|
||||
if not in_message:
|
||||
in_message = True
|
||||
message_lines = [l]
|
||||
elif l == '':
|
||||
elif l == "":
|
||||
errors.append(Error(message_lines))
|
||||
in_message = False
|
||||
else:
|
||||
|
Reference in New Issue
Block a user