Skip to content

Commit

Permalink
demo: don't use contextlib anymore
Browse files Browse the repository at this point in the history
* examples/demo.py: contextlib is nice but not really useful here. Since
its use in this file causes problems under Python 3.1 at least, don't
use it anymore for now.
  • Loading branch information
frougon committed Apr 3, 2015
1 parent 07a216b commit 27ed11e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/demo.py
Expand Up @@ -3,7 +3,7 @@

# demo.py --- Demonstration program and cheap test suite for pythondialog
#
# Copyright (C) 2002-2010, 2013, 2014 Florent Rougon
# Copyright (C) 2002-2010, 2013, 2014, 2015 Florent Rougon
# Copyright (C) 2000 Robb Shecter, Sultanbek Tezadov
#
# This program is in the public domain.
Expand Down Expand Up @@ -73,7 +73,6 @@

import sys, os, locale, stat, time, getopt, subprocess, traceback, textwrap
import pprint
import contextlib # Not really indispensable here
import dialog
from dialog import DialogBackendVersion

Expand Down Expand Up @@ -308,7 +307,7 @@ def Yesnohelp(self, *args, **kwargs):
# Dummy context manager to make sure the debug file is closed on exit, be it
# normal or abnormal, and to avoid having two code paths, one for normal mode
# and one for debug mode.
class DummyContextManager(contextlib.ContextDecorator):
class DummyContextManager:
def __enter__(self):
return self

Expand Down

0 comments on commit 27ed11e

Please sign in to comment.