summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2012-07-21 17:28:56 -0400
committerJason R. Coombs <jaraco@jaraco.com>2012-07-21 17:28:56 -0400
commitd94d073c9bb4fa13c835a9b46350f1bb52265ff3 (patch)
tree6cbd7faeb57bedd20e8cc2bdbaa9eed73a762e7a
parent834b8b7521dbbd2bd25e66e428ba56d2ec78ce83 (diff)
parent0a5180da06efb1d3e854cbdfec458968790c3a5e (diff)
downloadpython-setuptools-git-d94d073c9bb4fa13c835a9b46350f1bb52265ff3.tar.gz
Merged in msabramo/distribute_msabramo_py33 (pull request #10)
--HG-- branch : distribute extra : rebase_source : 8293d555a44b136a77e31caeb8ec27becf19d462
-rw-r--r--setuptools/command/bdist_egg.py6
-rw-r--r--tests/python3.3_bdist_egg_test/module.py0
-rw-r--r--tests/python3.3_bdist_egg_test/setup.py13
-rw-r--r--tests/test_python33_bdist_egg.py19
4 files changed, 37 insertions, 1 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py
index a9d98d3b..cf2d75e4 100644
--- a/setuptools/command/bdist_egg.py
+++ b/setuptools/command/bdist_egg.py
@@ -426,7 +426,11 @@ def scan_module(egg_dir, base, name, stubs):
pkg = base[len(egg_dir)+1:].replace(os.sep,'.')
module = pkg+(pkg and '.' or '')+os.path.splitext(name)[0]
f = open(filename,'rb'); f.read(8) # skip magic & date
- code = marshal.load(f); f.close()
+ try:
+ code = marshal.load(f); f.close()
+ except ValueError:
+ f.seek(0); f.read(12) # skip magic & date & file size; file size added in Python 3.3
+ code = marshal.load(f); f.close()
safe = True
symbols = dict.fromkeys(iter_symbols(code))
for bad in ['__file__', '__path__']:
diff --git a/tests/python3.3_bdist_egg_test/module.py b/tests/python3.3_bdist_egg_test/module.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/python3.3_bdist_egg_test/module.py
diff --git a/tests/python3.3_bdist_egg_test/setup.py b/tests/python3.3_bdist_egg_test/setup.py
new file mode 100644
index 00000000..04caea74
--- /dev/null
+++ b/tests/python3.3_bdist_egg_test/setup.py
@@ -0,0 +1,13 @@
+from setuptools import setup
+
+setup(
+ name='python3.3_bdist_egg_test',
+ version='0.0.0',
+ description='Test',
+ license='BSD',
+ py_modules=['module'],
+ author='Marc Abramowitz',
+ author_email='marc@marc-abramowitz.com',
+ url='https://bitbucket.org/msabramo/python3.3_bdist_egg_test',
+ # zip_safe=False,
+)
diff --git a/tests/test_python33_bdist_egg.py b/tests/test_python33_bdist_egg.py
new file mode 100644
index 00000000..9f32470a
--- /dev/null
+++ b/tests/test_python33_bdist_egg.py
@@ -0,0 +1,19 @@
+import sys
+import os
+import unittest
+
+CURDIR = os.path.abspath(os.path.dirname(__file__))
+TOPDIR = os.path.split(CURDIR)[0]
+sys.path.insert(0, TOPDIR)
+
+from distribute_setup import _python_cmd
+
+class TestPython33BdistEgg(unittest.TestCase):
+
+ def test_build_egg(self):
+ os.chdir(os.path.join(CURDIR, 'python3.3_bdist_egg_test'))
+ self.assertTrue(_python_cmd("setup.py", "bdist_egg"))
+
+
+if __name__ == '__main__':
+ unittest.main()