mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 13:51:33 +00:00
Remove unnecessary parentheses
This commit is contained in:
parent
7479ef5639
commit
77c3259099
@ -20,7 +20,7 @@ def get_source_code(func, strip_comments=False):
|
|||||||
if strip_comments:
|
if strip_comments:
|
||||||
# TODO: less fragile way to do this (tokenizer sadly inserts whitespaces all around)
|
# TODO: less fragile way to do this (tokenizer sadly inserts whitespaces all around)
|
||||||
comment_pattern = re.compile('^(\s.*)#.*$')
|
comment_pattern = re.compile('^(\s.*)#.*$')
|
||||||
source = ''.join((
|
source = ''.join(
|
||||||
line for line in StringIO(source).readlines() if re.match(comment_pattern, line) is None
|
line for line in StringIO(source).readlines() if re.match(comment_pattern, line) is None
|
||||||
))
|
)
|
||||||
return source
|
return source
|
||||||
|
Loading…
Reference in New Issue
Block a user