The brothers, aged five and seven, were sleeping in a friend's apartment above the pet store when the snake strangled them, said Royal Canadian Mounted Police Const. Julie Rogers-Marsh.
Police arrived at the apartment in Campbellton, New Brunswick, at 6:30 and found the two boys dead. The friend of the brothers was sleeping in another room and was unharmed, Rogers-Marsh said.
She said the snake was believed to have made its way into the apartment through the ventilation system overnight.
The snake was captured and is in the possession of police. Calls to the pet store were not returned Monday.
"It's very, very unusual and very tragic and difficult for everyone involved," Rogers-Marsh said.
Autopsies will be performed on the two victims on Tuesday.