mirror of
https://github.com/kennethreitz-archive/pyinstaller.git
synced 2026-06-05 23:50:17 +00:00
Bug #60: Relative import syntax (dots) does not disable top-level (absolute) imports.
git-svn-id: http://svn.pyinstaller.org/trunk@679 8dd32b29-ccff-0310-8a9a-9233e24343b1
This commit is contained in:
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
from .relimp3b import b1
|
||||
from .relimp3c import c1
|
||||
|
||||
def getString():
|
||||
return b1.string + c1.string
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
class c1:
|
||||
string = "... and this"
|
||||
@@ -0,0 +1 @@
|
||||
raise ValueError
|
||||
@@ -0,0 +1 @@
|
||||
raise ValueError
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
string = "I hope you see this!"
|
||||
@@ -0,0 +1 @@
|
||||
raise RuntimeError
|
||||
@@ -0,0 +1,4 @@
|
||||
from relimp3a.aa import a1
|
||||
|
||||
if __name__ == '__main__':
|
||||
print a1.getString()
|
||||
@@ -0,0 +1,17 @@
|
||||
# -*- mode: python -*-
|
||||
|
||||
__testname__ = 'test-relative-import3'
|
||||
|
||||
a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'),
|
||||
__testname__ + '.py'],
|
||||
)
|
||||
pyz = PYZ(a.pure)
|
||||
exe = EXE(pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
name = os.path.join('dist', __testname__, __testname__ +'.exe'),
|
||||
debug=False,
|
||||
strip=False,
|
||||
upx=False,
|
||||
console=1 )
|
||||
@@ -406,7 +406,7 @@ class ImportManager:
|
||||
if level > 1:
|
||||
importernm = _string_split(importernm, '.')[:-level+1]
|
||||
importernm = _string_join('.', importernm)
|
||||
contexts = []
|
||||
contexts = [None]
|
||||
if importernm:
|
||||
if ispkg:
|
||||
# If you use the "from __init__ import" syntax, the package
|
||||
|
||||
Reference in New Issue
Block a user