Skip to content

Commit

Permalink
Merge pull request #7 from green-code-initiative/EC34-replace
Browse files Browse the repository at this point in the history
EC34 replaced by EC35 : test python implementation
  • Loading branch information
dedece35 authored Oct 29, 2023
2 parents 23aa50b + d8967e7 commit fe1531d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
def my_function():
x=0

try: # Noncompliant {{Avoid the use of try-catch-finally}}
try:
print(x)
except:
print("Something went wrong")
finally:
print("The 'try except' is finished")

def foo():
try: # Noncompliant {{Avoid the use of try-catch-finally}}
f = open(path)
try:
f = open(path) # Noncompliant {{Avoid the use of try-catch with a file open in try block}}
print(f.read())
except:
print('No such file '+path)
Expand Down

0 comments on commit fe1531d

Please sign in to comment.