473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

problem with change to exceptions

import exceptions

class nothing (exceptions.Exception):
def __init__ (self, args=None):
self.args = args

if __name__ == "__main__":
raise nothing

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/tmp/python-3143hDH", line 5, in __init__
self.args = args
TypeError: 'NoneType' object is not iterable

I'll have to say, I don't understand this error.

Jul 27 '07 #1
1 965
Neal Becker <nd*******@gmail.comwrites:
TypeError: 'NoneType' object is not iterable
I'll have to say, I don't understand this error.
It's "lame duck typing". The .args attribute on an Exception instance
is expected to be a tuple of the arguments passed through the raise
statement. It is None if no args were passed.
Jul 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ashish | last post by:
We are working on development of an IFilter component for Jpeg and tiff files.First ever test resulted in following error. We are using ifilttst.exe(which comes with windows 2003 resource kit.) to...
1
by: Thomas | last post by:
Hi, I implemented a composite pattern which should be serializable to xml. After spending some time in the newsgroups, i finally managed serializing, even with utf-8 instead of utf-16, which...
23
by: VB Programmer | last post by:
Variable scope doesn't make sense to me when it comes to Try Catch Finally. Example: In order to close/dispose a db connection you have to dim the connection outside of the Try Catch Finally...
0
by: Boris Jurado | last post by:
Hi, I'm building a Web Service that in some conditions has to send some particular exceptions. In those cases I'm using a SoapException. The message of those exceptions includes some special...
11
by: stax | last post by:
Hi, Assuming having a method that calls another method which also calls other methods and so on having a long winded tree of methods. What do I do in case it turns out everything has to be...
4
by: bad_boyu | last post by:
Hello, I have the following code: try { Salarii.Editors.AngajatiNewFrm _angNewFrm = new Salarii.Editors.AngajatiNewFrm(); _angNewFrm.Connection = this.Connection; _angNewFrm.ShowInTaskbar =...
3
by: Dmitry Prokoptsev | last post by:
Hello, I need to write a class for exceptions which can be thrown, caught, stored and thrown once again. I have written the following code: --- begin --- #include <string> class Exception...
5
by: Joza | last post by:
Hi! I'm getting error when selecting items in ListView control, it says ArguementOutOfRangeExceptions. That happens in SelectIndexChange event. I have tryed with try...catch but there's no...
25
by: Denis Kukharev | last post by:
I have a problem when catching a plenty of exceptions simultaneously in different threads: the Load Average indicator exceeds 100.0 and the process seems to "hang up". I managed to simulate this...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.