diff options
| author | jason | 2012-08-08 23:56:42 -0600 |
|---|---|---|
| committer | jason | 2012-08-08 23:56:42 -0600 |
| commit | 7366401b6f9cbda4882ee353538464631f9b9a69 (patch) | |
| tree | 3ea4f3bcf1f7db45905d0026e533ce25196b4db9 | |
| parent | 2b4fb20686383f01c32c3c21c526aea28f784956 (diff) | |
| download | warmachine-7366401b6f9cbda4882ee353538464631f9b9a69.tar.gz warmachine-7366401b6f9cbda4882ee353538464631f9b9a69.zip | |
fixed a bug that crashed warmachine if you tried loading a class that doesn't exist in a module that does.
| -rw-r--r-- | wmd/irc.py | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -70,7 +70,12 @@ class IRC(object): | |||
| 70 | self.log("Error loading module: %s" %(path,)) | 70 | self.log("Error loading module: %s" %(path,)) |
| 71 | return | 71 | return |
| 72 | 72 | ||
| 73 | classz = getattr(module, class_name) | 73 | try: |
| 74 | classz = getattr(module, class_name) | ||
| 75 | except AttributeError: | ||
| 76 | self.log("Class does not exist in module") | ||
| 77 | return | ||
| 78 | |||
| 74 | self.actions[class_name] = classz() | 79 | self.actions[class_name] = classz() |
| 75 | 80 | ||
| 76 | def __call__(self, *args, **kwargs): | 81 | def __call__(self, *args, **kwargs): |