[anjuta] python: Improve error handling in autocompletion script



commit ea6d34ce2b69c43a63d395983aa21a8e41b0ba5a
Author: Johannes Schmid <jhs gnome org>
Date:   Wed Feb 16 20:39:56 2011 +0100

    python: Improve error handling in autocompletion script
    
    Should fix rh#649211

 .../anjuta-python-autocomplete.py                  |   21 ++++++++++---------
 1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/plugins/language-support-python/anjuta-python-autocomplete.py b/plugins/language-support-python/anjuta-python-autocomplete.py
index 89fc996..34c0d92 100755
--- a/plugins/language-support-python/anjuta-python-autocomplete.py
+++ b/plugins/language-support-python/anjuta-python-autocomplete.py
@@ -55,17 +55,18 @@ res = proj.get_resource(respath)
 
 position = int(offset_arg)
 
-if option == "autocomplete":
-	proposals = codeassist.code_assist(proj, source_code, position, resource=res, maxfixes=10)
-	proposals = codeassist.sorted_proposals(proposals)
+try:
+	if option == "autocomplete":
+		proposals = codeassist.code_assist(proj, source_code, position, resource=res, maxfixes=10)
+		proposals = codeassist.sorted_proposals(proposals)
 
-	for proposal in proposals:
-		print proposal
+		for proposal in proposals:
+			print proposal
 
-elif option == "calltip":
-	proposals = codeassist.get_doc(proj, source_code, position, resource=res, maxfixes=10)
-	print proposals
+	elif option == "calltip":
+		proposals = codeassist.get_doc(proj, source_code, position, resource=res, maxfixes=10)
+		print proposals
+except:
+	pass
 
 proj.close()
-
-



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]