Is the limit $\lim_{x \to 1}{(2-x)}^{\tan(\pi/2)x}$ undefined? I'm preparing for a calculus exam and came across this limit:

$$\lim_{x \to 1}{(2-x)}^{\tan(\pi/2)x}$$

Of course $\tan(\pi/2)$ is undefined, but the excercise was a multiple choice with options $\infty$, 0, e, $e^\pi$ and $e^{2/\pi}$

So WolframAlpha says $\tan(\pi/2)$ is $\infty$, I figured this is a $1^\infty$ indeterminate and first tried to rewrite it like this:

$$
\lim_{x \to 1}{(1+(1-x))}^{(1-x)^{-1}(1-x)\tan(\pi/2)x}
$$

And I have $$\lim_{x \to 1}{(1+(1-x))}^{(1-x)^{-1}}=e$$

But then I got stuck trying to calculate $$\lim_{x \to 1}(1-x)\tan(\pi/2)x$$

I've also tried other methods but everything I try I end up stuck in a similar situation. Also, all the ways I can think of to calculate this limit seem too far-fetched (including the one above).

So, is the excercise wrong? If it's undefined, is it because of $\tan(\pi/2)$ or is there some other argument?
When it says $\tan(\pi/2)x$, it's meant to be interpreted as $\tan((\pi/2)x)$, not $(\tan(\pi/2))x$ (yes, it is terrible notation).  So the expression $(x-1)\tan((\pi/2)x)$ is a $0\cdot\infty$ indeterminate form as $x\to 1$ and you can try using L'Hopital's rule.  If it were $(\tan(\pi/2))x$, the expression would of course be undefined for all values of $x$, and so it would be meaningless to talk about the limit.

(If this confusion is not what you are actually asking about, apologies and I will delete this answer!)
You can do without taking logarithms too! Do it by writing the limit as follows
$$
\lim_{x\to 1}(1-x)\tan\left(\frac{\pi x}{2}\right) =\lim_{x\to 1} \frac{1-x}{\cot\left(\frac{\pi x}{2}\right)} 
$$
and then apply L'Hopital's rule to get the required answer. It works: I wanted to upload a scan of the solution but the size of loadable images is limited to 2Mb.