View Issue Details

IDProjectCategoryView StatusLast Update
0001431FreeCADBugpublic2014-02-22 14:20
Reporterwmayer Assigned Toyorik  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version0.14 
Summary0001431: Unproper implementation of IsActive() in Python commands
DescriptionMany Python commands in Draft and Arch implement the IsActive() method in an unproper way. The consequence is that PyCXX internally throws and handles C++ exceptions all the time.

Now when trying to debug FreeCAD you often get catchpoints which makes it harder to do your actual work. See 0001420

Example code:

    def IsActive(self):
        self.selection = Draft.getSelection()
        if (Draft.getType(self.selection[0]) in ['Wire','BSpline']):
            return True
        else:
            return False

The command doesn't check if selection is an empty list and thus causes an index error.
TagsNo tags attached.
FreeCAD Information

Relationships

related to 0001420 closedwmayer exceptions thrown with python object. 

Activities

There are no notes attached to this issue.

Related Changesets

FreeCAD: master 114ccd21

2014-02-22 14:59:28

yorik

Details Diff
Draft: Fixed IsActive methods - fixes 0001431 Affected Issues
0001431
mod - src/Mod/Draft/DraftTools.py Diff File

Issue History

Date Modified Username Field Change
2014-02-22 11:05 wmayer New Issue
2014-02-22 11:05 wmayer Status new => assigned
2014-02-22 11:05 wmayer Assigned To => yorik
2014-02-22 11:05 wmayer Relationship added related to 0001420
2014-02-22 14:20 yorik Changeset attached => FreeCAD Master master 114ccd21
2014-02-22 14:20 yorik Status assigned => closed
2014-02-22 14:20 yorik Resolution open => fixed