How to calculate Limit of $(1-\sin x)^{(\tan \frac{x}{2} -1)}$ when $x\to \frac{\pi}{2}$. 
How to calculate Limit of $(1-\sin x)^{(\tan \frac{x}{2} -1)}$ when $x\to \frac{\pi}{2}$.

We can write our limit as $\lim_{x\to \frac{\pi}{2}}e^{(\tan \frac{x}{2} -1) \log(1-\sin x)}~ $  but I can not use L'Hopital rule.
Is there another way?

Use $\sin2A=\dfrac{2\tan A}{1+\tan^2A}$ and write $t=\tan\dfrac x2$ to find
$$\dfrac{\lim_{t\to1}(1-t)^{2(t-1)}}{\lim_{t\to1}(1+t^2)^{(t-1)}}$$
The denominator can be handled easily.
For the numerator,
For $t<1,\lim_{t\to1^-}(1-t)^{2(t-1)}=(\lim_{h\to0}h^h)^2$ (setting $t-1=h$)
For $t>1,\lim_{t\to1^+}(1-t)^{2(t-1)}=\lim_{t\to1^+}(t-1)^{2(t-1)}=(\lim_{h\to0}h^h)^{-2}$ (setting $1-t=h$)
