unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13570: 24.2; (python.el) "ValueError: Attempted relative import in non-package" with relative import.
@ 2013-01-27 22:40 Oleksandr Gavenko
  2013-01-28 21:08 ` bug#13570: [PATCH] " Oleksandr Gavenko
  2014-07-27  6:41 ` bug#13570: " Fabián Ezequiel Gallina
  0 siblings, 2 replies; 3+ messages in thread
From: Oleksandr Gavenko @ 2013-01-27 22:40 UTC (permalink / raw)
  To: 13570

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!





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-27  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-27 22:40 bug#13570: 24.2; (python.el) "ValueError: Attempted relative import in non-package" with relative import Oleksandr Gavenko
2013-01-28 21:08 ` bug#13570: [PATCH] " Oleksandr Gavenko
2014-07-27  6:41 ` bug#13570: " Fabián Ezequiel Gallina

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).