File: __init__.py

package info (click to toggle)
pyroute2 0.8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,704 kB
  • sloc: python: 50,245; makefile: 280; javascript: 183; ansic: 81; sh: 44; awk: 17
file content (24 lines) | stat: -rw-r--r-- 569 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'''
This namespace is here only to provide compatibility with 0.6.x

It will be removed in 0.8.x
'''

import sys
import warnings

# load pyroute2 entry points
import pyroute2  # noqa: F401

warnings.warn(
    'pr2modules namespace is deprecated, use pyroute2 instead',
    DeprecationWarning,
)

# alias every `pyroute2` entry, in addition to the block above
#
# Bug-Url: https://github.com/svinota/pyroute2/issues/913
#
for key, value in list(sys.modules.items()):
    if key.startswith("pyroute2."):
        sys.modules[key.replace("pyroute2", "pr2modules")] = value