Money is hard to come by in Minnesota, where a state government shutdown continues. But Chicago's coffers must be overflowing. How else to explain the money it's willing to spend on lawyers, defending gun range requirements that seem doomed in court?

A year ago, after losing a landmark federal gun case, McDonald v. City of Chicago, that city — which historically has had some of the toughest gun laws in the nation — passed an ordinance requiring handgun owners to get training before receiving permits.

Simultaneously, it banned gun ranges in the city, in essence forcing applicants to go to suburban ranges (or elsewhere) to complete the training.

But in a 3-0 ruling Wednesday, the U.S. Court of Appeals for the Seventh Circuit ordered a preliminary injunction against Chicago that prevents it from banning gun ranges within city limits.

"This is a significant victory that could have strong implications well beyond the Chicago city limits," said Second Amendment Foundation Executive Vice President Alan Gottlieb. "The court is making it clear that cities cannot adopt firearms ordinances that are so deliberately restrictive that they make it impossible for citizens to exercise their rights under the Second Amendment."

Judge Diane S. Sykes, writing for the Appeals Court, said, "It's hard to imagine anyone suggesting that Chicago may prohibit the exercise of a free-speech or religious-liberty right within its borders on the rationale that those rights may be freely enjoyed in the suburbs. That sort of argument should be no less unimaginable in the Second Amendment context." In a concurring opinion, Judge Ilana Diamond Rovner wrote, "The city may not condition gun ownership for self-defense in the home on a prerequisite that the city renders impossible to fulfill within the city limits."

Not to be outdone, and anticipating the court likely would rule against it, the Chicago city council on Wednesday adopted a new gun range ordinance.

It allows indoor ranges only, and only in parts of the city zoned for manufacturing. The ranges can't be within 1,000 feet of schools, residential areas, hospitals, museums, libraries, parks and liquor stores, and range operators must pay $4,000 every other year for a license.

Those restrictions will also be challenged in court by an array of pro-gun interests.

"This is just like they did last July when they scurried to pass an overly restrictive gun ordinance" after the Supreme Court ruling, attorney Walter Maksym told the Associated Press. "It is fine to have reasonable restrictions but these restrictions ... amount to almost a prohibition."

James Balcer, the alderman who introduced the gun-range measure that passed Wednesday, said he is confident it will hold up in court.

"We're trying to stay one step ahead," he told the AP.