Commit bd3d26ea authored by Hoek, Steven's avatar Hoek, Steven
Browse files

Earlier supplied code example did not stop where it was supposed to ...

parent bfd8fc74
...@@ -31,7 +31,8 @@ The classes found in the formats subdirectory more or less have the same interfa ...@@ -31,7 +31,8 @@ The classes found in the formats subdirectory more or less have the same interfa
*Example*:: *Example*::
from formats.asciigrid import AsciiGrid from formats.asciigrid import AsciiGrid
import sys
myraster = None myraster = None
try: try:
fn = 'myraster.asc' fn = 'myraster.asc'
...@@ -44,7 +45,7 @@ The classes found in the formats subdirectory more or less have the same interfa ...@@ -44,7 +45,7 @@ The classes found in the formats subdirectory more or less have the same interfa
for k in range(myraster.ncols): for k in range(myraster.ncols):
if line[k] == 42: if line[k] == 42:
print('Found!') print('Found!')
break sys.exit()
finally: finally:
if myraster is not None: if myraster is not None:
myraster.close() myraster.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment