Code Duplication    Length = 9-10 lines in 2 locations

tools/wandbox/iuwandbox.py 2 locations

@@ 549-558 (lines=10) @@
546
            print('  If you do not use boost test, please specify the file with the main function first.')
547
548
549
def text_transform(value):
550
    try:
551
        if isinstance(value, str):
552
            return value.decode()
553
        elif isinstance(value, unicode):
554
            return value.encode('utf_8')
555
    except:
556
        pass
557
    return value
558
559
560
# show result
561
def show_result(r, options):
@@ 568-576 (lines=9) @@
565
    if options.stderr:
566
        if 'compiler_output' in r:
567
            print('compiler_output:')
568
            print(text_transform(r['compiler_output']))
569
        if 'compiler_error' in r:
570
            sys.stderr.write(text_transform(r['compiler_error']))
571
        if 'program_output' in r:
572
            print('program_output:')
573
            print(text_transform(r['program_output']))
574
        if options.xml is None and options.junit is None and 'program_error' in r:
575
            sys.stderr.write(text_transform(r['program_error']))
576
    else:
577
        if 'compiler_message' in r:
578
            print('compiler_message:')
579
            print(text_transform(r['compiler_message']))