[kde-workspace/KDE/4.9] plasma/generic/scriptengines/python: Unbreak Python 2 applet loading.

Albert Astals Cid aacid at kde.org
Mon Oct 1 10:08:19 UTC 2012


--- El lun, 1/10/12, Torgny Nyblom <nyblom at kde.org> escribió:

> Should we respin kde-workspace to include this?
> @Albert what do you think?

Looks serious enough, so I'd go for a respin.

Cheers,
  Albert

P.S: We'll have to update https://bugs.kde.org/show_bug.cgi?id=307416 since the respin moves the fix into 4.9.2 instead of 4.9.3

> 
> /Regards
> Torgny
> 
> On Monday 01 October 2012 11.11.11 Luca Beltrame wrote:
> > Git commit 92c79ebd767fd90eafa1e3865bfbbddcfa695c08 by
> Luca Beltrame.
> > Committed on 01/10/2012 at 11:02.
> > Pushed by lbeltrame into branch 'KDE/4.9'.
> > 
> > Unbreak Python 2 applet loading.
> > 
> > exec() is a function in Py3, but the syntax used in
> this file does not
> > allow it for being called as a function in Python 2.
> Thus, a simple check
> > is made, calling the right function depending on the
> Python version.
> > 
> > It will likely not work with Python 3, but however
> applets are not
> > supposed to in the first place.
> > 
> > CCMAIL: release-team at kde.org
> > CCMAIL: kde-packager at kde.org
> > 
> > (cherry picked from commit
> 14f7b6a18ef8a81237df43551ee7bda122827d93)
> > 
> > M  +7    -1   
> plasma/generic/scriptengines/python/plasma_importer.py
> > 
> > http://commits.kde.org/kde-workspace/92c79ebd767fd90eafa1e3865bfbbddcfa695c08
> > 
> > diff --git
> a/plasma/generic/scriptengines/python/plasma_importer.py
> b/plasma/generic/scriptengines/python/plasma_importer.py
> > index 8d75f88..dae245a 100644
> > ---
> a/plasma/generic/scriptengines/python/plasma_importer.py
> > +++
> b/plasma/generic/scriptengines/python/plasma_importer.py
> > @@ -22,6 +22,9 @@ import sys
> >  import os
> >  import imp
>> > +PY3 = sys.version_info[0] == 3
> > +
> > +
> >  class PlasmaImporter(object):
> >      def __init__(self):
> >          self.toplevel = {}
> > @@ -104,7 +107,10 @@ class PlasmaImporter(object):
> >             
> mod.__path__ = [self.marker]
> >          if code is not None:
> >              try:
> > -             
>   exec (code in mod.__dict__)
> > +             
>   if PY3:
> > +             
>       exec(code in mod.__dict__)
> > +             
>   else:
> > +             
>       exec code in mod.__dict__
> >             
> finally:
> >               
>   code.close()
> >          return mod
> > _______________________________________________
> > release-team mailing list
> > release-team at kde.org
> > https://mail.kde.org/mailman/listinfo/release-team
> _______________________________________________
> release-team mailing list
> release-team at kde.org
> https://mail.kde.org/mailman/listinfo/release-team
> 


More information about the release-team mailing list