[QGIS-Developer] Procesing pyqgis with alg decorator

Nyall Dawson nyall.dawson at gmail.com
Tue Jul 16 16:42:04 PDT 2019


On Mon, 15 Jul 2019 at 22:37, matteo <matteo.ghetta at gmail.com> wrote:
>
> Hi all,
>
> I'm trying a super simple script in Processing with the alg decorator
> syntax.
>
> Basically I'm not doing anything, but a weird error is thrown when I try
> to append vector layer features to a list:
>
> NameError: free variable 'self' referenced before assignment in
> enclosing scope
> Traceback (most recent call last):
>   File
> "/home/matteo/dev/build-QGIS-Desktop-Default/output/python/plugins/processing/gui/AlgorithmDialog.py",
> line 244, in on_complete
>     self.feedback.pushInfo(self.tr('Execution completed in {0:0.2f}
> seconds').format(time.time() - start_time))
> NameError: free variable 'self' referenced before assignment in
> enclosing scope

I don't see what you're seeing, but I do get a crash when running your
alg. Can you confirm that removing the "l" list fixes it for you?

Very strange...
Nyall


More information about the QGIS-Developer mailing list