abdelrahmanmoez / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Add support for try/finally/except #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
ipm> try:
 a=4/0
except Exception, e:
 print "in exception"
finally:
 print "in finally"

What is the expected output? What do you see instead?

Expected:
in exception
in finally

Got:
NotImplementedError:Illegal bytecode (122/0x7a/SETUP_FINALLY) comes at 
offset 0 in file <ipm>.

Solution depends on classes in order to create the Exception class.

Original issue reported on code.google.com by dwhall...@gmail.com on 16 Apr 2009 at 5:31

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by dwhall...@gmail.com on 14 Dec 2009 at 8:50

GoogleCodeExporter commented 8 years ago
Changing Milestone-r10 to Milestone-r09

Original comment by dwhall...@gmail.com on 7 Mar 2010 at 6:26

GoogleCodeExporter commented 8 years ago
Changed r09 to R09

Original comment by dwhall...@gmail.com on 12 Mar 2010 at 8:22

GoogleCodeExporter commented 8 years ago

Original comment by dwhall...@gmail.com on 13 Mar 2010 at 1:30

GoogleCodeExporter commented 8 years ago

Original comment by dwhall...@gmail.com on 4 Aug 2010 at 10:10

GoogleCodeExporter commented 8 years ago

Original comment by dwhall...@gmail.com on 12 Aug 2010 at 2:37

GoogleCodeExporter commented 8 years ago

Original comment by dwhall...@gmail.com on 17 Sep 2010 at 1:57

GoogleCodeExporter commented 8 years ago
not working -- the "with" Statement (http://www.python.org/dev/peps/pep-0343/)

it is -- related with this (try/except/filally) issue?

Original comment by polymor...@gmail.com on 15 Mar 2011 at 12:20

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
(pymite-09)

ipm> class D:
....     def __enter__(self):
        print 123
    def __exit__(self, type, value, tb):
        print 234.... .... .... 
.... 
ipm> 
ipm> d = D()
ipm> 
ipm> d.__enter__()
123
ipm> d.__exit__(None, None, None)
234
ipm> 
ipm> with d:
....    print 'abc'
.... 
NotImplementedError:Illegal bytecode (122/0x7a/SETUP_FINALLY) comes at offset 
15 in file <ipm>.
ipm> 

Original comment by polymor...@gmail.com on 15 Mar 2011 at 12:58

GoogleCodeExporter commented 8 years ago
Adding support for the "with" syntax would be a new feature that depends on 
issue 6.  So I would make that a new issue called "Add support for the 'with' 
statement"

Original comment by dwhall...@gmail.com on 19 Mar 2011 at 11:42

GoogleCodeExporter commented 8 years ago

Original comment by dwhall...@gmail.com on 25 Mar 2012 at 4:38

GoogleCodeExporter commented 8 years ago
Splitting this issue into multiple sub tasks.
The first is Issue #252 which implements the simplest form of try/catch.

Original comment by dwhall...@gmail.com on 21 Jun 2013 at 4:30