Change ComplexInfinity in 1/0 to Infinity?

Good day, everyone
I have a problem in Mathematica 9.0
For example, I determine function:

f[x_] = ArcTan[1/Sin[x]]

but result of f[0] is:

Indeterminate

because result of 1/Sin[0] is ComplexInfinity.
How I can change it(ComplexInfinity) to Infinity.

One way could be with Piecewise:

f[x_] = Piecewise[{{Infinity, Sin[x] == 0}, {ArcTan[1/Sin[x]], True}}]

It depends on what you are going to do with this function. Numerics? Symbolics? Graphics?

Thank you very much.
My problem is that i get function f[x] after solving some equations (Solve function).
And this function generally f[x]=ArcTan[g[x]/Sin[x]].
Then i need to get some plots and animations of function contain function f[x] and derivatives of f[x].
And i have problems in points Pi*k because of Indeterminate

Mathematica version 11 is supposed to take care of singularities when plotting. For previous versions you can use Exclusions:

Plot[ArcTan[1/Sin[x]], {x, -3 Pi, 3 Pi}, Exclusions -> {Sin[x] == 0}]

I would recommend to add a special case:

f[x_] := ArcTan[1/Sin[x]]
f[0] := Limit[ArcTan[1/Sin[x]], x -> 0, Direction -> -1]

so it handles the singularity as it should (you can change the direction to 1 to approach the singularity from the other side.

And what about functions where i don’t know in what point i have 1/0. Is it possible to change the Wolfram Mathematica rule. I mean, is it possible to force Wolfram Mathematica to count 1/0=Infinity not 1/0=ComplexInfinity?

you can use replace after your computation:

expression /. ComplexInfinity[___] :> Infinity

It’s pitty but it does not work, for example:
Tan[1/0] /. ComplexInfinity[___] :> Infinity

Sorry about that:

Tan[(1/0) /. ComplexInfinity :> Infinity]

now it should work.

But this does not make much sense; it’s asking basically to compute Exp[1/0], which, to my mind, makes little sense…

For the ArcTan case use the two-argument version to avoid division by zero:

ArcTan[0, 1]

Thank you very much!