提交 b05d4563 authored 作者: nouiz's avatar nouiz

Merge pull request #323 from delallea/version_fix

Fixed crash when theano.version does not exist
......@@ -41,6 +41,15 @@ import configparser, configdefaults
config = configparser.TheanoConfigParser()
# Version information.
# Note that the version must be defined before imports below as it is used by
# some of these imports.
try:
import theano.version
__version__ = theano.version.version
except ImportError:
__version__ = "unknown"
import gof
from gof import \
......@@ -142,11 +151,3 @@ def dot(l, r):
if rval == NotImplemented:
raise NotImplementedError("Dot failed for the following reasons:", (e0, e1))
return rval
# Version information
try:
import theano.version
__version__ = theano.version.version
except ImportError:
__version__ = "unknown"
......@@ -6,7 +6,6 @@ import re
import sys
import theano
import theano.version
from theano.configparser import config, AddConfigVar, ConfigParam, StrParam
......@@ -15,7 +14,7 @@ def default_compiledirname():
platform.platform(),
platform.processor(),
platform.python_version(),
theano.version.version])
theano.__version__])
platform_id = re.sub("[\(\)\s,]+", "_", platform_id)
return 'compiledir_' + platform_id
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论