Skip to content

Commit

Permalink
Cut at 80 columns
Browse files Browse the repository at this point in the history
  • Loading branch information
thierry-martinez committed Feb 14, 2020
1 parent 81f0903 commit 11d683e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
19 changes: 12 additions & 7 deletions py.ml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ let extract_version_major_minor version =
with Exit | Failure _ ->
let msg =
Printf.sprintf
"Py.extract_version_major_minor: unable to parse the version number '%s'"
"Py.extract_version_major_minor:\
unable to parse the version number '%s'"
version in
failwith msg

Expand Down Expand Up @@ -221,7 +222,8 @@ let libpython_from_ldconfig major minor =
match major, minor with
None, _ -> "libpython"
| Some major', None -> Printf.sprintf "libpython%d" major'
| Some major', Some minor' -> Printf.sprintf "libpython%d.%d" major' minor' in
| Some major', Some minor' ->
Printf.sprintf "libpython%d.%d" major' minor' in
let is_libpython line =
let basename = Filename.basename line in
Pyutils.has_prefix prefix basename in
Expand Down Expand Up @@ -364,10 +366,12 @@ let libpython_from_pkg_config version_major version_minor =
if String.length word > 2 then
match String.sub word 0 2 with
"-L" ->
let word' = Pyutils.substring_between word 2 (String.length word) in
let word' =
Pyutils.substring_between word 2 (String.length word) in
(word' :: library_paths, library_filename)
| "-l" ->
let word' = Pyutils.substring_between word 2 (String.length word) in
let word' =
Pyutils.substring_between word 2 (String.length word) in
if library_filename <> None then
unable_to_parse ();
let library_filename =
Expand Down Expand Up @@ -1382,7 +1386,8 @@ module Object = struct

let is_instance obj cls = bool_of_int (Pywrappers.pyobject_isinstance obj cls)

let is_subclass cls1 cls2 = bool_of_int (Pywrappers.pyobject_issubclass cls1 cls2)
let is_subclass cls1 cls2 =
bool_of_int (Pywrappers.pyobject_issubclass cls1 cls2)

let print obj out_channel =
assert_int_success
Expand Down Expand Up @@ -2092,8 +2097,8 @@ module Class = struct
let classname = String.of_string classname in
let dict = Dict.of_bindings_string fields in
let c =
check_not_null
(Pywrappers.Python2.pyclass_new (Tuple.of_list parents) dict classname) in
check_not_null (Pywrappers.Python2.pyclass_new (Tuple.of_list parents)
dict classname) in
let add_method (name, closure) =
let m = check_not_null (Pywrappers.pymethod_new closure null c) in
Dict.set_item_string dict name m in
Expand Down
4 changes: 2 additions & 2 deletions pyml_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ let () =
assert (Py.List.length v = 0);
let count = Py.Object.call_method v "count" [|Py.Long.of_int 1|] in
assert (Py.Long.to_int count = 0);
List.iter
(fun i -> ignore (Py.Object.call_method v "append" [|Py.Long.of_int i|]))
List.iter (fun i ->
ignore (Py.Object.call_method v "append" [|Py.Long.of_int i|]))
pi_digits;
let count = Py.Object.call_method v "count" [|Py.Long.of_int 1|] in
assert (Py.Long.to_int count = 2);
Expand Down

0 comments on commit 11d683e

Please sign in to comment.