Skip to content

Commit

Permalink
[mod_avmd, esl/python] Two build fixups (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
LorbusChris committed Mar 24, 2021
1 parent 4e581b0 commit 513b0fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 7 additions & 7 deletions libs/esl/python/python-config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#! /usr/bin/python2.5
#!/usr/bin/env python

from __future__ import print_function
import sys
import os
import getopt
Expand All @@ -9,8 +10,7 @@ valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
'ldflags', 'help']

def exit_with_usage(code=1):
print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
'|'.join('--'+opt for opt in valid_opts))
print("Usage: %s [%s]" % (sys.argv[0], '|'.join('--'+opt for opt in valid_opts)), file=sys.stderr)
sys.exit(code)

try:
Expand All @@ -30,17 +30,17 @@ if opt == '--help':
exit_with_usage(0)

elif opt == '--prefix':
print sysconfig.PREFIX
print(sysconfig.PREFIX)

elif opt == '--exec-prefix':
print sysconfig.EXEC_PREFIX
print(sysconfig.EXEC_PREFIX)

elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True)]
if opt == '--cflags':
flags.extend(getvar('CFLAGS').split())
print ' '.join(flags)
print(' '.join(flags))

elif opt in ('--libs', '--ldflags'):
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
Expand All @@ -49,5 +49,5 @@ elif opt in ('--libs', '--ldflags'):
# shared library in prefix/lib/.
if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
print ' '.join(libs)
print(' '.join(libs))

4 changes: 3 additions & 1 deletion src/mod/applications/mod_avmd/mod_avmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1343,8 +1343,10 @@ static switch_status_t avmd_parse_cmd_data(avmd_session_t *s, const char *cmd_da
switch_assert(argv[idx]);
status = avmd_parse_cmd_data_one_entry(argv[idx], &settings);
if (status != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(s->session), SWITCH_LOG_ERROR,
if (argv[idx]) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(s->session), SWITCH_LOG_ERROR,
"Error parsing option [%d] [%s]\n", idx + 1, argv[idx]); /* idx + 1 to report option 0 as 1 for users convenience */
}
switch (status)
{
case SWITCH_STATUS_TERM:
Expand Down

0 comments on commit 513b0fb

Please sign in to comment.