Commits

Martin Skala committed 2ed3e0a

Write exception handling in Python 3 compatible notation

Comments (0)

Files changed (2)

django_roa/db/models.py

                                   force_unicode(payload),
                                   force_unicode(get_args)))
                     response = resource.put(payload=payload, **get_args)
-                except RequestFailed, e:
+                except RequestFailed as e:
                     raise ROAException(e)
             else:
                 record_exists = False
                                   force_unicode(payload),
                                   force_unicode(get_args)))
                     response = resource.post(payload=payload, **get_args)
-                except RequestFailed, e:
+                except RequestFailed as e:
                     raise ROAException(e)
 
             response = force_unicode(response.body_string()).encode(DEFAULT_CHARSET)

django_roa/db/query.py

             response = resource.get(**parameters)
         except ResourceNotFound:
             return
-        except Exception, e:
+        except Exception as e:
             raise ROAException(e)
 
         response = force_unicode(response.body_string()).encode(DEFAULT_CHARSET)
                 resource.uri,
                 force_unicode(parameters)))
             response = resource.get(**parameters)
-        except Exception, e:
+        except Exception as e:
             raise ROAException(e)
 
         cnt = 0
                 resource.uri,
                 force_unicode(parameters)))
             response = resource.get(**parameters)
-        except Exception, e:
+        except Exception as e:
             raise ROAException(e)
 
         response = force_unicode(response.body_string()).encode(DEFAULT_CHARSET)