On Fri, Sep 19, 2014 at 4:30 PM, Peter Otten <__pete...@web.de> wrote: > > Well, you import closing from the stdlib with > > from contextlib import closing > > and then proceed to write your own closing > > @contextmanager > def closing(thing): > try: > yield thing > finally: > thing.close() > > At the moment my advice would be: forget about closing and the with- > statement. They are great to solve a problem you don't have (here).
So, just do as you said in the post above, 'status["steamrep_scammer"] = "steamrep_scammer" in api' and use a single try-expect in the outer requests.get() ?
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor