Skip to content

Commit

Permalink
t.unregister: Open file with context handler (SIM115)
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix committed Nov 17, 2024
1 parent 2871a52 commit d76ed0b
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions temporal/t.unregister/t.unregister.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,16 @@ def main():

# Read the map list from file
if file:
fd = open(file, "r")

line = True
while True:
line = fd.readline()
if not line:
break

mapname = line.strip()
mapid = dummy.build_id(mapname, mapset)
maplist.append(mapid)
with open(file) as fd:
line = True
while True:
line = fd.readline()
if not line:
break

mapname = line.strip()
mapid = dummy.build_id(mapname, mapset)
maplist.append(mapid)

num_maps = len(maplist)
update_dict = {}
Expand Down

0 comments on commit d76ed0b

Please sign in to comment.