​The Los Angeles City Council on Wednesday will consider amending its medical marijuana ordinance, because one of its obscure provisions unexpectedly disqualified 140 cannabis dispensaries from continuing operations, leaving only 40 shops.

When the council approved the ordinance last spring, it allowed up to 180 dispensaries — those that had registered with the city before a moratorium was imposed in 2007 — to stay open, if they were at least 1,000 feet from homes, schools, religious institutions and other dispensaries, reports NBC Los Angeles

The ordinance ended up disqualifying 140 dispensaries, leaving only 40 allowed, because of a little-known provision barring any management changes in the past three years. The office of hotshot City Attorney Carmen “Nuch” Trutanich, already a notorious foe of safe access for patients, didn’t lose any time, promptly suing some of them in an effort to force them to shut down.

Wednesday’s proposed amendment, introduced by Councilman Paul Koretz, would allow dispensaries to remain open as long as they have “substantially” the same ownership and management as in their registration papers.

While some council members were nervous about amending the ordinance, others warned that having only 40 dispensaries in a metropolis the size of Los Angeles would reduce patients’ safe access to medical marijuana.

The council passed their medical marijuana ordinance last spring in response to more than 800 dispensaries opening across the city after the discovery of a legal loophole — the boilerplate “hardship” language included in the original 2007 dispensary moratorium.

The ordinance capped at 70 the number of dispensaries in Los Angeles, but temporarily allowed the 180 dispensaries registered before the 2007 moratorium to stay open. Under the ordinance, if any of the 180 dispensaries goes out of business, it would not be replaced until the number drops to 70.

In addition to the 1,000-foot rule, the ordinance bars dispensaries from being “on a lot abutting, across the street or alley from, or having a common corner with a residentially zoned lot or a lot improved with residential use.”

The city clerk will establish a priority list to determine which dispensary can stay open and which one must move if two dispensaries are within 1,000 feet of each other.