Преглед на файлове

HUE-8737 [core] Futurize apps/about/ for Python 3.5

Ying Chen преди 6 години
родител
ревизия
068de915a3
променени са 2 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 1 0
      apps/about/src/about/tests.py
  2. 2 1
      apps/about/src/about/views.py

+ 1 - 0
apps/about/src/about/tests.py

@@ -15,6 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from builtins import object
 import json
 
 from django.contrib.auth.models import User

+ 2 - 1
apps/about/src/about/views.py

@@ -15,6 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from builtins import str
 import json
 import logging
 
@@ -55,7 +56,7 @@ def update_preferences(request):
       settings.save()
       response['status'] = 0
       response['collect_usage'] = settings.collect_usage
-    except Exception, e:
+    except Exception as e:
       response['data'] = str(e)
   else:
     response['data'] = _('POST request required.')