File tree Expand file tree Collapse file tree 2 files changed +0
-12
lines changed Expand file tree Collapse file tree 2 files changed +0
-12
lines changed Original file line number Diff line number Diff line change @@ -5890,12 +5890,7 @@ function TPythonEngine.VariantAsPyObject( const V : Variant ) : PPyObject;
5890
5890
wStr := ' '
5891
5891
else
5892
5892
wStr := DeRefV;
5893
- { $IFDEF PREFER_UNICODE}
5894
5893
Result := PyUnicode_FromWideChar( PWideChar(wStr), Length(wStr) );
5895
- { $ELSE}
5896
- s := wStr;
5897
- Result := PyString_FromStringAndSize(PAnsiChar(s), Length(s));
5898
- { $ENDIF}
5899
5894
end ;
5900
5895
varString:
5901
5896
begin
@@ -5905,12 +5900,7 @@ function TPythonEngine.VariantAsPyObject( const V : Variant ) : PPyObject;
5905
5900
varUString:
5906
5901
begin
5907
5902
wStr := DeRefV;
5908
- { $IFDEF PREFER_UNICODE}
5909
5903
Result := PyUnicode_FromWideChar( PWideChar(wStr), Length(wStr) );
5910
- { $ELSE}
5911
- s := wStr;
5912
- Result := PyString_FromStringAndSize(PAnsiChar(s), Length(s));
5913
- { $ENDIF}
5914
5904
end ;
5915
5905
else
5916
5906
if VarType(DeRefV) and varArray <> 0 then
Original file line number Diff line number Diff line change @@ -523,13 +523,11 @@ procedure TMain.btnTestStringsClick(Sender: TObject);
523
523
Assert( VarIsPythonUnicode(c.GetItem(0 )) );
524
524
Assert( c.GetItem(0 ) = ' Hello world!' );
525
525
Assert( c.GetItem(0 ) = w );
526
- { $IFDEF PREFER_UNICODE}
527
526
c := w;
528
527
b := VarPythonCreate(c);
529
528
Assert( VarIsPythonUnicode(b) );
530
529
Assert( b = c );
531
530
Assert( b = w );
532
- { $ENDIF}
533
531
// empty strings
534
532
a := VarPythonEval( ' u""' );
535
533
Assert(a.length = 0 );
You can’t perform that action at this time.
0 commit comments