Fix syntax parsing

This commit is contained in:
Eric Holscher 2015-07-20 11:10:52 -07:00
parent 4ecc7e0228
commit b7a6845865

View File

@ -1,6 +1,7 @@
from collections import defaultdict
import os import os
import subprocess import subprocess
from collections import defaultdict import traceback
import yaml import yaml
from sphinx.util.osutil import ensuredir from sphinx.util.osutil import ensuredir
@ -33,7 +34,8 @@ class DotNetSphinxMapper(SphinxMapperBase):
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
env=dict((key, os.environ[key]) env=dict((key, os.environ[key])
for key in ['PATH', 'DNX_PATH', 'HOME'] for key in ['PATH', 'DNX_PATH', 'HOME']
if key in os.environ)) if key in os.environ),
)
_, error_output = proc.communicate() _, error_output = proc.communicate()
if error_output: if error_output:
self.app.warn(error_output) self.app.warn(error_output)
@ -210,9 +212,9 @@ class DotNetPythonMapper(PythonMapperBase):
if syntax is not None: if syntax is not None:
# Code example # Code example
try: try:
self.example = syntax['content']['CSharp'] self.example = syntax['content']
except KeyError: except (KeyError, TypeError):
pass traceback.print_exc()
self.parameters = [] self.parameters = []
for param in syntax.get('parameters', []): for param in syntax.get('parameters', []):