Let $\Omega\subset\mathbb C$ be open, let $z_1,\ldots,z_n\in\Omega$, and let $f:\Omega\setminus\{z_1,\ldots,z_n\}\to\mathbb C$ be holomorphic, with $z_1,\ldots,z_n$ the only isolated singularities of $f$ in $\Omega$. Let $\gamma$ be a closed piecewise $C^1$ path in $\Omega\setminus\{z_1,\ldots,z_n\}$. Suppose $\gamma$ is null-homologous in $\Omega$, meaning
\begin{align*}
n(\gamma,w)=0
\end{align*}
for every $w\in\mathbb C\setminus\Omega$. Then
\begin{align*}
\oint_\gamma f(z)\,dz = 2\pi i\sum_{j=1}^n n(\gamma,z_j)\operatorname{Res}(f,z_j).
\end{align*}