Changeset dcf88ff in git for Singular/pyobject_setup.cc


Ignore:
Timestamp:
Dec 11, 2012, 7:28:54 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
3e7db4d961b4509d248e12d8e96e2bed08d9cfe8
Parents:
e7cccf3b8b35aa52ffffb9f6d1a54ae569d3466fbd8204a951e445d6081f81d1727da65972ead678
Message:
Merge pull request #226 from alexanderdreyer/spielwiese-pyobject

Fix: nonexisting or old python won't break build + ...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/pyobject_setup.cc

    re7cccf3 rdcf88ff  
    4949void* pyobject_autoload(blackbox* bbx)
    5050{
    51   if (pyobject_load()) return NULL;
    52   return bbx->blackbox_Init(bbx);
     51  assume(bbx != NULL);
     52  return (pyobject_load()? NULL: bbx->blackbox_Init(bbx));
    5353}
    5454
     
    6767}
    6868
     69/// Explicitely load, if not loaded already
     70BOOLEAN pyobject_ensure() {
     71
     72  int tok = -1;
     73  blackbox* bbx = (blackboxIsCmd("pyobject", tok) == ROOT_DECL?
     74                   getBlackboxStuff(tok): (blackbox*)NULL);
     75  if (bbx == NULL) return TRUE;
     76  return (bbx->blackbox_Init == pyobject_autoload?  pyobject_load(): FALSE); 
     77}
     78
     79
     80
Note: See TracChangeset for help on using the changeset viewer.