Skip to content

Commit

Permalink
Addressed PR #6472 comments for documentation issue #5953
Browse files Browse the repository at this point in the history
>
>
Co-authored-by: Onkar Dixit <osdixit@gmail.com>
Co-authored-by: Vladyslav Krylasov <vladyslav.krylasov@gmail.com>
  • Loading branch information
MalanB authored and Pierre-Sassoulas committed May 2, 2022
1 parent 1abd194 commit f9c426f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions doc/data/messages/c/consider-using-sys-exit/bad.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if __name__ == '__main__':
user = input('Enter user name: ')
print(f'Hello, {user}')
exit(0) # [consider-using-sys-exit]
if __name__ == "__main__":
user = input("Enter user name: ")
print(f"Hello, {user}")
exit(0) # [consider-using-sys-exit]
6 changes: 3 additions & 3 deletions doc/data/messages/c/consider-using-sys-exit/good.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

if __name__ == '__main__':
user = input('Enter user name: ')
print(f'Hello, {user}')
if __name__ == "__main__":
user = input("Enter user name: ")
print(f"Hello, {user}")
sys.exit(0)
4 changes: 3 additions & 1 deletion doc/data/messages/g/global-statement/bad.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
var = 1


def foo():
global var # [global-statement]
global var # [global-statement]
var = 10
print(var)


foo()
print(var)
4 changes: 3 additions & 1 deletion doc/data/messages/g/global-statement/good.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
var = 1

def foo(x):

def foo():
print(var)
return 10


var = foo()
print(var)

0 comments on commit f9c426f

Please sign in to comment.