emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#13570: closed (24.2; (python.el) "ValueError: Atte


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#13570: closed (24.2; (python.el) "ValueError: Attempted relative import in non-package" with relative import.)
Date: Sun, 27 Jul 2014 06:42:02 +0000

Your message dated Sun, 27 Jul 2014 03:41:52 -0300
with message-id <address@hidden>
and subject line 24.2; (python.el) "ValueError: Attempted relative import in 
non-package" with relative import.
has caused the debbugs.gnu.org bug report #13570,
regarding 24.2; (python.el) "ValueError: Attempted relative import in 
non-package" with relative import.
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
13570: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13570
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.2; (python.el) "ValueError: Attempted relative import in non-package" with relative import. Date: Mon, 28 Jan 2013 00:40:20 +0200
In GNU Emacs 24.2.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2013-01-21 on trouble, modified by Debian

  # mkdir package
  # cd package

  # cat <<EOF >cmd.py
  from . import lib
  lib.ok()
  EOF

  # cat <<EOF >lib.py
  def ok():
      print('ok')
  EOF

When you open cmd.py and try C-c C-l (python-load-file) you get:

  >>> Traceback (most recent call last):
  Traceback (most recent call last):
    File "/home/user/devel/tmp/package/cmd.py", line 1, in <module>
      from . import lib
  ValueError: Attempted relative import in non-package

With C-c C-c (python-send-string) ever worse: it uses (make-temp-file "py") so
relative import is not possible!!

-- 
Best regards!



--- End Message ---
--- Begin Message --- Subject: 24.2; (python.el) "ValueError: Attempted relative import in non-package" with relative import. Date: Sun, 27 Jul 2014 03:41:52 -0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Fixed at revno 117584 in trunk.

The new `python-shell-package-enable' command let's you enable a package
for the current shell and use relative imports in evaled code.


Cheers,
Fabián


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]