~free.ekanayaka/storm/any-expr

« back to all changes in this revision

Viewing changes to storm/__init__.py

  • Committer: Jamu Kakar
  • Date: 2009-11-24 19:10:43 UTC
  • mfrom: (327.2.4 default-c-extensions)
  • Revision ID: jkakar@kakar.ca-20091124191043-z45n74ff1ebnh4w3
Merged default-c-extensions [r=jamesh,therve] [f=410592]

Storm's C extensions are enabled by default.  They can be disabled
by defining the STORM_CEXTENSIONS environment variable to '0'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
Undef = UndefType()
45
45
 
46
46
 
47
 
# XXX The default is 1 for now.  In the future we'll invert this logic so
48
 
#     that it's enabled by default.
 
47
# C extensions are enabled by default.  They are not used if the
 
48
# STORM_CEXTENSIONS environment variable is set to '0'.  If they can't be
 
49
# imported Storm will automatically use Python versions of the optimized code
 
50
# in the C extension.
49
51
has_cextensions = False
50
 
if os.environ.get("STORM_CEXTENSIONS") == "1":
 
52
if os.environ.get("STORM_CEXTENSIONS") != "0":
51
53
    try:
52
54
        from storm import cextensions
53
55
        has_cextensions = True
54
56
    except ImportError, e:
55
 
        # XXX Once the logic is inverted and cextensions are enabled by
56
 
        #     default, use the following version so that people may opt
57
 
        #     to use and distribute the pure Python version.
58
 
        #if "cextensions" not in str(e):
59
 
        #    raise
60
 
        raise
 
57
        if "cextensions" not in str(e):
 
58
           raise