Changeset 121 for trunk/infrastructure/pyd/make_object.d
- Timestamp:
- 07/29/07 20:32:02 (1 year ago)
- Files:
-
- trunk/infrastructure/pyd/make_object.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/infrastructure/pyd/make_object.d
r120 r121 353 353 return temp; 354 354 +/ 355 } else static if (is(string : T) ) {356 c onst(char)*result;355 } else static if (is(string : T) || is(char[] : T)) { 356 c_str result; 357 357 PyObject* repr; 358 358 // If it's a string, convert it … … 367 367 } 368 368 if (result is null) handle_exception(); 369 return .toString(result); 370 } else static if (is(char[] : T)) { 371 const(char)* result; 372 PyObject* repr; 373 // If it's a string, convert it 374 if (PyString_Check(o) || PyUnicode_Check(o)) { 375 result = PyString_AsString(o); 376 // If it's something else, convert its repr 369 version (D_Version2) { 370 static if (is(string : T)) { 371 return .toString(result); 372 } else { 373 return .toString(result).dup; 374 } 377 375 } else { 378 repr = PyObject_Repr(o); 379 if (repr is null) handle_exception(); 380 result = PyString_AsString(repr); 381 Py_DECREF(repr); 382 } 383 if (result is null) handle_exception(); 384 return .toString(result).dup; 376 return .toString(result).dup; 377 } 385 378 } else static if (is(T E : E[])) { 386 379 // Dynamic arrays
