Changeset 64f0a1c in sasmodels


Ignore:
Timestamp:
Oct 11, 2016 8:57:58 AM (7 years ago)
Author:
mathieu
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3a45c2c
Parents:
19e7ca7
Message:

Make sure Sum|Multi models are not loaded a second time as _user. Re #766

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    re4bf271 r64f0a1c  
    125125        if not hasattr(model, 'filename'): 
    126126            model.filename = kernel_module.__file__ 
     127            # For old models, treat .pyc and .py files interchangeably. 
     128            # This is needed because of the Sum|Multi(p1,p2) types of models 
     129            # and the convoluted way in which they are created. 
     130            if model.filename.endswith(".py"): 
     131                logging.info("Loading %s as .pyc", model.filename) 
     132                model.filename = model.filename+'c' 
    127133        if not hasattr(model, 'id'): 
    128134            model.id = splitext(basename(model.filename))[0] 
Note: See TracChangeset for help on using the changeset viewer.