Skip to content
Snippets Groups Projects

added filecheck on read_ascii_file function

Merged Alexander Øvergård requested to merge feat/throw into main
1 unresolved thread

lagt til filecheck og en try open guard på funksjonen read_ascii_file

Merge request reports

Merge request pipeline #46321 passed

Merge request pipeline passed for 3e285c0b

Test coverage 32.00% (0.00%) from 1 job

Merged by Per AaslidPer Aaslid 1 year ago (Aug 14, 2023 9:29am UTC)

Loading

Pipeline #46333 passed

Pipeline passed for 867e22e5 on main

Test coverage 32.00% (0.00%) from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
195 195 return commands
196 196
197 197 def read_ascii_file(self, file_path:str) -> None:
198 if not os.path.exists(file_path):
199 raise FileNotFoundError("Provided file does not exist", file_path)
200 try:
201 f = open(file_path, "r")
202 except OSError:
203 print("Could not open/read file:", file_path)
204 sys.exit()
  • added 1 commit

    Compare with previous version

  • Per Aaslid approved this merge request

    approved this merge request

  • fjernet "try" sectionenen og har nå kun os.path.exist check.

    bare å merge om ok 😄

  • merged

  • Please register or sign in to reply
    Loading