Skip to contentSkip to conversation

gitver: fix try/except syntax for python3 support

PATCH Applied Alejandro Mery 2 participants 5 messages Mar 1, 2017 – Mar 4, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitver: fix try/except syntax for python3 support

https://www.python.org/dev/peps/pep-3110/

It's backward compatible with 2.6+

---
 meta-oe/classes/gitver.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/classes/gitver.bbclass +2 -2
index e7b5155ee..b677996ea 100644
@@ -27,13 +27,13 @@ def get_git_pv(path, d, tagadjust=None):
     gitdir = os.path.abspath(os.path.join(d.getVar("S", True), ".git"))
     try:
         ver = gitrev_run("git describe --tags", gitdir)
-    except Exception, exc:
+    except Exception as exc:
         bb.fatal(str(exc))
 
     if not ver:
         try:
             ver = gitrev_run("git rev-parse --short HEAD", gitdir)
-        except Exception, exc:
+        except Exception as exc:
             bb.fatal(str(exc))
 
         if ver:
Signature · 1 line
2.11.0
#1 lore raw
Quoted 19 lines · Alejandro Mery

https://www.python.org/dev/peps/pep-3110/

It's backward compatible with 2.6+

---
 meta-oe/classes/gitver.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/classes/gitver.bbclass +1 -1
index e7b5155ee..b677996ea 100644
@@ -27,13 +27,13 @@ def get_git_pv(path, d, tagadjust=None):
     gitdir = os.path.abspath(os.path.join(d.getVar("S", True), ".git"))
     try:
         ver = gitrev_run("git describe --tags", gitdir)
-    except Exception, exc:
+    except Exception as exc:

meta-oe/classes/gitver.bbclass def get_git_pv(path, d, tagadjust=None): · line 39

Quoted 10 lines
meta-oe/classes/gitver.bbclass +1 -1
         bb.fatal(str(exc))
 
     if not ver:
         try:
             ver = gitrev_run("git rev-parse --short HEAD", gitdir)
-        except Exception, exc:
+        except Exception as exc:
             bb.fatal(str(exc))
 
         if ver:

I forgot to mention, I'm having this problem using morty

Applied
#2 lore raw
Quoted 29 lines · Alejandro Mery
Quoted 28 lines · Alejandro Mery

https://www.python.org/dev/peps/pep-3110/

It's backward compatible with 2.6+

---
 meta-oe/classes/gitver.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/classes/gitver.bbclass +2 -2
index e7b5155ee..b677996ea 100644
@@ -27,13 +27,13 @@ def get_git_pv(path, d, tagadjust=None):
     gitdir = os.path.abspath(os.path.join(d.getVar("S", True), ".git"))
     try:
         ver = gitrev_run("git describe --tags", gitdir)
-    except Exception, exc:
+    except Exception as exc:
         bb.fatal(str(exc))
 
     if not ver:
         try:
             ver = gitrev_run("git rev-parse --short HEAD", gitdir)
-        except Exception, exc:
+        except Exception as exc:
             bb.fatal(str(exc))
 
Quoted 3 lines

meta-oe/classes/gitver.bbclass def get_git_pv(path, d, tagadjust=None): · line 39

Quoted 1 line
meta-oe/classes/gitver.bbclass +0 -0
         if ver:

I forgot to mention, I'm having this problem using morty

Next time, please send version applicable and tested in master branch first, then you can request backport to morty.

I've applied this manually to master-next now.

Thanks

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#3 lore raw
Quoted 30 lines · Martin Jansa
Quoted 29 lines · Alejandro Mery
Quoted 28 lines · Alejandro Mery

https://www.python.org/dev/peps/pep-3110/

It's backward compatible with 2.6+

---
 meta-oe/classes/gitver.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/classes/gitver.bbclass +2 -2
index e7b5155ee..b677996ea 100644
@@ -27,13 +27,13 @@ def get_git_pv(path, d, tagadjust=None):
     gitdir = os.path.abspath(os.path.join(d.getVar("S", True), ".git"))
     try:
         ver = gitrev_run("git describe --tags", gitdir)
-    except Exception, exc:
+    except Exception as exc:
         bb.fatal(str(exc))
 
     if not ver:
         try:
             ver = gitrev_run("git rev-parse --short HEAD", gitdir)
-        except Exception, exc:
+        except Exception as exc:
             bb.fatal(str(exc))
 
Quoted 4 lines
Quoted 2 lines

meta-oe/classes/gitver.bbclass def get_git_pv(path, d, tagadjust=None): · line 39

Quoted 1 line
meta-oe/classes/gitver.bbclass +0 -0
         if ver:

I forgot to mention, I'm having this problem using morty

Next time, please send version applicable and tested in master branch first, then you can request backport to morty.

sorry about that. does it help to send (tested) patches against both? (master and morty) or backporting only happens after the change goes from master-next into master anyway?

Quoted 1 line

I've applied this manually to master-next now.

thank you

#4 lore raw
Quoted 31 lines · Alejandro Mery
Quoted 30 lines · Martin Jansa
Quoted 29 lines · Alejandro Mery
Quoted 28 lines · Alejandro Mery

https://www.python.org/dev/peps/pep-3110/

It's backward compatible with 2.6+

---
 meta-oe/classes/gitver.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/classes/gitver.bbclass +2 -2
index e7b5155ee..b677996ea 100644
@@ -27,13 +27,13 @@ def get_git_pv(path, d, tagadjust=None):
     gitdir = os.path.abspath(os.path.join(d.getVar("S", True), ".git"))
     try:
         ver = gitrev_run("git describe --tags", gitdir)
-    except Exception, exc:
+    except Exception as exc:
         bb.fatal(str(exc))
 
     if not ver:
         try:
             ver = gitrev_run("git rev-parse --short HEAD", gitdir)
-        except Exception, exc:
+        except Exception as exc:
             bb.fatal(str(exc))
 
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

meta-oe/classes/gitver.bbclass def get_git_pv(path, d, tagadjust=None): · line 39

Quoted 1 line
meta-oe/classes/gitver.bbclass +0 -0
         if ver:

I forgot to mention, I'm having this problem using morty

Next time, please send version applicable and tested in master branch first, then you can request backport to morty.

sorry about that. does it help to send (tested) patches against both? (master and morty) or backporting only happens after the change goes from master-next into master anyway?

Normally only after it's tested and merged in master.

You can send both at the same time, but then release branch maintainer needs to check and hold the change until it's merged in master (or update it if it gets updated before merge to master or even reject if rejected for master for whatever reason). So it's easier for maintainers if you send it after it's merged and you explicitly say which commit from master you're backporting to morty.

Quoted 4 lines
Quoted 1 line

I've applied this manually to master-next now.

thank you

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]