File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import atexit
1516import os
1617import shelve
1718from ..util import u
1819
1920_DIR , _ = os .path .split (__file__ )
2021CARRIER_LONGEST_PREFIX = 9
21- CARRIER_DATA = shelve .open (os .path .join (_DIR , "carrierdata" ), "r" )
22+ CARRIER_DATA = shelve .open (os .path .join (_DIR , "carrierdata.db" ), "r" )
23+ atexit .register (lambda : CARRIER_DATA .close ())
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import atexit
1516import os
1617import shelve
1718from ..util import u
1819
1920_DIR , _ = os .path .split (__file__ )
2021GEOCODE_LONGEST_PREFIX = 9
21- GEOCODE_DATA = shelve .open (os .path .join (_DIR , "geodata" ), "r" )
22+ GEOCODE_DATA = shelve .open (os .path .join (_DIR , "geodata.db" ), "r" )
23+ atexit .register (lambda : GEOCODE_DATA .close ())
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import atexit
1516import os
1617import shelve
1718from ..util import u
1819
1920_DIR , _ = os .path .split (__file__ )
2021TIMEZONE_LONGEST_PREFIX = 7
21- TIMEZONE_DATA = shelve .open (os .path .join (_DIR , "tzdata" ), "r" )
22+ TIMEZONE_DATA = shelve .open (os .path .join (_DIR , "tzdata.db" ), "r" )
23+ atexit .register (lambda : TIMEZONE_DATA .close ())
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import atexit
1516import os
1617import shelve
1718from phonenumbers .util import u
1819
1920_DIR , _ = os .path .split (__file__ )
2021CARRIER_LONGEST_PREFIX = 7
21- CARRIER_DATA = shelve .open (os .path .join (_DIR , "carrierdata" ), "r" )
22+ CARRIER_DATA = shelve .open (os .path .join (_DIR , "carrierdata.db" ), "r" )
23+ atexit .register (lambda : CARRIER_DATA .close ())
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import atexit
1516import os
1617import shelve
1718from phonenumbers .util import u
1819
1920_DIR , _ = os .path .split (__file__ )
2021GEOCODE_LONGEST_PREFIX = 7
21- GEOCODE_DATA = shelve .open (os .path .join (_DIR , "geodata" ), "r" )
22+ GEOCODE_DATA = shelve .open (os .path .join (_DIR , "geodata.db" ), "r" )
23+ atexit .register (lambda : GEOCODE_DATA .close ())
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import atexit
1516import os
1617import shelve
1718from phonenumbers .util import u
1819
1920_DIR , _ = os .path .split (__file__ )
2021TIMEZONE_LONGEST_PREFIX = 7
21- TIMEZONE_DATA = shelve .open (os .path .join (_DIR , "tzdata" ), "r" )
22+ TIMEZONE_DATA = shelve .open (os .path .join (_DIR , "tzdata.db" ), "r" )
23+ atexit .register (lambda : TIMEZONE_DATA .close ())
You can’t perform that action at this time.
0 commit comments