Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes Class Reference
Inheritance diagram for
Inheritance graph
Collaboration diagram for
Collaboration graph

List of all members.

Public Member Functions

def __init__
def __enter__
def __exit__

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Context manager to temporarily add directories to sys.path.

This makes a copy of sys.path, appends any directories given
as positional arguments, then reverts sys.path to the copied
settings when the context ends.

Note that *all* sys.path modifications in the body of the
context manager, including replacement of the object,
will be reverted at the end of the block.

Definition at line 809 of file

Constructor & Destructor Documentation

def (   self,

Definition at line 821 of file

00822     def __init__(self, *paths):
00823         self.original_value = sys.path[:]
00824         self.original_object = sys.path
00825         sys.path.extend(paths)

Here is the caller graph for this function:

Member Function Documentation

Definition at line 826 of file

00827     def __enter__(self):
00828         return self

def (   self,

Definition at line 829 of file

00830     def __exit__(self, *ignore_exc):
00831         sys.path = self.original_object
00832         sys.path[:] = self.original_value

Here is the caller graph for this function:

Member Data Documentation

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 823 of file

Definition at line 822 of file

The documentation for this class was generated from the following file: