summaryrefslogtreecommitdiffstats
path: root/Lib/venv
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2013-07-12 20:10:19 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2013-07-12 20:10:19 (GMT)
commitc07aa9e41f17c0821b811c52865a527785877287 (patch)
tree757cb96b326e368d2dd8938d7c5afd11c9614dc2 /Lib/venv
parent3c557f298a53306464b81b54ddcbff53d39ae7dc (diff)
downloadcpython-c07aa9e41f17c0821b811c52865a527785877287.zip
cpython-c07aa9e41f17c0821b811c52865a527785877287.tar.gz
cpython-c07aa9e41f17c0821b811c52865a527785877287.tar.bz2
Issue #18435: Replaced simple attribute container class Context with types.SimpleNamespace.
Diffstat (limited to 'Lib/venv')
-rw-r--r--Lib/venv/__init__.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 3920747..272a887 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -37,15 +37,10 @@ try:
import threading
except ImportError:
threading = None
+import types
logger = logging.getLogger(__name__)
-class Context:
- """
- Holds information about a current venv creation/upgrade request.
- """
- pass
-
class EnvBuilder:
"""
@@ -108,7 +103,7 @@ class EnvBuilder:
raise ValueError('Directory exists: %s' % env_dir)
if os.path.exists(env_dir) and self.clear:
shutil.rmtree(env_dir)
- context = Context()
+ context = types.SimpleNamespace()
context.env_dir = env_dir
context.env_name = os.path.split(env_dir)[1]
context.prompt = '(%s) ' % context.env_name