Numerical integration by Gaussian quadrature is considered in cases where poles, or other singularities, are located near the interval of integration. The manner of dealing with such singularities consists in suitably modifying Gaussian quadrature rules and the related orthogonal polynomials. Several examples are given, taken from quantum chemistry and solid state physics.