Just a suggestion - it might be easier to read if you separated the under 1.7 handling, like this: (I'm pretty sure this does the same thing as the current function).  To me, this also makes it easier to see that under 1.7 it returns a timedelta and above 1.7 it returns a timedelta64 type.

```python
def _coerce_scalar_to_timedelta_type(r):
    # kludgy here until we have a timedelta scalar
    # handle the numpy < 1.7 case

    if is_integer(r):
        r = timedelta(microseconds=r/1000)

    if _np_version_under1p7:
        if not isinstance(r, timedelta):
            raise AssertionError("Invalid type for timedelta scalar: %s" % type(r))
        return r

    if isinstance(r, timedelta):
        r = np.timedelta64(r)
    elif not isinstance(r, np.timedelta64):
        raise AssertionError("Invalid type for timedelta scalar: %s" % type(r))
    return r.astype('timedelta64[ns]')

```