diff options
Diffstat (limited to 'test/XiteWin.py')
| -rw-r--r-- | test/XiteWin.py | 14 | 
1 files changed, 9 insertions, 5 deletions
| diff --git a/test/XiteWin.py b/test/XiteWin.py index 0dd9e4309..5953fd502 100644 --- a/test/XiteWin.py +++ b/test/XiteWin.py @@ -182,7 +182,11 @@ class XiteWin():  	def OnCreate(self, hwnd):  		self.win = hwnd  		# Side effect: loads the DLL -		x = ctypes.windll.SciLexer.Scintilla_DirectFunction +		try: +			x = ctypes.windll.SciLexer.Scintilla_DirectFunction +		except OSError: +			print("Can't find SciLexer.DLL") +			sys.exit()  		self.sciHwnd = user32.CreateWindowExW(0,  			"Scintilla", "Source",  			WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_CLIPCHILDREN, @@ -299,16 +303,16 @@ class XiteWin():  	def Open(self):  		ofx = OPENFILENAME(self.win, "Open File") -		opath = "\0" * 1024 -		ofx.lpstrFile = opath +		opath = ctypes.create_unicode_buffer(1024) +		ofx.lpstrFile = ctypes.addressof(opath)  		filters = ["Python (.py;.pyw)|*.py;*.pyw|All|*.*"]  		filterText = "\0".join([f.replace("|", "\0") for f in filters])+"\0\0"  		ofx.lpstrFilter = filterText  		if ctypes.windll.comdlg32.GetOpenFileNameW(ctypes.byref(ofx)): -			absPath = opath.replace("\0", "") +			absPath = opath.value.replace("\0", "")  			self.GrabFile(absPath)  			self.FocusOnEditor() -			self.ed.LexerLanguage = "python" +			self.ed.LexerLanguage = b"python"  			self.ed.Lexer = self.ed.SCLEX_PYTHON  			self.ed.SetKeyWords(0, b"class def else for from if import print return while")  			for style in [k for k in self.ed.k if k.startswith("SCE_P_")]: | 
