raannakasturi commited on
Commit
df4da64
·
verified ·
1 Parent(s): 3c517aa

Update image.py

Browse files
Files changed (1) hide show
  1. image.py +2 -1
image.py CHANGED
@@ -95,5 +95,6 @@ def fetch_image(title, summary, api_key):
95
  print(f"Error fetching image: {e}")
96
  image_url = "https://i.ibb.co/TBJqggw/Image-Not-Found.jpg"
97
  finally:
98
- os.remove("image.png")
 
99
  return image_url
 
95
  print(f"Error fetching image: {e}")
96
  image_url = "https://i.ibb.co/TBJqggw/Image-Not-Found.jpg"
97
  finally:
98
+ if os.path.exists("image.png"):
99
+ os.remove("image.png")
100
  return image_url