sgzwiz / brython

Automatically exported from code.google.com/p/brython
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Importing a module containing a class definition fails #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Html module:
------------
<html>
    <head>
        <title>Brython test</title>
        <script src="brython.js"></script>
        <meta charset="utf-8"/>
    </head>

    <body onLoad="brython(1)">
        <script type="text/python">
        import simple
        print( dir(simple) )
        o = simple.Simple()
        </script>
    </body>
</html>

Python module
-------------
print(1)

class Simple:
    def __init__(self):
        print("SimpleClass")

print(2)

Result
------
1
ReferenceError: Simple is not defined
module 'simple' line 3
class Simple: @ file:///mnt/prz/tools/snipsets/kanban/tests/brython.js:3533

Original issue reported on code.google.com by pedro.ro...@gmail.com on 11 Jan 2013 at 9:36

GoogleCodeExporter commented 9 years ago

Original comment by pierre.q...@gmail.com on 14 Jan 2013 at 9:52

GoogleCodeExporter commented 9 years ago
Fixed in version 1.1

Original comment by pierre.q...@gmail.com on 16 Feb 2013 at 5:26