[elbe-devel] [PATCH] Replace deprecated SQLAlchemy method

Torben Hohn torben.hohn at linutronix.de
Wed Jun 16 09:51:32 CEST 2021


On Wed, Jun 09, 2021 at 11:31:09AM +0000, Braunwarth, Daniel wrote:
> The with_lockmode method is deprecated since version 0.9 and has been
> removed in version 1.4.
> 
> Signed-off-by: Daniel Braunwarth <daniel.braunwarth at kuka.com>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/db.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/elbepack/db.py b/elbepack/db.py
> index 0b8c2d130..caaf8aa3c 100644
> --- a/elbepack/db.py
> +++ b/elbepack/db.py
> @@ -501,7 +501,7 @@ class ElbeDB:
>          assert "busy" not in allowed_status
>          with session_scope(self.session) as s:
>              try:
> -                p = s.query(Project).with_lockmode('update'). \
> +                p = s.query(Project).with_for_update(). \
>                      filter(Project.builddir == builddir).one()
>              except NoResultFound:
>                  raise ElbeDBError(
> @@ -533,7 +533,7 @@ class ElbeDB:
>  
>          with session_scope(self.session) as s:
>              try:
> -                p = s.query(Project).with_lockmode('update'). \
> +                p = s.query(Project).with_for_update(). \
>                      filter(Project.builddir == builddir).one()
>              except NoResultFound:
>                  raise ElbeDBError(
> -- 
> 2.32.0
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner


More information about the elbe-devel mailing list