Ticket #1253: patch1.diff

File patch1.diff, 1.2 KB (added by ales, 22 months ago)
  • source/orange/lib_components.cpp

    # HG changeset patch
    # User Ales Erjavec <ales.erjavec@fri.uni-lj.si>
    # Date 1353506153 -3600
    # Node ID 1235d1750e69be7f66b5c107d59474c0cb59a476
    # Parent  51e701fc98459958e075a557008d0956c7b57317
    [mq]: prob-estimator-const-fix
    
    diff --git a/source/orange/lib_components.cpp b/source/orange/lib_components.cpp
    a b  
    24582458 
    24592459    argp = args; 
    24602460    if ((argp != argc) && ((*argp==Py_None) || PyOrDistribution_Check(*argp))) { 
    2461         dist = (*argp==Py_None) ? PDistribution() : PyOrange_AsDistribution(*argp++); 
     2461        if (*argp == Py_None){ 
     2462            dist = PDistribution(); 
     2463            argp++; 
     2464        } else { 
     2465            dist = PyOrange_AsDistribution(*argp++); 
     2466        } 
     2467 
    24622468        if ((argp != argc) && PyOrDistribution_Check(*argp)) 
    24632469            apriori = PyOrange_AsDistribution(*argp++); 
    24642470    } 
     
    25242530 
    25252531    argp = args; 
    25262532    if ((argp != argc) && ((*argp==Py_None) || PyOrContingency_Check(*argp))) { 
    2527         cont = (*argp==Py_None) ? PContingency() : PyOrange_AsContingency(*argp++); 
     2533        if (*argp==Py_None){ 
     2534            cont = PContingency(); 
     2535            argp++; 
     2536        } else { 
     2537            cont = PyOrange_AsContingency(*argp++); 
     2538        } 
     2539 
    25282540        if ((argp != argc) && PyOrDistribution_Check(*argp)) 
    25292541            apriori = PyOrange_AsDistribution(*argp++); 
    25302542    }