Changeset 11031:4d70c107a289 in orange for Orange/__init__.py


Ignore:
Timestamp:
11/14/12 16:34:23 (17 months ago)
Author:
Miha Stajdohar <miha.stajdohar@…>
Branch:
default
Message:

Workaround for readthedocs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/__init__.py

    r11012 r11031  
    77ADDONS_ENTRY_POINT = 'orange.addons' 
    88 
    9 from . import orange 
     9import os, sys 
    1010 
    11 # Definitely ugly, but I see no other workaround. 
    12 # When, e.g. data.io executes "from orange import ExampleTable" 
    13 # orange gets imported again since it is not in sys.modules 
    14 # before this entire file is executed 
    15 import sys 
    16 sys.modules["orange"] = orange 
     11if not os.environ.get('READTHEDOCS', None): 
     12    from . import orange 
     13    # Definitely ugly, but I see no other workaround. 
     14    # When, e.g. data.io executes "from orange import ExampleTable" 
     15    # orange gets imported again since it is not in sys.modules 
     16    # before this entire file is executed 
     17    sys.modules["orange"] = orange 
    1718 
    1819# Little trick so that legacy imports work automatically 
Note: See TracChangeset for help on using the changeset viewer.