← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-replace-new-module into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-replace-new-module into launchpad:master.

Commit message:
Use types.ModuleType rather than new.module

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/381336

The "new" standard library module was deprecated in Python 2.6 and removed in 3.0.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-replace-new-module into launchpad:master.
diff --git a/lib/lp/app/doc/menus.txt b/lib/lp/app/doc/menus.txt
index 74aabff..e982b25 100644
--- a/lib/lp/app/doc/menus.txt
+++ b/lib/lp/app/doc/menus.txt
@@ -31,9 +31,9 @@ later, implementations having facets and menus will be defined.
 
     # Create a fake module that we'll patch our examples into.
 
-    >>> import new
     >>> import sys
-    >>> cookingexample = new.module('cookingexample')
+    >>> import types
+    >>> cookingexample = types.ModuleType('cookingexample')
     >>> sys.modules['lp.app.cookingexample'] = cookingexample
 
     >>> cookingexample.ICookbook = ICookbook

Follow ups