Changeset 943
- Timestamp:
- 02/28/00 03:10:54 (9 years ago)
- Files:
-
- cdat/trunk/cdat/Modules/Cdunifmodule.c (modified) (6 diffs)
- cdat/trunk/cdat/Packages/cdms/dataset.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cdat/trunk/cdat/Modules/Cdunifmodule.c
r845 r943 307 307 /* Check the filetype */ 308 308 *filetype=CuGetFileType(controlpath); 309 if (*filetype==CuUnknown) 310 return -1; 309 311 if (*filetype==CuNetcdf) 310 312 return ncopen(controlpath,mode); … … 499 501 Py_DECREF(string); 500 502 } 503 free(s); 501 504 } 502 505 } … … 661 664 } 662 665 if (self->id == -1) { 663 Cdunif_seterror(); 666 if (self->filetype == CuUnknown){ 667 PyErr_SetObject(CdunifError, Py_BuildValue( "ss","Cannot open file:",filename)); 668 } 669 else{ 670 Cdunif_seterror(); 671 } 664 672 PyCdunifFileObject_dealloc(self); 665 673 return NULL; … … 747 755 } 748 756 collect_attributes(self, NC_GLOBAL, self->attributes, ngattrs); 757 return 1; 749 758 } 750 759 … … 1791 1800 if (lastloop >= 0) { 1792 1801 for (i = lastloop; i >= 0; i--) { 1793 while ( !loop[i] && i >= 0)1802 while (i>=0 && !loop[i]) 1794 1803 i--; 1795 1804 if (i >= 0) { … … 1817 1826 if (current != NULL) 1818 1827 free(current); 1828 if (loop != NULL) 1829 free(loop); 1819 1830 } 1820 1831 free(dims); cdat/trunk/cdat/Packages/cdms/dataset.py
r845 r943 510 510 if cdmsobj._debug==1: 511 511 print 'Deleting file',self.id 512 if self.dictdict != {}: 512 # If the object has been deallocated due to open error, 513 # it will not have an attribute .dictdict 514 if hasattr(self,"dictdict") and self.dictdict != {}: 513 515 self.close() 514 516