Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix all unit tests and add python 2.6 build to travis#10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tonyroberts merged 4 commits intopythonnet:developfromtonyroberts:travis-ci
Feb 27, 2014
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions.travis.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
language: python
python:
- 2.6
- 2.7
before_install:
- sudo apt-get install software-properties-common
Expand Down
26 changes: 21 additions & 5 deletionspythonnet/setupmono.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
from distutils.command.build_ext import build_ext
from distutils.sysconfig import get_config_vars
from platform import architecture
from subprocess importcheck_output, check_call
from subprocess importPopen, CalledProcessError, PIPE, check_call
import shutil
import sys
import os
Expand DownExpand Up@@ -77,10 +77,10 @@ def build_extension(self, ext):


def _build_monoclr(self, ext):
mono_libs =check_output("pkg-config --libs mono-2", shell=True)
mono_cflags =check_output("pkg-config --cflags mono-2", shell=True)
glib_libs =check_output("pkg-config --libs glib-2.0", shell=True)
glib_cflags =check_output("pkg-config --cflags glib-2.0", shell=True)
mono_libs =_check_output("pkg-config --libs mono-2", shell=True)
mono_cflags =_check_output("pkg-config --cflags mono-2", shell=True)
glib_libs =_check_output("pkg-config --libs glib-2.0", shell=True)
glib_cflags =_check_output("pkg-config --cflags glib-2.0", shell=True)
cflags = mono_cflags.strip() + " " + glib_cflags.strip()
libs = mono_libs.strip() + " " + glib_libs.strip()

Expand DownExpand Up@@ -129,6 +129,22 @@ def _build_monoclr(self, ext):
debug=self.debug)


def _check_output(*popenargs, **kwargs):
"""subprocess.check_output from python 2.7.
Added here to support building for earlier versions
of Python.
"""
process = Popen(stdout=PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
raise CalledProcessError(retcode, cmd, output=output)
return output


if __name__ == "__main__":
setup(name="pythonnet",
ext_modules=[
Expand Down
8 changes: 8 additions & 0 deletionspythonnet/src/runtime/converter.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -540,6 +540,14 @@ static bool ToPrimitive(IntPtr value, Type obType, out Object result,
if (Exceptions.ErrorOccurred()) {
goto overflow;
}

IntPtr check = Runtime.PyLong_FromUnsignedLong(ui);
int err = Runtime.PyObject_Compare(check, op);
Runtime.Decref(check);
if (0 != err || Exceptions.ErrorOccurred()) {
goto overflow;
}

result = ui;
return true;

Expand Down
5 changes: 4 additions & 1 deletionpythonnet/src/tests/runtests.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,10 +62,13 @@ def main(verbosity=1):
module = __import__(name)
suite.addTests((module.test_suite(),))

unittest.TextTestRunner(verbosity=verbosity).run(suite)
result = unittest.TextTestRunner(verbosity=verbosity).run(suite)
if not result.wasSuccessful():
raise Exception("Tests failed")

if __name__ == '__main__':
main(1)
if '--pause' in sys.argv:
print "Press enter to continue"
raw_input()


[8]ページ先頭

©2009-2025 Movatter.jp