Changeset 0f48f1e in sasmodels for sasmodels/custom/__init__.py


Ignore:
Timestamp:
Sep 21, 2017 8:34:20 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
9844c3a
Parents:
b866abf
Message:

remove any associated .pyc file before loading a module from path; this may fix the config load problem in sasview

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/custom/__init__.py

    r3c852d4 r0f48f1e  
    3131        if fullname in sys.modules: 
    3232            del sys.modules[fullname] 
     33        if path.endswith(".py") and os.path.exists(path) and os.path.exists(path+"c"): 
     34            # remove automatic pyc file before loading a py file 
     35            os.unlink(path+"c") 
    3336        module = imp.load_source(fullname, os.path.expanduser(path)) 
    34         #os.unlink(path+"c")  # remove the automatic pyc file 
    3537        return module 
    3638 
Note: See TracChangeset for help on using the changeset viewer.