[pypy-commit] pypy win32-cleanup2: windows exception on get linenumber, linecolumn after error
mattip
noreply at buildbot.pypy.org
Sun Apr 8 00:46:00 CEST 2012
Author: Matti Picus <matti.picus at gmail.com>
Branch: win32-cleanup2
Changeset: r54240:0e4763b18703
Date: 2012-04-06 17:22 +0300
http://bitbucket.org/pypy/pypy/changeset/0e4763b18703/
Log: windows exception on get linenumber, linecolumn after error
diff --git a/pypy/module/pyexpat/interp_pyexpat.py b/pypy/module/pyexpat/interp_pyexpat.py
--- a/pypy/module/pyexpat/interp_pyexpat.py
+++ b/pypy/module/pyexpat/interp_pyexpat.py
@@ -10,6 +10,7 @@
from pypy.translator.platform import platform
import sys
+import os
import weakref
import py
@@ -677,8 +678,12 @@
def set_error(self, space, code):
err = rffi.charp2strn(XML_ErrorString(code), 200)
- lineno = XML_GetCurrentLineNumber(self.itself)
- colno = XML_GetCurrentColumnNumber(self.itself)
+ if os.name == 'nt':
+ lineno = -1
+ colno = -1
+ else:
+ lineno = XML_GetCurrentLineNumber(self.itself)
+ colno = XML_GetCurrentColumnNumber(self.itself)
msg = "%s: line %d, column %d" % (err, lineno, colno)
w_errorcls = space.fromcache(Cache).w_error
w_error = space.call_function(w_errorcls, space.wrap(msg))
More information about the pypy-commit
mailing list