Skip to content

Commit

Permalink
Merge pull request #54 from zooba/issue42
Browse files Browse the repository at this point in the history
#42 Azure remote debugging - breaking doesn't work
  • Loading branch information
int19h committed Apr 27, 2015
2 parents 295ba24 + c6dd077 commit c0d6891
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Python/Product/Debugger/Debugger/PythonProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,24 @@ internal IList<PythonThread> GetThreads() {
internal PythonAst GetAst(string filename) {
PythonAst ast;
lock (_astCacheLock) {
_astCache.TryGetValue(filename, out ast);
if (_astCache.TryGetValue(filename, out ast)) {
return ast;
}
}

if (ast == null) {
try {
using (var source = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read)) {
ast = Parser.CreateParser(source, LanguageVersion).ParseFile();
lock (_astCacheLock) {
_astCache[filename] = ast;
}
}
} catch (ArgumentException) {
} catch (IOException) {
} catch (UnauthorizedAccessException) {
} catch (NotSupportedException) {
} catch (System.Security.SecurityException) {
}

lock (_astCacheLock) {
_astCache[filename] = ast;
}

return ast;
Expand Down

0 comments on commit c0d6891

Please sign in to comment.