File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 3333 sys .version_info [0 ], sys .version_info [1 ]
3434 )
3535
36- if not os .path .exists (build_dir ):
37- print ("""
38- Compiled version of pyosmium not found, please build pyosmium for Python {}.{}
39- before building the documentation.
40- """ .format (* sys .version_info ))
41- raise RuntimeError ("Cannot find pyosmium" )
36+ if os .path .exists (build_dir ):
37+ sys .path .insert (0 , os .path .normpath (os .path .join (os .path .abspath ('.' ), build_dir )))
4238
4339# insert after the current directory
44- sys .path .insert (0 , os .path .normpath (os .path .join (os .path .abspath ('.' ), build_dir )))
4540sys .path .insert (0 , os .path .normpath (os .path .join (os .path .abspath ('.' ), '../tools' )))
4641
47- from osmium .version import pyosmium_major , pyosmium_release
42+ try :
43+ from osmium .version import pyosmium_major , pyosmium_release
44+ except ImportError :
45+ print ("""
46+ Compiled version of pyosmium not found, please build pyosmium for Python {}.{}
47+ before building the documentation.
48+ """ .format (* sys .version_info ))
49+ raise RuntimeError ("Cannot find pyosmium" )
4850
4951# -- General configuration ------------------------------------------------
5052
You can’t perform that action at this time.
0 commit comments