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 be09d3f commit 94471d5
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 @@ -103,17 +103,16 @@ def main():

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

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 94471d5

Please sign in to comment.