Skip to content

Commit 04484d5

Browse files
author
Bruno da Silva de Oliveira
committed
- Fixed bug with exception declarations
[SVN r22459]
1 parent 476cba2 commit 04484d5

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

pyste/src/Pyste/CppParser.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ def ParseWithGCCXML(self, header, tail):
130130
return declarations
131131
finally:
132132
if settings.DEBUG and os.path.isfile(xmlfile):
133-
filename = os.path.basename(header)
134-
filename = os.path.splitext(filename)[0] + '.xml'
135-
shutil.copy(xmlfile, filename)
133+
debugname = os.path.basename(header)
134+
debugname = os.path.splitext(debugname)[0] + '.xml'
135+
print 'DEBUG:', debugname
136+
shutil.copy(xmlfile, debugname)
136137
# delete the temporary files
137138
try:
138139
os.remove(xmlfile)

pyste/src/Pyste/declarations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def Exceptions(self):
223223
if self.throws is None:
224224
return ""
225225
else:
226-
return " throw(%s)" % ', '.join (self.throws)
226+
return " throw(%s)" % ', '.join ([x.FullName() for x in self.throws])
227227

228228

229229
def PointerDeclaration(self, force=False):
@@ -236,7 +236,7 @@ def PointerDeclaration(self, force=False):
236236
else:
237237
result = self.result.FullName()
238238
params = ', '.join([x.FullName() for x in self.parameters])
239-
return '(%s (*)(%s))&%s' % (result, params, self.FullName())
239+
return '(%s (*)(%s)%s)&%s' % (result, params, self.Exceptions(), self.FullName())
240240

241241

242242
def MinArgs(self):
@@ -346,7 +346,7 @@ def IsCopy(self):
346346
param = self.parameters[0]
347347
class_as_param = self.parameters[0].name == self.class_
348348
param_reference = isinstance(param, ReferenceType)
349-
is_public = self.visibility = Scope.public
349+
is_public = self.visibility == Scope.public
350350
return param_reference and class_as_param and param.const and is_public
351351

352352

0 commit comments

Comments
 (0)