Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Src/IronPython/Compiler/Ast/ClassDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ private Microsoft.Scripting.Ast.LightExpression<Func<CodeContext, CodeContext>>
MSAst.Expression? docStmt = null;
string? doc = GetDocumentation(Body);
if (doc is not null) {
docStmt = SetLocalName("__doc__", Ast.Constant(doc, typeof(object)));
docStmt = SetLocalName("__doc__", Ast.Constant(doc, typeof(string)));
}

// Create the body
Expand Down
18 changes: 0 additions & 18 deletions Tests/test_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,24 +824,6 @@ class SomeOtherError(SomeError, IOError):
except SomeOtherError:
pass


@unittest.skipIf(is_netcoreapp, 'no clr.CompileModules')
@skipUnlessIronPython()
def test_gh1357(self):
filename = os.path.join(self.temporary_dir, 'gh1357_%d.py' % os.getpid())
dll = os.path.join(self.temporary_dir, "test_%d.dll" % os.getpid())
with open(filename, 'w') as f:
f.write('{(1,): None}')

import clr
try:
clr.CompileModules(dll, filename)
except:
Fail('Failed to compile the specified file')
finally:
os.unlink(filename)
os.unlink(dll)

@skipUnlessIronPython()
def test_gh1435(self):
import clr
Expand Down
40 changes: 39 additions & 1 deletion Tests/test_regressions_compiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,49 @@
Test issues related to compiled code.
"""

from iptest import IronPythonTestCase, run_test
import os
import unittest

from iptest import IronPythonTestCase, is_netcoreapp, skipUnlessIronPython, run_test

class RegressionCompiledTest(IronPythonTestCase):
def test_gh_ipy2_563(self):
"""https://github.com/IronLanguages/ironpython2/issues/563"""
eval('3.14')

@unittest.skipIf(is_netcoreapp, 'no clr.CompileModules')
@skipUnlessIronPython()
def test_gh1357(self):
filename = os.path.join(self.temporary_dir, 'gh1357_%d.py' % os.getpid())
dll = os.path.join(self.temporary_dir, "test_%d.dll" % os.getpid())
with open(filename, 'w') as f:
f.write('{(1,): None}')

import clr
try:
clr.CompileModules(dll, filename)
except:
Fail('Failed to compile the specified file')
finally:
os.unlink(filename)
os.unlink(dll)

@unittest.skipIf(is_netcoreapp, 'no clr.CompileModules')
@skipUnlessIronPython()
def test_ipy3_gh1601(self):
filename = os.path.join(self.temporary_dir, 'test_ipy3_gh1601_%d.py' % os.getpid())
dll = os.path.join(self.temporary_dir, "test_ipy3_gh1601_%d.dll" % os.getpid())
with open(filename, 'w') as f:
f.write('class MyClass:\n')
f.write(' """description"""\n')

import clr
try:
clr.CompileModules(dll, filename)
except:
Fail('Failed to compile the specified file')
finally:
os.unlink(filename)
os.unlink(dll)

run_test(__name__)