Show
Ignore:
Timestamp:
07/29/07 20:32:02 (1 year ago)
Author:
KirkMcDonald
Message:

Since the D 2.0 series has been found lacking at the moment, Pyd once again compiles under the 1.0 series. (Specifically 1.016 or later; tested with 1.020.)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/infrastructure/pyd/make_object.d

    r120 r121  
    353353        return temp; 
    354354    +/ 
    355     } else static if (is(string : T)) { 
    356         const(char)* result; 
     355    } else static if (is(string : T) || is(char[] : T)) { 
     356        c_str result; 
    357357        PyObject* repr; 
    358358        // If it's a string, convert it 
     
    367367        } 
    368368        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            } 
    377375        } 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        } 
    385378    } else static if (is(T E : E[])) { 
    386379        // Dynamic arrays