]> git.openstreetmap.org Git - osqa.git/commitdiff
#OSQA-574, we make an attempt to import the with statement from the __future__ packag...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 27 Mar 2011 21:51:52 +0000 (21:51 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Sun, 27 Mar 2011 21:51:52 +0000 (21:51 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@906 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum_modules/exporter/exporter.py
forum_modules/exporter/importer.py
forum_modules/exporter/views.py

index e9983d2002ba5963696acb53a759859b20e0a800..f23538e43f44d2cec8078584eef7e65988916cdd 100644 (file)
@@ -12,6 +12,12 @@ from forum import settings
 from django.conf import settings as djsettings
 import settings as selfsettings
 
+# Try to import the with statement
+try:
+    from __future__ import with_statement
+except:
+    pass
+
 CACHE_KEY = "%s_exporter_state" % APP_URL
 EXPORT_STEPS = []
 
index 2fd72e96ad2f7fa8e403936f75d08f8ae9520f19..1519a44f9e6b2d6d134702cf82a90294535eb54e 100644 (file)
@@ -14,6 +14,12 @@ from exporter import TMP_FOLDER, DATETIME_FORMAT, DATE_FORMAT, META_INF_SECTION,
 from orm import orm
 import commands, settings
 
+# Try to import the with statement
+try:
+    from __future__ import with_statement
+except:
+    pass
+
 NO_DEFAULT = object()
 
 import string
index af77f5b0d4b14a13d218f819b361e9105ceaf8d0..856017908dcd1509e3691ab0972ea19e1c7d6512 100644 (file)
@@ -16,6 +16,12 @@ from forum import settings
 from exporter import export, CACHE_KEY, EXPORT_STEPS, DATE_AND_AUTHOR_INF_SECTION, DATETIME_FORMAT
 from importer import start_import
 
+# Try to import the with statement
+try:
+    from __future__ import with_statement
+except:
+    pass
+
 
 @admin_tools_page(_('exporter'), _('XML data export'))
 def exporter(request):