Hello community,

here is the log from the commit of package python3 for openSUSE:Factory checked 
in at 2015-08-27 08:54:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3 (Old)
 and      /work/SRC/openSUSE:Factory/.python3.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3/python3-base.changes     2015-07-28 
11:42:16.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python3.new/python3-base.changes        
2015-08-27 08:54:01.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Aug 24 17:02:08 UTC 2015 - jmate...@suse.com
+
+- improve import_failed hook to do the right thing when invoking
+  missing modules with "python3 -m modulename" (boo#942751)
+
+-------------------------------------------------------------------
python3.changes: same change

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
python3-doc.spec: same change
python3.spec: same change

++++++ import_failed.py ++++++
--- /var/tmp/diff_new_pack.lGzeUC/_old  2015-08-27 08:54:03.000000000 +0200
+++ /var/tmp/diff_new_pack.lGzeUC/_new  2015-08-27 08:54:03.000000000 +0200
@@ -3,6 +3,11 @@
 
 failed_map_path = os.path.join(get_path('stdlib'), '_import_failed', 
'import_failed.map')
 
+if __spec__:
+    failed_name = __spec__.name
+else:
+    failed_name = __name__
+
 for line in open(failed_map_path):
     words = line.strip().split()
     if not words or words[0][0] == '#':
@@ -10,12 +15,12 @@
     assert words[0][-1] == ':'
     package = words[0][:-1]
 
-    if __name__ in words[1:]:
+    if failed_name in words[1:]:
         raise ImportError("""Module '{}' is not installed.
 Use:
   sudo zypper install {}
-to install it.""".format(__name__, package))
+to install it.""".format(failed_name, package))
 
 raise ImportError("""Module '{}' is not installed.
 It is supposed to be part of python3 distribution, but missing from failed 
import map.
-Please file a bug on the SUSE Bugzilla.""".format(__name__))
+Please file a bug on the SUSE Bugzilla.""".format(failed_name))



Reply via email to